Author Topic: Adding solar charging to project  (Read 1046 times)

0 Members and 1 Guest are viewing this topic.

Offline AlexLogicalTopic starter

  • Newbie
  • Posts: 4
  • Country: at
Adding solar charging to project
« on: June 22, 2022, 04:17:44 pm »
I have recently started getting into electronics and just finished my first project. It is based on an ESP32 NodeMCU devboard, which I use to control a couple of servo motors in my garden. The circuit runs off of 8 AA NiMH cells (Eneloop) in series. Everything works great so far, I have it integrated into my home assistant setup and can control the servos using that. As the development board comes with an AMS1117-3.3 voltage regulator with an input voltage of 15V, I just connected the cells directly to it. For the servos, I got a buck converter which provides them with 6 volts when needed (I disable the module when not needed). However, as the circuit draws around 60mA continuous, I need to change the batteries once a week or so. Thus, I thought about adding one of these 5V 1.5W solar panels to the project that you can get for a few bucks online, to prolong the battery life a bit. However, I am unsure how to connect it to the circuit. Can I just use a charger module (e.g. https://www.elecbee.com/en-27091-10pcs-8S-NiMH-NiCd-Rechargeable-Battery-Charger-Charging-Module-Board-Input-DC-5V) and put its output in parallel to the batteries, while the rest of the circuit is also active? The solar panels I have found have a voltage of 5V, but I guess this is best case and the battery charging module has an input voltage of 4.5 to 5.5V DC. Do I need to put a buck/boost converter between the solar panel and the input of the battery charging module to ensure that it gets constant 5V?

Thanks!
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3116
  • Country: us
Re: Adding solar charging to project
« Reply #1 on: June 22, 2022, 04:54:08 pm »
However, as the circuit draws around 60mA continuous, ...

It seems a lot of power could possibly be saved through some code changes - for instance, by putting the MCU to sleep when it doesn't have to do anything.

What does your NodeMCU do?

Here, for instance, is an article explaining the basics of the ESP8266 sleep modes:

https://diyi0t.com/how-to-reduce-the-esp8266-power-consumption/

 
The following users thanked this post: AlexLogical

Offline AlexLogicalTopic starter

  • Newbie
  • Posts: 4
  • Country: at
Re: Adding solar charging to project
« Reply #2 on: June 22, 2022, 05:17:25 pm »
I have already tried tweaking the power consumption as best as I could, but I could not get it any lower. I guess the bulk of the power is consumed by the wifi connection that it needs to keep always established, as commands could come at any point in time. I am not programming the chip directly but instead use ESPHome to integrate it into my home assistant installation. Basically, it needs to move a servo to a specific position once it gets the command to do so. ESPHome offers a configuration option for power save modes [1], which defaults to light for the ESP32. I have also tried setting to high, although that did not change the power consumption by much.

[1] https://esphome.io/components/wifi.html#wifi-power-save-mode
 

Online mariush

  • Super Contributor
  • ***
  • Posts: 5109
  • Country: ro
  • .
Re: Adding solar charging to project
« Reply #3 on: June 22, 2022, 05:26:13 pm »
The AMS1117-33 is a linear regulator, it produces 3.3v by throwing out the difference as heat. So if the board consumes 60mA, you give it 8x1.2v = 9.6v and it outputs 3.3v and you wasted  (9.6-3.3 ) x 0.06 = 0.38w while your board only uses 3.3v x 0.06 = ~0.2w

NiMH are not good at charging from whatever charge state you want, they have a memory effect ... it's best to have them fully discharge and then charge them fully. They're not so well suited for charging from a solar cell.

My advice would be replace your 8 NiMH batteries with 2 18650 lithium batteries in parallel .. this will give you a voltage between 4.2v when fully charge and as low as 3v when fully discharge and around 3 times as much capacity.
If in parallel, you can charge the batteries directly with a basic battery charge IC that can be powered with 5v from solar panel

Most of the energy of the batteries will be between around 3.5v and 4.2v, so if you get a LDO linear regulator (a linear regulator that has a much lower voltage drop) to replace the AMS1117, then you could power the board directly from the batteries.  AMS1117 needs around 0.8v above the output voltage to work, but LDOs exist that need only 0.1v.. 0.2v

Here's some examples of 3.3v LDOs with low voltage drop :

0.2v at 1a : https://www.digikey.com/en/products/detail/nisshinbo-micro-devices-inc/R1172H331B-T1-FE/10212031
0.3v at 0.8a : https://www.digikey.com/en/products/detail/stmicroelectronics/LD39080PT33-R/1632020


For the stepper motors, you could easily use a step-up dc-dc converter to produce 6v from 3...4.2v - they're mass produced, lots of them are made to boost 3.3v ..4.2v to 5v, but you can easily change the output voltage to 6v.
 
The following users thanked this post: AlexLogical

Offline AlexLogicalTopic starter

  • Newbie
  • Posts: 4
  • Country: at
Re: Adding solar charging to project
« Reply #4 on: June 22, 2022, 07:20:54 pm »
The AMS1117-33 is a linear regulator, it produces 3.3v by throwing out the difference as heat. So if the board consumes 60mA, you give it 8x1.2v = 9.6v and it outputs 3.3v and you wasted  (9.6-3.3 ) x 0.06 = 0.38w while your board only uses 3.3v x 0.06 = ~0.2w
Thank you! I was not aware of that. The ESP32 devboard I use already had the AMS1117-33 built in, so I just used it. I will see if I can replace it with something more efficient.

NiMH are not good at charging from whatever charge state you want, they have a memory effect ... it's best to have them fully discharge and then charge them fully. They're not so well suited for charging from a solar cell.
To be fair, the main reason I went with the NiMH cells is that I think they are more forgiving. I am aware that lithium cells have a better energy density and I do have a 2A fuse between the batteries and the rest of the circuit, but still. It is my first-time using batteries at all powering one of my projects and I thought that if I use lithium cells there is a higher probability of it going up in flames if I make a mistake somewhere along the lines, which is quite likely. Furthermore, I have a couple of those garden lights that use a NiMH button cell to power a small LED at night and use a solar panel to charge the cell during the day. Thats where the idea came from.

* Remote wireless link power consumption -- you said the control wireless link is continual and consumes most of the power.  Two things I'd suggest thinking about as options -- 1: Make the control link BLE instead of WiFi, then have another permanently powered ESP32 inside or wherever power is available to take the Wifi commands and relay them over BLE.  Use the low power options usually associated with a BLE link with periodic connection intervals to send data "fast enough" but at a lot less power than the ESP32 uses for Wifi.
2: Maybe use WiFi on the target ESP32 if you wish but look at changing the Wifi settings to optimize power mode; Wifi does allow connection intervals to be spread out for "sleepy" or low powered clients to stay connected to an AP and periodically check for traffic etc.  It seems like you could reduce the Wifi "on" rate to something periodic like 1 Hz, 2 Hz, 10 Hz, whatever, and turn off the Wifi mode in between those times, and power save in the idle periodic interval.  You might also be able to make the node receive-only or receive-mostly for commands and only transmit hand shaking like 1/second or whatever low rate.

Thank you! I will definitely try your idea with bridging over BLE. I tried setting the power saving mode as high as I could, but that did not do much for Wi-Fi. Maybe I can get better results using BLE. Ideally, I would like to link into my already existing Zigbee network, but my esp32 cannot do this out of the box, so I would need to make this work with an external module or similar. However, it does come with Bluetooth, so I will give this a try.

* Solar power -- keep in mind the sunlight is strong only a few hours a day especially in winter and some days will be particularly cloudy / rainy / snowy etc. so depending on your local climate and how many hours of sun your station will get some days / months of the year on average you will probably want to generate something like 500% of the node's power during the day time light hours even on cloudy days, charge a big enough battery during that time so that the system can operate on battery only / mostly power for at least the "other" 18-20 hours a day when it may get less solar power (night, rain, snow, ...).  Maybe even allow enough battery capacity to run 24 hours or whatever with very little solar input if you want to reliably run even through winter storms / whatever depending on your location stats.  There are solar energy maps / atlases which show the statistical watt hours / square meter ideal solar panel area / day of light falling on a given location on earth averaged over each month of the year so you can see what each month / season might offer "at most" then you calculate down from there based on your solar panel area (m^2) and efficiency (e.g. 15% or whatever) and any shading or whatever your location will get beyond the general clear sky condition.

I do have a weather station that also has a solar panel on it that gives me a W/m^2 reading. I do not know how accurate it is, but it should give me at least a ballpark I thought. It gives me an average of about 2.5 kWh/m^2 per day total in summer. In winter it is only about 1/10 of that, but that is fine as I only use my device in the summer months.

* There exist solar panels with over 5V peak output, so if it helps you can find a 12V or whatever panel.  You could also put more panels in series electrically e.g. 3*5V = 15V if that helps as long as they panels will basically always be similarly lit up based on them pointing in the same direction and getting shade / light at similar times together.  Your charger module takes 5V so I guess a 5V panel might be OK but keep in mind that solar panels voltages can "droop" from the peak voltage depending on how heavy the current is being drawn from them and if they have some shading or low light going on that reduces their available power.  The optimum way to use solar panel energy is by MPPT (maximum power point tracking) where the load adjusts the load current to keep the voltage between the solar panel open circuit voltage and the solar panel maximum current voltage (low) at the optimum balance to get the most actual power from it, and you'd use a boost converter or buck-boost or similar to get the fixed voltage you want from the variable voltage / current / power solar input.
In theory as long as you limit the voltage / current to safe and useful levels you could even use the MCU to control a software controlled charging / power conversion system to optimize and dynamically adjust buck / boost / charging voltage / charging current etc. but that'd be an extension of your hardware / code / project and you should have hardware level fail-safe limits (LDOs or charger IC or whatever) to keep the voltage / current in safe limits.

Yes, I think I would stick with some dedicated circuitry to handle that.

* Solar cells -- although you can find panels that give "just enough" wattage to run your project a lot of times you may find that you get a better cost per watt if you buy a larger panel than you strictly need e.g. a 1W panel vs. a 5W or 10W or 25W etc. have different costs depending on what you find so sometimes it's nice to get more than you need and that just helps your robustness on winter / stormy days to make significant power even with limited light, also giving room to expand to more projects or more power available in case your needs change.  12V*60mA is ~0.75W continuously and
as I said if you want that to run 24 hours/day even in winter etc. you should really generate and store more like 5W or higher during a few hours of light/day and use the reserve for nights and dim days etc.

The 5V panels I found also have about the size of the waterproof box that my project is in, thus they would fit neatly on top of it :)
It is also fine if I still have to change the batteries occasionally and just get a couple of days or so of extra time between it.

