Preventing "brown out" on a solar-powered Pi Pico

The problem

I have been experimenting with a solar-powered Meshtastic node, comprising a Pi Pico W and a Waveshare LoRA SX1262 board (also available from AliExpress, of course). I have housed these in a budget garden solar lamp (from eBay - many available - such as this), which provides the charging circuit, the battery, and the enclosure. I had hoped that it would also provide the solar panel, but I found this to be insufficient so I replaced it with a larger 6V solar panel.

The node runs fine when the battery is charged, but there is a problem when the battery runs down - which can happen overnight after a cloudy day. The next day when the sun comes up, the battery voltage starts to climb and at some point the Pico attempts to start up. This causes a current spike, which pulls the battery down, and the Pico shuts down. It then gets into a restart loop, which never properly resolves, and the node fails to start properly.

What is needed is a way to cleanly switch the power on and off, so that the Pico only attempts to start when the battery has sufficient voltage for it to run cleanly.

Attempt 1: Reed relay and resistor


This circuit works correctly. The relay only energises when the battery has reached around 3.5V, and disconnects when it drops below around 3V (depending on the exact choice of relay and resistor).

However, the circuit is continuously drawing some power from the battery - around 3mA - regardless of whether the relay is open or closed. This is wasted energy, and not the most efficient way to run a solar node.

Attempt 2: PNP/NPN switch


The idea here is to save most of the wasted current, by using a transistor switch. The exact switching voltage and hysteresis is set by the diode and resistor values.

However, whilst this design works in simulation, it does not work in practice. The reasons are that (a) the transistor does not switch instantaneously (like a relay would), and there is still a small "knee" as it transitions. And (b) the Pico has a built-in boost/buck power supply, which presents a complex load rather than a pure resistive load - and this causes the circuit to behave in unexpected ways. As a result, the brown-out condition still often occurs with this circuit.

Attempt 3: Use the RUN pin on the Pico


The Pi Pico has a "RUN" pin, which when held low prevents the Pico from running. Then when it is allowed to go high, the Pico restarts cleanly.

This simple circuit keeps the RUN pin low via R1, until the battery voltage is sufficient (via zener diode D1) to lift it to a run condition. And it works!

There is a small amount of wasted current via R1, but this is less than half a milliamp and in practice is nothing to worry about.

I built the circuit onto a small Pico Prototyping Board, which I then soldered onto the pins of the Waveshare board. 

Yes, I know it would be better to add some sockets to the board rather than soldering directly to it, but I was trying to keep the unit as compact as possible in order to fit it into the solar light's case. I only soldered the active pins (pins 30 - RUN, 39 - VSYS and pins 3 and 28 for ground), plus the corner pins - to make it easier to remove if I ever needed to. Also, I soldered the components to the upper side of the prototyping board, again to keep the overall depth to a minimum.

Here is the finished board, before and after attaching to the Pico/Waveshare combo. Note that the prototyping board shows GPIO numbers, not the pin numbers.








Comments

Popular posts from this blog

Adding Brandmeister to the Hotspot (DMR Part 4)

Building a basic codeplug for DMR (DMR Part 2)