Running micro-controller from solar power? - Page 1
Forum section: electronics / beginners

author: symbianas
author_rank: Regular Contributor
timestamp: February 20, 2024, 09:29:43 pm
content: Hi, I was wondering is it possible to run micro-controller constantly from solar panels inside flat near the window?I have:7 solar panels (rated at 5V 50mA) connected in parallelLithium Ion Battery 700mAh 3.7V (possible to change to bigger one)Mini Solar Lipo Charger Board CN3065 fromAliSTM32F103 micro-controllerThe issue is that during the day when its cloudy solar panels provide only 3V, but the "Solar Lipo Charger Board CN3065" expects input of 4.4V-6V. Is it possible to use boost converter or something so that it would be possible to harness solar panels power even on cloudy days?Otherwise the solution is not sustainable and the battery will run out of juice? any other solutions?

author: Kleinstein
author_rank: Super Contributor
timestamp: February 20, 2024, 09:56:14 pm
content: With a low power system a 700 mAh battery can last very long (a few years). So one may not need that many good days for charging and could buffer over the winter or so.It depends on the use case how much power is really needed.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: February 20, 2024, 10:29:12 pm
content: Is 3.0 volts the open cell voltage? Or under load?I doubt adding a boost converter to this setup will make it work properly. There won't be much current available.Your current panels are already less capable of supplying current then your proposed charger will attempt to charge at.I suggest to look for a different charger. Something that implementsMaximum power point tracking (MPPT). When using such a charger, you may want to put some solar panels in series, and have it step down the voltage instead.

author: brucehoult
author_rank: Super Contributor
timestamp: February 20, 2024, 11:08:57 pm
content: Quote from: symbianas on February 20, 2024, 09:29:43 pmOf course it's possible, for some value of "microcontroller" and "solar panel".Even back in the 1970s or 1980s we had credit card sized "solar"  powered calculators that companies gave away as bling to customers.You can run your whole house off solar panels, so a microcontroller isn't a big deal. Be specific! "STM32F103" isn't specific enough. Some can run off 2.0V. Some use 10 mA in run mode, some use 50 mA. Average consumption can be much much lower if the microcontroller is sleeping most of the time. they worked fine from indoor lighting

author: Peabody
author_rank: Super Contributor
timestamp: February 20, 2024, 11:12:01 pm
content: Quote from: symbianas on February 20, 2024, 09:29:43 pmIs that 3V the open circuit voltage on a cloudy day? Did you measure it? If not, where did that number come from? And by the way, the low voltage lockout is 3.7V, not 4.4V, so I wouldn't take the 4.4V too literally - you would have to test it.A solar panel will supply as much current as it can at the voltage needed by the charger, but that's only if that voltage is below the open circuit voltage for the illumination level of the sun at the moment. So even if the full charge current isn't supplied, your panels could still supply some current. But the bottom line is that on a cloudy day, the panels won't contribute very much, and wouldn't contribute much if it were an MPPT charger. So you need enough bright sunny days to keep the battery charged.Also, you didn't say, but you also need a very low dropout 3.3V regulator for your STM. The panels may be nominal 5V, but that typically means they can put out close to 6V in bright sun.Do you have any feel for how much current your circuit will draw when running? Will it be sleeping part of the time? That's going to be the biggest determinant of battery life.I have tested a circuit similar to this that used a TP4056 charger, which is not a "solar" charger, and it worked pretty well. But you need to get the panels in direct sunlight as much as possible.Edit: You may do better using a single 500ma solar panel. If you use multiple panels, you may have to put diodes in the outputs to prevent back feeding from one to another, and those diodes will have a voltage drop.

author: symbianas
author_rank: Regular Contributor
timestamp: February 21, 2024, 09:48:16 am
content: Quote from: GromBeestje on February 20, 2024, 10:29:12 pmQuote from: Peabody on February 20, 2024, 11:12:01 pmI have measured 3V when solar panels were connected in parallel and connected to battery charger, but without connected battery itself and also without micro-controller connected. I will try to test voltage of panels without charger connected too.Quote from: Peabody on February 20, 2024, 11:12:01 pmDid not thought of that yet, but I would expect that charger also gives 5V "SYS OUT" (although I guess it will be 4.2V instead of 5V?) and micro-controller circuit would have 3.3V regulator itself.Quote from: Peabody on February 20, 2024, 11:12:01 pmI would expect that draw current of micro-controller would be in range of 20-50mA. And at night when its completely dark, it could go to sleep mode less than 1mA.Quote from: GromBeestje on February 20, 2024, 10:29:12 pmHow about connecting solar panels in series (35V 50mA) and then using stepdown converter to create 5V and using same battery charger circuit? Would it be a better solution?

author: Peabody
author_rank: Super Contributor
timestamp: February 21, 2024, 04:11:13 pm
content: QuoteIf the panels are not all facing in the same direction, there could be a difference in the output of the panels, and if there are no blocking diodes, then the overall OC voltage could be reduced. You might test the panels individually to see if the OC voltage varies.In the final installation, will all seven panels be facing in the same direction, and all equally in sunlight, or all in shade, at the same time? If so, you probably don't need diodes.QuoteThere's no SYS OUT pin. The system is powered from the battery pin, and should be limited to 4.2V. Do you know what 3.3V regulator is used on the processor board, and what its dropout voltage is?QuoteIf there's any way to have it sleep, even for short periods, during the day, that would have a big effect on how long the battery lasts.QuoteI don't see what you gain from that. The seven panels in parallel will give you 350mA of charging current when the sun is out, with no conversion losses. Seven in series might give you some charge current when it's cloudy, but not very much. The panels simply can't generate much power in shade, no matter how you shift it around.

