fokisf.blogg.se

Arduino lipo battery monitor
Arduino lipo battery monitor










arduino lipo battery monitor
  1. #ARDUINO LIPO BATTERY MONITOR SOFTWARE#
  2. #ARDUINO LIPO BATTERY MONITOR CODE#
  3. #ARDUINO LIPO BATTERY MONITOR SERIES#

Now multiply that value by the current voltageCal and use this figure to be the new value for voltageCal. If the two don't marry up (it should be around 4.06V), then take the actual reading on your meter and divide it by the reading on the display. Easiest way to do this is read the voltage at the battery compartment terminals of one unit with a meter, and compare it with the reading on the display.

#ARDUINO LIPO BATTERY MONITOR SOFTWARE#

When you first run the software, you may (probably will) need to alter the voltageCal value in the software to give accurate readings. Now we could put a voltage reference IC here, but I'm using a pro-mini, and modifying that tiny PCB is not an option.Ī note on voltage calibration. if the supply is moving about, so will the values from the A to D converter. In arduino, this is coupled straight to the 5V supply. The arduino's A to D uses a reference voltage, connected to the AREF pin (pin 21 on a ATMEGA328P). It's down to how the arduino's reference voltage is derived. BUT it does effect the arduino's ability to make accurate measurements.

arduino lipo battery monitor arduino lipo battery monitor

Now that doesn't effect the charger circuit, as it's designed to operate down to 4.5V. Under load, the regulation was letting me down, the voltage falling to 4.76V. Measuring the output of the buck converter exposed the problem. I messed about for a while with the code, seeing if there was a reading error (there always is a "settling time" with the arduino's analogRead function). the meter actually over-reading the voltage. the voltage reading was getting less accurate the more cells were on charge. nice bar graph reading, pretty looking display, BUT putting another battery on charge revealed an issue. Before connecting the charger modules, I calibrated each analogue input on the arduino to give an accurate voltage reading at 4.2 and 2.8 volts.Ĭonnecting in the chargers, and putting a battery in gave me good results. I set up the buck converter to output 5.0V, and mounted it, the arduino and the charger modules on a piece of perfboard. Thankfully, after some googling, I found the correct datasheet, and reverse engineered the charger module. It stayed happily at 5V, regardless of the state of the battery. Now I looked at (what I thought was) the datasheet for the IC, and carefully soldered a wire to pin 8 of the IC, being CHRG (active low). Next was to modify the charger module, so we can see when then charging LED is lit. The 5v supply I left supplying the display, and the LED backlight was connected to 5V via 180 ohms. The display connects to the junction between the resistors.

#ARDUINO LIPO BATTERY MONITOR SERIES#

Each line from the micro feeds a 4.7K resistor in series with a 9.1K resistor to ground. I fabricated a small resistive divider board, and fitted it. except the data lines need to be converted to 3.3V. The ILI9340C is designed to operate on 3.3V.

#ARDUINO LIPO BATTERY MONITOR CODE#

Some code was created and a prototype lashed up.įirst problem was the display. When the charge complete LED on the charge module illuminates, the arduino will indicate this on the display. The battery voltage will be measured by the arduino, and will be used to produce the data for the display. some tea was drunk, and a plan hatched.Įach charger module will be connected to the high-current 5V supply, and operate independently of the arduino. a high current (5A) adjustable buck converter. So, I bought some more charger modules from eBay. I'd like a bargraph, voltage and percentage on a nice colour screen, and the ability to charge 4 cells. It worked well, but it just wasn't geeky enough. I'd purchased a small charger module from eBay, and assembled a single cell charger. I've been using 18650 LiPo cells for a while in a few gadgets.












Arduino lipo battery monitor