Can we scavenge enough power from the Scottish winter sun to run our low power electronics forever?
A few videos back I tried to get my Christmas lights to work off solar power, but the results
were not impressive.
But I haven't given up, I'm determined to make solar power work.
The problem is, the sun is weak and the days are very short.
Even on a bright day, with the small solar panels that I am using, we rarely generate
enough voltage to charge a lithium cell.
However, even when there is very little light, we do still get some power from the panels.
What if we could harvest all that wasted power and store it in the battery?
We might be able to keep a low power electronic device running indefinitely.
It's alive, it's alive, it's alive!
I made this really nice e-paper weather display a while back.
It's super energy efficient.
It uses the ESP32's deep sleep mode to great effect.
It only wakes up every 30 minutes to fetch a new forecast and update the display.
And as soon as it's done, it goes back into deep sleep.
Now an ESP32 in deep sleep mode can use as little as 10 microamps.
That's pretty amazing.
The e-paper display is also fantastic.
Once you've displayed the image, you can turn it off and the image persists.
It uses no power at all.
With my current 10,000mAh battery, my weather display lasts for 2-3 months before it needs
to be recharged.
So I've slightly modified the code for the e-paper display so it measures the battery
voltage and sends it to a server.
We should get a reading of the battery level every 30 minutes.
I've left this running for just under a fortnight.
The results are quite noisy, but we can see a trend of the battery slowly draining over
time.
Now it does drain very slowly, so this feels like a great system to experiment with a bit
of energy harvesting.
Can't we scavenge enough power from the solar cell to keep its battery topped up?
I've found two potential boards on Aliexpress that seem to be perfect for the job.
We've got the BQ25504 and the BQ25570.
Both these devices operate in a very similar way.
The main difference being the BQ25570 includes a buck-regulated output that can be used to
power a load.
When the device first starts up, it needs around 600mV on the input, and it uses this
to charge up the capacitor on the V-store to 1.8V.
Once it reaches this value, it can extract power from the input voltages down to as low
as 130mV, and it can boost this up to charge the battery, not bad at all.
The BQ25504 board is the simplest, so we'll look at that first.
I've wired up one of my solar panels to the input, and if we measure the voltage on the
V-store output, we can see that it's charging up.
Our input from the solar cell is only around 300mV, but we're able to charge up the V-store
to a much higher voltage.
The voltage on the solar cell is quite low because it's under-load.
If we measure the open circuit voltage, it's much higher.
Eventually our V-store voltage reaches 3.172V, and that same value is available on the V-bat
output.
We would normally use this to charge our battery.
Unfortunately, it's a bit too low for the lithium cell that I want to use.
We'd need something closer to 4.2V.
The AliExpress listing provides a schematic for the board, so we don't need to do too
much reverse engineering.
I've transferred the values from their low resolution image onto the nice clean schematic
from the datasheet.
We're interested in the value of the V-bat OV pin.
This sets the maximum value for the battery and storage before charging cuts off.
The equation to calculate this is here.
On the board, we have an ROV2 of 3.6M, and an ROV1 of 5.9M.
The V-bias for the BQ2504 is typically 1.25V.
Plugging these values into the equation, we get 3.02V, close enough to our measured value
given the various tolerances involved.
Now we could change one of the resistors to a 3M resistor.
That would give us a V-bat OV of 4.125V, which is pretty close to the ideal 4.2V that we'd
want.
But I don't really fancy changing these tiny resistors unless I really have to.
Let's see if the BQ250 board is more suited to our needs.
I spent a bit of time reverse engineering the board and created this nice schematic.
It did take me quite a while.
Of course, as soon as I'd finished my reverse engineering, I found a website where someone
had already done it.
It's full of really interesting information and goes into detail on how the IC works.
Using the equations from the datasheet and the resistor values we've reverse engineered,
we can see that charging will cut off at 4.07V and the battery OK signal would turn off if
the battery voltage is less than 2.8V.
Our board should be good for charging lithium cells, especially as my cell has protection
built into it.
The BQ25570 provides a buck-regulated output that you can run your load from.
With the resistors on the board I have, this will output just over 2.5V.
It's pretty nice, as you can use the output of the battery OK signal to enable and disable
the buck regulator.
If the battery is too low, then the output will turn off.
Now you may be thinking that 2.5V would be way too low to run in the USB 32.
Isn't it a 3.3V device?
Well actually, the USB 32 can run on anything from 2.2V up to 3.6V.
I've got one of my USB 32 dev boards connected up to the buck output, running the basic blink
sketch and it works quite happily.
Now unfortunately, the output of the buck regulator is limited to a maximum of 100mA.
That's fine when the USB 32 isn't doing very much, but as soon as you want to use
Wi-Fi or Bluetooth, the current requirement shoots up.
To see just how much the weather display needs when it's updating, I've placed a shunt
resistor in line with the power from the USB supply.
I've put 3 5.6 ohm resistors in parallel, which gives us around 1.9 ohms.
We can measure the voltage across this using my oscilloscope and work out how much current
is flowing.
I've captured a few screenshots from the print screen functionality of the scope.
We can see that we're typically only measuring around 100mV, which is equivalent to about
50mA, well within the 100mA maximum.
But we have spikes of up to 600-800mV, which is around 300-400mA.
So that won't work at all.
Now we could try adding a large value low ESR capacitor to the supply to handle these
current spikes, but it may not give us a very stable system.
Fortunately we don't need to use the output from the buck regulator, and if we don't
enable it, it won't use any power.
We can just connect our load directly to the battery, and this will easily be able to
power the ESP32 with the current that it needs.
So the BQ25570 board is perfect for our needs, no hacking around with the resistors required
at all.
I've wired it all up to the e-paper display and put it back into its usual place.
It's not very pretty, but we'll build a nice box for it if it actually works.
I've left it running for a week or so, and we've got some interesting results.
Just before I show you, it's time to talk about PCBWay.
I know you're probably sick of me telling you about them, but they are really good,
and they've supplied me with a lot of great PCBs over the last few years.
Click on the link in the description to see what they offer.
So drumroll please, the results are in.
Our battery is still going down, but it is getting charged up during the day.
You can see the days when we had a nice bright sunny day, and the days when it was grey and
miserable.
But, during the night, our battery is going down, and unfortunately, we're not able to
get enough charge during the day to make up for it.
However, if we do compare the slopes of the trend lines before and after adding the energy
harvesting, things are slightly more promising.
We can see that we've definitely had a big impact on the battery drain.
We might be able to get the battery to last 1.5 to 2 times the length of time it does
currently.
This may be enough to get us through the long winter months when the days are short, into
summer when the days are really long, and that may be enough to charge the battery back
up for the overnight drain.
It may even be enough to charge the battery back up so it lasts through the next winter
back into the following summer.
Now, there is a question that I'm sure a few of you are asking.
Why are we updating the weather display at night time when everyone is asleep?
If we put the weather display into deep sleep overnight, we may be able to keep the battery
topped up during the day, even in winter.
I've modified the code slightly so that if the time is after 11pm, we deep sleep for
6 hours.
This should save a lot of battery power, but we'll need to leave it for a while to see
what happens.
Fortunately, I'm off on holiday for a few weeks, so fingers crossed that everything
keeps working while I'm away.
On that note of everything working, I thought it would be worth actually checking it is
working before I head off.
So I've measured the battery voltage and I'm going to leave it on the windowsill to
see if we do get some charge.
The day did not start off looking good.
Where the hell is the sun?
But later on, things cleared up.
We have some sunshine.
Look at my little gadget go crazy.
After a few hours of reasonable weather, we've managed to charge the battery up from 3.85
volts to 3.88 volts.
That may not seem much, but if we map it onto the charge curve of a lithium cell, it's
about 4-5%.
What about the deep sleep current of the e-paper display?
Is it really low power?
I can monitor the current draw as the weather is refreshed.
We get a similar chart to what we saw in the oscilloscope, but once the e-paper is in deep
sleep mode, we can't measure anything, it's too low.
So what I've done is put a 1K shunt resistor in series with the power supply.
While the display is refreshing, I'm short circuiting this resistor with a jumper wire.
Once we've gone into deep sleep, we can remove the jumper wire and measure the voltage drop.
We get 167 millivolts, which is equivalent to 167 microamps.
It's not the 10-20 microamps that we could get from a tiny pico board, but it's pretty
low.
Well, I've been away for a few weeks and we've got some results.
The weather in Edinburgh while I've been away has been pretty atrocious, but we have
managed to get some sunny days and the days are starting to get longer.
Our battery is still going down, but with the changes to our code, we're now only losing
about 0.9% per day.
On the sunny days, we do actually seem to be getting some charge into the battery.
I'm going to monitor the situation over the next few months, but for now, I'm going to
call this a success.
We can salvage power and I think our weather display may run indefinitely from now on.
What I need now is a new box for it.