author: MarkT
author_rank: Frequent Contributor
timestamp: February 22, 2024, 09:34:31 am
content: You can expect 10% or less output on a cloudy day from full sun, so you have to size the panel for something like 10-20 times the load current to allow for cloudy days, and multiply by 2 or more to cover nighttime running if needed (which also requires the battery holding enough energy for overnight)If you size the battery storage to hold a week's energy you may be able to reduce the solar panel capacity and hope for a good statistical balance of bright and dull days.Sleep mode is very useful for decreasing the average load current...

author: tszaboo
author_rank: Super Contributor
timestamp: February 22, 2024, 11:40:29 am
content: Quote from: symbianas on February 20, 2024, 09:29:43 pmYes, it is but you have to design every single part of the system with that in mind. HW, FW, every single resistor.Quote from: symbianas on February 21, 2024, 09:48:16 amI have systems that use ~20mA peaks, when transmitting with radio to hundreds of meters in microseconds, and sleep for less than 5uA. 50mA to run a microcontroller is crazy high power nowaday.

author: Peabody
author_rank: Super Contributor
timestamp: February 22, 2024, 04:01:54 pm
content: You haven't told us anything about your project, but it seems to me that the seven 5V panels in parallel should work well. You would get fast efficient charging when the sun is out. Then the task would be to reduce active current and sleep current as much as possible, and sleep as much as possible - even a fraction of each second during the active period. You could even switch off all of the power and be powered up by the alarm output of an RTC running on its own coin cell.One thing to keep in mind is that with the solar power flowing only through the charger, when the battery is fully charged, the charger will terminate charging and shut down. That means your circuit will then have to fall back on battery power even if the sun is shining brightly. Charging will resume when the battery drops to 4.1V. A load sharing circuit can prevent that cycling, but it's complicated for solar power.

author: symbianas
author_rank: Regular Contributor
timestamp: February 23, 2024, 11:31:03 am
content: Quote from: Peabody on February 21, 2024, 04:11:13 pmYesterday was a sunny day, so during that time I have registered 5.2V for single panel. I have tested 7 panels and they still made 3.6V apparently it was too high on the window and half of the panels get shade, after moving them lower I have observed 4.9V, so I guess its quite similar to 5.2V of a single panel.Quote from: Peabody on February 21, 2024, 04:11:13 pmI don't know, but I have googled that its possible to supply the battery voltage to 5V pins of micro-controller and it still should work ok. I have tested it with charged battery and it works. So I think this is not an issue.Quote from: Peabody on February 21, 2024, 04:11:13 pmQuote from: tszaboo on February 22, 2024, 11:40:29 amI have tested power consumption of STM32F103 + NRF24L01 and its around 23mA, so yes its less than 50mA. I have tested when STM is sleeping and NRF24 is not and it would wake STM by interrupt, but consumption is quite high 16mA. When both are sleeping I have observed 2mA consumption. The idea would be to turn of both for lets say 9seconds and turn on both for 1 second or something like that. but I guess still power consumption is quite high and will need to mitigate that somehow.Quote from: Peabody on February 21, 2024, 04:11:13 pmI would love to get any mA number from panels even in cloudy days, today is cloudy and charger does not seem to turn on... but Its quite bright outside so I would assume there is some current to harness?

author: Peabody
author_rank: Super Contributor
timestamp: February 23, 2024, 03:41:27 pm
content: QuoteI think what is happening is that the output from the panels in full sun is being partially dissipated in the panels in shade. A blocking schottky diode on the output of each panel would prevent that backflow, but at the cost of a voltage drop of about 0.3V.QuoteYes, but the question is at what point in the battery's discharge does it stop working.I think your STM processor is a 3.3V device. So somewhere on the STM module there should be a 3.3V regulator that converts the incoming 5V to 3.3V. But regulators vary in the minimum input voltage required to produce the 3.3V. Something like an LM1117 regulator requires 1.1V headroom, so at 4.2V full battery charge, you would already be borderline. But a better regulator might only require 0.2V headroom, so it would work fine down to a battery voltage of 3.5V. Can you post a link to your STM module, or a picture of it?

author: Peabody
author_rank: Super Contributor
timestamp: February 23, 2024, 05:38:43 pm
content: QuoteI dug out my solar charger stuff and did a measurement. The panel I used is a single 5V panel rated 2.5W, 500mA. It measures 13x15 cm, and is one of these:https://www.amazon.com/gp/product/B074TYH68Z/I set it up outside in the shade, but pointing straight up to a clear blue sky. With an 18650 battery connected, but no load circuit, it did power up the charger, a TP4056 module. Current out of the panel measured 9mA.In previous testing, I found that this panel is pretty good. The open-circuit voltage in full sun is about 5.85V, and the maximum short-circuit current in full sun is close to the rated 500mA. I don't know why your panels would not at least turn on the charger if they are all illuminated similarly, but of course yours is a different charger than mine, and I don't know about your panels.I think the bottom line is that you won't get much from the panels on cloudy days. They need to be in full sun to do any significant charging.