Power Supplies and Batteries
Choosing a safe power source, and working out how long it will last.
The question
Your weather sensor needs to run all winter on batteries. How do you choose the batteries, and how do you know how long they’ll last?
What you’ll discover: the common battery types and their voltages, which ones are safe for projects, how voltage regulators work, and how to make an energy budget.
In simple terms
BeginnerPicking the right battery
| Type | Voltage per cell | Notes |
|---|---|---|
| Alkaline AA or AAA | 1.5 V | Cheap and safe. Our standard for Electronics School. Weak in deep cold. |
| NiMH rechargeable AA | 1.2 V | Reusable and safe. Three give 3.6 V instead of 4.5 V, which is fine for most projects. |
| Lithium AA (non-rechargeable, lithium iron disulfide, not lithium-ion) | 1.5 V | Costs more, but works much better in Alberta winter cold. Good for outdoor sensors. |
| Coin cell (like CR2032) | 3 V | Small and long-lasting, but very dangerous if swallowed. Keep them away from young children. If you think a child has swallowed one, go to emergency right away. |
| 9 V | 9 V | Small capacity. Never let its two snaps touch metal like coins or keys. |
Never mix old and new batteries, or different types, in one pack. Recycle used batteries (Call2Recycle has drop-off points across Canada).
What we don’t use, and why
No bare lithium-ion or lithium-polymer cells (like 18650 cells or flat LiPo packs) in Electronics School projects. They store a lot of energy, and if they’re shorted, punctured, overcharged or damaged they can overheat and catch fire. When a project needs rechargeable power, use a finished, store-bought USB power bank with its own protection circuits, and never open it.
Never build your own battery packs by soldering cells together, and never try to recharge batteries that aren’t made to be recharged.
Go deeper
IntermediateVoltage regulators
Battery voltage drops as the battery is used up, but many circuits need a steady voltage. A voltage regulator takes a varying input and gives a steady output. The Raspberry Pi Pico has one built in: you can feed it anything from about 1.8 to 5.5 V on its VSYS pin, and it makes the steady 3.3 V its chip needs. In Electronics School projects we always power the Pico through its USB socket: feeding VSYS directly needs a protection diode (Lesson 9) so a USB supply can’t push current back into the batteries.
- A linear regulator simply wastes the extra voltage as heat. Simple and quiet, but inefficient when the input is much higher than the output.
- A switching regulator (like the Pico’s) switches on and off very fast and uses a coil to store energy, wasting much less. It’s the reason a phone charger can be so small.
AdvancedMaking an energy budget
An energy budget estimates how long a battery will last:
hours ≈ capacity (mAh) ÷ average current (mA)
Example: a project draws an average of 25 mA from a 2,000 mAh battery: 2,000 ÷ 25 = 80 hours, a little over three days. In practice, plan for less: real capacity drops in the cold and at higher currents, and you shouldn’t run a battery completely flat.
To make batteries last months instead of days, engineers reduce the average current: the device sleeps most of the time, using almost nothing, then wakes up briefly to take a reading. A sensor that draws 25 mA for 1 second every minute averages under 0.5 mA, if its sleep current is tiny.
One real-world trap: many USB power banks switch themselves off when the current is very low, because they think nothing is connected. Test yours with your project before trusting it. Keep it in the shade, never in a sealed box in the sun. After a cold night, let a battery pack warm up indoors to room temperature before you recharge it, and stop using any pack that is swollen, damaged or gets hot.
Quick check
What voltage does one NiMH rechargeable cell give?
About 1.2 V.
Why don’t Electronics School projects use bare lithium-ion cells?
If they’re shorted, damaged or overcharged they can overheat and catch fire.
About how long will a 2,000 mAh battery run a 25 mA project?
About 80 hours, and less in practice.
Words to know
- Capacity (mAh)
- How much charge a battery stores, in milliamp-hours.
- Voltage regulator
- A circuit that keeps an output voltage steady.
- Energy budget
- An estimate of how long a power source will last.
- Sleep mode
- A low-power state a device uses between tasks.
Learn more
- Call2Recycle Canada: battery recycling drop-off locations
- Lesson 4: Electrical safety
- Next: Solar-powered electronics
Electronics School is part of the Discovery Zone. Every activity here runs on small batteries or a USB cable: never wall outlets. The one plug-in tool is the optional soldering iron, set up by an adult.