Adding solar charging to project - Page 1
Forum section: electronics / beginners

author: AlexLogical
author_rank: Newbie
timestamp: June 22, 2022, 04:17:44 pm
content: 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!

author: ledtester
author_rank: Super Contributor
timestamp: June 22, 2022, 04:54:08 pm
content: Quote from: AlexLogical on June 22, 2022, 04:17:44 pmIt 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/

author: AlexLogical
author_rank: Newbie
timestamp: June 22, 2022, 05:17:25 pm
content: 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 , which defaults to light for the ESP32. I have also tried setting to high, although that did not change the power consumption by much.https://esphome.io/components/wifi.html#wifi-power-save-mode

author: mariush
author_rank: Super Contributor
timestamp: June 22, 2022, 05:26:13 pm
content: 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.2wNiMH 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 panelMost 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.2vHere'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/102120310.3v at 0.8a :https://www.digikey.com/en/products/detail/stmicroelectronics/LD39080PT33-R/1632020For 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.

author: AlexLogical
author_rank: Newbie
timestamp: June 22, 2022, 07:20:54 pm
content: Quote from: mariush on June 22, 2022, 05:26:13 pmThank 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.Quote from: mariush on June 22, 2022, 05:26:13 pmTo 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.Quote from: evb149 on June 22, 2022, 06:22:26 pmThank 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.Quote from: evb149 on June 22, 2022, 06:22:26 pmI 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.Quote from: evb149 on June 22, 2022, 06:22:26 pmYes, I think I would stick with some dedicated circuitry to handle that.Quote from: evb149 on June 22, 2022, 06:22:26 pmThe 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 itIt 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.Quote from: evb149 on June 22, 2022, 06:22:26 pmI 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.

author: AlexLogical
author_rank: Newbie
timestamp: June 23, 2022, 11:02:34 pm
content: Quote from: mariush on June 22, 2022, 05:26:13 pmI 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!