Another alternative is to get a safety agency certified low voltage power supply of the type commonly used for powering say 12VDC / 12VAC LED outdoor landscape lighting and use outdoor low voltage weatherproof direct burial rated 2-lead power cord to connect that power supply to your project (e.g. 18/2, 16/2 type cable) and use the appropriate regulator / power supply to deal with that.  If the wiring would be simple or can tap into an existing low voltage power line to the garden that may be simpler than the solar option though I do encourage the solar option as a good choice for many projects and interesting design.

I did do something similar for an IP camera, for which I bought an off-the-shelf 12V outdoor IP68 power supply that plugs into the wall. But yes, they solar power stuff is also to get a first idea of how something like this could work. It is fine if it ends up adding little to the overall capacity if I can get some learning out of it.
« Last Edit: June 22, 2022, 07:28:21 pm by AlexLogical »
 

Offline AlexLogicalTopic starter

  • Newbie
  • Posts: 4
  • Country: at
Re: Adding solar charging to project
« Reply #5 on: June 23, 2022, 11:02:34 pm »
The AMS1117-33 is a linear regulator, it produces 3.3v by throwing out the difference as heat. So if the board consumes 60mA, you give it 8x1.2v = 9.6v and it outputs 3.3v and you wasted  (9.6-3.3 ) x 0.06 = 0.38w while your board only uses 3.3v x 0.06 = ~0.2w

I now use a buck converter to supply 3.3v directly to the chip and this alone already dropped the current from 55 mA to 24 mA, more than doubling the battery life. Thanks again!
« Last Edit: June 24, 2022, 12:16:14 am by AlexLogical »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf