Sun

Sun (or sun points) is the resource players need to build their plants, which makes it essential to create defenses against zombies. You need sun or you will be brainless in no time.

How to Use It
Each plant costs a certain amount of sun to plant, limiting the number of plants you can place on the lawn at a time. Your planting is also limited by the recharge or the "cooldown" rate of the seed packets. Also, upgrade plants cannot be planted unless the plant of which they are an upgrade of have already been planted, even if you have enough sun for them. The only plants that do not cost sun to plant are the Puff-shroom, its aquatic cousin the Sea-shroom, and Imitater versions of them.

How to Obtain It
Sun is obtained from Sun-producing plants, such as the Sunflower, Twin Sunflower and Sun-shroom, in addition to the player starting every ordinary level with 50 Sun. That's important, as that's the sun cost of the primary sun-producing plant, the Sunflower. Sun also falls from the sky in the daytime areas Day, Pool, and Roof. During the Night and Fog levels, Sun-producers are the only way to obtain Sun, so some of these plants must be planted to obtain more than the starting 50 sun. Sunflowers produce 25 Sun, Twin Sunflowers produce two 25-value sun which is 50 sun together, and Sun-shrooms produce 15 sun until they grow, after which they produce 25 sun.

Conveyor-belt Levels
The player cannot obtain any sun in these levels. Instead, they are supplied with plants that come up from a conveyor belt.

Sun cost
In Survival: Endless, the Sun cost of each Upgrade Plant (Gatling Pea, Twin Sunflower, Gloom-shroom, Cattail, Winter Melon, Gold Magnet, Spikerock and Cob Cannon) will increase by 50 for every one of those planted. For example, your first Cattail will cost 225 Sun, but your second Cattail will cost 275 Sun.

Trivia

 * The maximum amount of sun you can get in Plants vs. Zombies is 9990.
 * This, along with the 15 sun increments from small Sun-shroom(or later on at survival: endless), is the only way to get sun that is not in multiples of 25 unless it is a full-sized Sun-shroom.
 * There is an Achievement called Sunny Days unlocked by getting 8000 sun. This can be easily acheived in the Survival: Endless or Survival: Roof.
 * Since level 1-1 does not send zombies until you plant your second Peashooter, it is also a good candidate for Sunny Days, though it will take a rather long time.
 * Survival: Endless is the only level where the cost of plants rises (the cost of Upgrade Plants rising for every one of each type currently planted on the lawn).
 * Also later on, You only get 15 sun units in survival: endless, no matter if it is sun coming from an sun-proudcing plant, or sun falling from the sky.
 * In Versus mode, the zombie's currency is brains, it works the same as sun.
 * But in I, Zombie, you can collect Sun by eating Sunflowers. That's weird as zombies need brains, not Sun like plants.
 * The Almanac says that Sunflower bounces (or sways) to a beat that only it can feel. But if you have multiple Sunflowers they will be un-synced.
 * If you dig up a plant, you don't get back the sun you used to plant it.
 * That's why you have to be careful in Last Stand.
 * Sun can't be retrieved from the sky during the Night or Fog levels.