Solar-Powered Devices
A solar-powered device is a power budget problem before it is an electronics problem. Work out how much energy the load needs per day, and the panel size follows from that.
Why the panel alone never works
A solar panel produces a voltage that rises and falls with the light, and it produces nothing at all at night. Wiring one directly to a battery is a common and damaging mistake, because a panel can push current into a battery at any voltage it happens to be producing, including above the battery's charging voltage, and it can also reverse at night and discharge the battery through the panel.
A charge controller sits between them and does three jobs: it stops the battery discharging backwards through the panel, it regulates the charging current, and it disconnects the load when the battery is too flat or too full. It is the part you should never leave out.
The energy budget, worked through
Start from the load. A sensor that draws 10 mA continuously and runs from a 2000 mAh battery gets about eight days, which is useless. The same sensor that wakes 20 times a day, takes a reading and sleeps draws so little that a small panel charges it comfortably, and that is the whole trick.
Duty cycling is the technique to teach. It is also why real low-power devices spend most of their life asleep, and why the microcontroller's sleep current, not its active current, is the number that decides whether a device works. The sleep current of the board is worth looking up before you choose it.
Step by step
-
Measure the load's energy use
Current times time. Do it for every mode, including sleep, before you size anything.
-
Work out the daily energy demand
Milliwatt-hours per day, including the losses you expect to lose in conversion.
-
Size the panel from the worst month
Use the sunniest-day estimate for the worst month of the year, not the average year. Panels are cheap; undersized storage is not.
-
Add a charge controller
Set the charge and discharge thresholds for your battery chemistry. Never wire a panel straight to a cell.
-
Make the load sleep
Duty cycle it. This is where the order-of-magnitude saving comes from.
-
Measure the real energy balance
Log the panel output and the battery voltage together over a week and check the balance holds.
What you'll need
| Item | Qty | Why |
|---|---|---|
| Small solar panel | 1 | Sized from your measured daily load, with headroom for the worst month. |
| Charge controller | 1 | The component that protects the battery and regulates the charging. |
| Rechargeable battery | 1 | Stores the energy between the sun and the load. |
| Low-power microcontroller board | 1 | Its sleep current decides whether the whole budget works. |
| Light-dependent resistor or light sensor | 1 | Lets the device sleep through the day and wake at the right time. |
| Current and voltage measurement circuit | 1 | To record the energy balance rather than guess at it. |
Practise it before you build it
Every step above has a matching circuit in the ThinkEdge Learn simulator. The simulator runs a real
Arduino sketch against a modified-nodal-analysis solver, so digitalWrite actually drives the
LED on screen and the readings change when you change the wiring — no hardware, no burnt components.
An LDR (Light-Dependent Resistor) is a resistor whose resistance changes with light. In bright light, resistance is low (~100Ω). In darkness, resistance is high (~1MΩ). By pairing it with a fixed resistor in a voltage divider, the Arduino can read the brightness as a voltage.
An LDR (Light-Dependent Resistor) is a sensor whose resistance changes with light: bright = low resistance, dark = high resistance. Connected as a voltage divider with a fixed 10kΩ resistor, the Arduino can read the brightness as a number 0-1023. Use this to turn on an LED when the room gets dark — a real automatic night light.
A real solar panel tracks the sun across the sky to capture 30-40% more energy than a fixed panel. We can build a simple 1-axis version with two LDRs (one on each side of a divider) and a servo. The Arduino reads both LDRs, compares them, and turns the servo toward the brighter side. With more LDRs, you can do 2-axis tracking.
A solar tracker has two LDRs — one on the left, one on the right. The Arduino reads both and compares them. If left is brighter, the servo rotates the panel left (toward the sun). If right is brighter, it rotates right. If both are similar, the panel is already aimed correctly and stays put. This is how real solar farms increase energy capture.
The Mega has 4 hardware serial ports (Serial, Serial1, Serial2, Serial3). That means you can talk to 4 different devices at the SAME time — like a GPS, a Bluetooth module, an XBee radio, and the USB. Use 3 of those ports to read 3 different sensors in parallel and stream their data to the Serial Monitor as a CSV row every second. This is the foundation of every real Arduino data logger.
The DHT11 is a small blue module that measures temperature (0-50°C) and humidity (20-90%). Inside it has a tiny microcontroller, a humidity sensor, and a thermistor. It speaks a custom one-wire protocol that the Adafruit DHT library decodes for you. You just call dht.readTemperature() and you get a number back.
Common questions
How big a solar panel do I need for a sensor?
Work it backwards from the load. A sensor that wakes a few times a day and draws under a milliamp can run from a panel of a few hundred milliwatts with a small battery. A sensor drawing 50 mA continuously needs tens of watts, which is a different project entirely. Measure first, then size.
Can I connect a solar panel straight to a battery?
No. Without a charge controller the panel can overcharge the battery on a bright day and discharge it back through the panel at night, and both of those shorten its life badly. A small charge controller module costs very little and prevents the most common way people ruin a solar battery.
Why does my solar device work on the bench but not outdoors?
Most often because the bench supply is much stronger than the real panel. Check three things: whether the charge controller is actually reaching its charging threshold, whether the load is waking up at all, and whether the battery is at a sensible voltage for the load. The third one catches people, because a battery that looks full at 3.6 V is not much to a sensor that needs 3.3 V plus current.
Related guides
Try the full simulator with your class
103 guided circuit projects, 21 lessons and an in-browser Arduino simulator. The first 15 projects are free, no account needed. NCERT Science mapping on 47 projects, with Arabic and English copy in the regional builds.