I'm designing a connected collar for pets for a project, for this I am using a nodemcu on ESP8266 powered by a Lipo battery I'm guessing around 1000mAh of capacity is enough for a respectable autonomy (? any advices). Lipo model : https://www.lipolbattery.com/lithium%20polymer%20battery.html In order to charge the battery I have found this USB LiPo charger (https://learn.sparkfun.com/tutorials/lipo-usb-charger-hookup-guide/all), my first question is: Is it still usable for higher capacity LiPo batteries (1400mA)? Also I would like to display the battery level via and RGB LED (example: green is for battery FULL battery and RED for LOW battery level in need of charging) is there any way to do this? Thank you
-
Measuring LiPo capacity is tricky. I would suggest investing in a "Fuel Gauge" chip to measure it for you. (Eg: sparkfun.com/products/10617)– MajenkoCommented Jul 30, 2019 at 13:41
-
I found his project any suggestions? teachmemicro.com/arduino-lipo-battery-monitor– SalmaGCommented Jul 30, 2019 at 14:03
2 Answers
It is still usable for higher capacities. I recommend you tp4056 and some step up converter. You can use resistor divider (that drops safely voltage to nodemcu 3.3v) and connect its output to an analog pin of your nodemcu. Values of resistors must be high, like 10k. You can simply connect your diode to nodemcu and code if voltage is less than 3.2v let the red diode turn on, when above 3.8v let the green diode turn on
Answering the second question "Also I would like to display the battery level...?" (next time, please open a new question for that):
To measure the module voltage level (a.k.a. VCC) of a NodeMCU (which is just a board containing an ESP8266 chip) programmed in Arduino IDE (which I assume given that you ask on the arduino stackexchange), this here applies:
To read VCC voltage, use ESP.getVcc() and ADC pin must be kept unconnected. Additionally, the following line has to be added to the sketch:
ADC_MODE(ADC_VCC);
This line has to appear outside of any functions, for instance right after the #include lines of your sketch.
Source: ESP8266 Arduino reference
So you could just drive a red and a green LED (don't forget the mandatory current limiting resistor) from any other two pins of your NodeMCU. Then switch them in your sketch if VCC falls below 3.2V (you may need to experiment with that because of measurement tolerances; a sketch to start with that would be here.