Budding · Taking shape, still changing
Powering a Raspberry Pi from a 24 V AC irrigation line
The weather station in my garden runs on a Raspberry Pi (I estimated about 15 W). The only power out there is the 24 V AC line for the sprinkler valves, fed from a classic toroidal transformer. I needed to turn that into a stable 5 V DC.
The problem: 35 V after rectification
24 V is the RMS value. After rectification the smoothing capacitor charges to the peak, about 24 × 1.41 ≈ 34 V – I measured about 35 V. On top of that, mains voltage fluctuates and an unloaded transformer gives more than its rating. Common buck modules, meanwhile, top out at 36–40 V on the input, so they would run right at the limit.
What did not work
- An LM2596 module (6–40 V in, “3 A”) – the Raspberry Pi showed the lightning-bolt icon, meaning the supply dropped below about 4.63 V.
- XH-M249 (9–36 V in, 5 V 6 A out) – the bolt appeared less often, but the converter shut down now and then, and eventually died. With 35 V on its input it had no headroom at all.
The real cause of the lightning bolt: the cable
The converter output was about 5.1 V, yet the Pi still reported under-voltage. That meant more than 0.5 V lost along a 90 cm USB cable. Once I fed 5 V straight into the power pins on the GPIO header, the problem went away.
A caution: powering through the GPIO pins bypasses the Raspberry Pi’s power-input protection, so the supply has to be stable and well protected.
Options I considered
- LM2596HVS – the high-voltage LM2596 (modules sold as 4.5–53 V, 3 A), a few złoty. The risk: counterfeits, where a failed switching transistor can pass the input voltage straight to the output. At a continuous 2–3 A the LM2596 also runs very hot.
- XL4016 – up to 40 V in, more current.
- MeanWell converters with a wide input range – solid, but several times the price.
- An autotransformer made from a transformer with a split secondary – drops the voltage ahead of the converter, but the unused primary winding ends up at about 230 V.
- A 24/230 V transformer plus an ordinary plug-in power supply – rejected: dangerous 230 V inside a low-voltage box, and about 80 PLN plus a socket and an enclosure.
- Dropping the voltage with diodes or a resistor – pure loss as heat. At a few amps that is tens of watts to deliver 15.
- A solar panel with a battery – the station has to run at night and in winter, so the panel would need 40–50 W.
What I chose
In the end I went with an LM2596HVS module – it has enough input headroom. It is worth adding protection in case it fails short: a fuse ahead of the converter and a Zener diode or TVS just above 5 V on the output, so that a fault blows the fuse rather than the Raspberry Pi.
Source: my thread on elektroda.pl (in Polish) – Jak zmniejszyć napięcie z 24VAC do 5VDC dla stacji pogody? (February 2020; see also the October 2019 thread about the converters).