I first tried to use only one 10K resistor, it worked, but the power led on the arduino started to burn, even when it wasn't connected to USB, so I gues the arduino is using it as a power supply somehow.īut even with the resistor it is using power. This way I could read 3.71v on the serial. I used 2x 10K resistors, didn't know how it supose to work, so I just tried. I'am a Arduino noob, but I managed to monitor one cell. use this value to determine the size of the readings array.I have a 4 cell lipo that I want to monitor with the Arduino Duemilanove. Using a constant rather than a normal variable lets the more the readings will be smoothed, but the slower the output will Define the number of samples to keep track of. #define CELL_COUNT 2 // DEFINE THE NUMBER OF CELLS 2,3,4Ĭonst int batteryPin = 1 //V+ from battery connected to analog1 physical pin 7Ĭonst int switchPin = 0 //physical pin 5 * The above lines calculate the VL_* values shown below * (defun vlist2int (sf ref levels) (mapcar (lambda (v) (volts2int (float v) sf ref)) levels)) * You can use these Emacs lisp defuns to calculate threshold analog values for your voltage levels * due to the standard first preference resistor value series. * against Vcc (5.0v), but in practice a 12:1 divisor is easier to achieve * An alternative approach is to use a smaller voltage divisor and compare * Compared to 1.1v reference this gives an ADC result of 1024*(1.0/1.1) = 859 * In AVR-worldview, we use 12:1 voltage divider and read 10-bit ADC comparisons versus AREF (1.1v) * (BMV_foo constants are these values in millivolts) * For a 3-cell battery, we consider 12v+ to be "full", 11v "good", 10v "low" and 9v "critical" * NOTE: a 4-cell battery requires a different voltage divider than 2-and-3 cells (use 15:1 not Analog read values for defined voltage levels * A 4-cell battery (nominally 14.8v) thus varies from 16.9v to 10.8v, with low-volt alert 12 12.0v * A 3-cell battery (nominally 11.1v) thus varies from 12.9v to 8.10v, with low-volt alert at 9.00v * A 2-cell battery (nominally 7.46v) varies from 8.46v to 5.40v, with low-volt alert at 6.00v * For battery endurance, do not discharge below 3.0v/cell (aircraft users commonly use 2.9v/cell as limit) * Fully charged LiPo is 4.23v/cell, discharged is 2.7v/cell (nominal voltage 3.7v/cell) * (defun rn2div (rup rdown) (/ (float rdown) (+ rup rdown))) * Use this Emacs lisp function to calculate divisors * Battery voltage is read through a voltage divider and compared to the internal voltage reference. Modified for arduion tiny core by Voltage trigger levels. Im new to coding so maybe I'm missing something obvious. So I've been working on the code the last couple days, it compiles without errors, but doesnts work. I did find this: Make The Future: Flat Mate - protect your LiPo cells from over-discharge So I've googled a lot and found a lot of people asking simular questions with no final project or answers.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |