Hi all. My project (Arduino + RGB strip led + 2 bend sensors), uses a battery (12 volt) as power supply.
I would like to have some visual help for understanding when the battery is going to run out.
I think something like a single RGB led, going from Green (full battery), to Yellow (half battery), to Red (change!). Or maybe three single led. Do you have any suggestion?
ps: I prefer to avoid solutions using lcd display!
Thanks!
I apologize, my question was unclear, I try to explain:
in order to GET the information (status of battery) I thought to build some circuit measuring the voltage on the 12 volt battery. So the first question is: do you have some advice how to build this circuit, in order to make Arduino read the circuit output? Or maybe already exists something like that, I do not know.
Second question: once Arduino receives the information on status battery, which is the best way to display it? Consider I cannot use serial monitor, and I prefer not to use device like lcd display. My first solution was to use, as said, three led signalling "full, half, empty" (but again, I do not know if this is a good solution).
Third and last question: generally, when a 12 volt battery (driving two arduino and 1 mt strip rgb led), can be considered reasonably exausted? Ween voltage drops to 10 volts? or 9? I have no idea.
Thanks again!
You can't connect 12V direct to the Arduino, it would be damaged. So you need to make a "Voltage Divider" from 2 resistors to bring the voltage down to something around 1 to 2V. You could use a 1K and a 10K for example. The 10K would connect the battery to the Arduino's analog input and the 1K would go between the analog input and ground. The 12V battery ground must of course be connected to the Arduinio ground. This would reduce the battery voltage down to around 1.2V. Then it is simple to write a sketch to set the Arduino to use its internal voltage reference, read the analog input and calculate the battery voltage. You can use the serial monitor to see the calculated voltage during testing.
To get red, yellow and green colours, you need a "bi-colour" (red/green) led, or use an rgb led. The bi-colour may be cheaper. You connect it to 2 arduino pwm outputs, using 2 series resistors around 200 to 300R. Then you can turn the measured battery voltage into a red-yellow-green spectrum using the map() function.
To get the information, the voltage divider is indeed a good option. Just take into account the impedance on the analog input pin. And try not to draw too much current from that.
To display them, I'd say it's up to you and what you judge clear to read. 3 LEDs of the same color can be good. Let's say, for example, 3 LEDs lit if the battery is full (> 90%), 2 LEDs if it's "normal", 1 LED if it's below a threshold (for example 25%) and 1 LED blinking if an immediate recharge/replacement is required.
You're talking about a 12V battery but what battery is it really? What type? The battery voltage have to be interpreted related to the battery chemistry.
If you are running the arduino off the same battery, power the arduino with a 5v regulator. This will allow the arduino to keep a constant REF voltage.
Ground the Arduino to the battery and the Voltage Regulator as well so all devices share a common ground.
Use a voltage divider. For a 1v lead acid, a 2:1 (a 1k and 500ohm for example) resistor set up as a divider will give the needed sub-5v input for the arduino's analog pins.
polymorph:
That resistance is -much- lower than it needs to be.
To take into account things like charge voltage, I'd just use two 22k resistors with a 0.01uF capacitor from the junction to ground.
A ~1:2 ratio is needed for a 12volt battery.
10k to ground and 22k to battery are good values.
As polymorph said, it's wise to add a 10n (10-100n) cap from junction to ground.
LED readout can be anything you like.
For lead/acid batteries, 12.8volt is considered "full", and 12volt (no load and after a rest period!) "empty".
Charging voltage for a sealed one 13.4v-13.6v, and flooded 13.8v (cars can use 14.4v).
Lead acid have a memory/lag effect, and internal resistance...
Under load, 11volt can be considered "empty".
Better battery management is done with a coulomb counter.
Leo..
Thanks a lot for info. I'll try to build and test the voltage divider circuit. About the other questions done by the readers:
my Arduino will be powered through the pin jack 5V
probably, because my project needs to be as light as possible, I will use the batteries used for drones. I think something like this: Lithium Polymer Batteries (LiPo) - RobotShop
(in details: 3 packs LiPo battery 3.7 volts, producing 11.1 volts )
Just for clarification: what is the purpose of "0.01uF capacitor from the junction to ground" proposed by Polymorph?
You can happily use 2M and 1M if you add a 100nF capacitor to keep the dynamic
impedance low - analog inputs take no DC current worth speaking of (picoamps).
You must bolster the impedance to less than 10k for accurate readings, but 100nF
is plenty for this.
If you want to follow rapid changes in voltage (unlikely here), or don't care about a few
extra milliamps dissipation then lower resistor values like 20k/10k are fine - and the
capacitor is then not needed (except perhaps to suppress noise pick-up in the wiring).
The advantage of 2M/1M is that you can leave them connected even if the battery is
flat and needs charging as a few uA isn't going to make any difference. Having said
that LA batteries always need to be charged ASAP on full discharge.
With a 3s LiPo the full charge voltage will be 12.6V, and the fully discharged voltage will be 9.6V. You shouldn't discharge LiPo cells below 3.2V as it's bad for the cells. So you're looking at a 3V range from charged to discharged.
Those packs don't have a protection circuit, they provide a balance connector for monitoring the individual cell voltages when charging. You'll need a LiPo capable charger that uses a balance connector for monitoring so you won't have a "vent with flame" event should one of the cells go over 4.2 when charging.
Low amperage LiPo packs use a protection circuit, i.e. cell phones, notebooks, tablets, etc. Packs designed for motor power don't use a protection circuit as it won't allow the amps needed for running a motor, and would shut down the battery pack. So RC and robotics use packs without protection circuits and instead use a charger that can provide for cell protection by monitoring each cell individually through the balance connector.
Some of the typical status indicators find on a typical UPS:
Online: An LED that turns on when the unit is running on line power. For a typical standby or line interactive UPS, this is the light that is on during normal operation.
On Battery: An LED that is on when the UPS is running on battery power. The "Online" LED will be out.
Overload: This light will illuminate if you try to power up more equipment than the unit can handle. You may need to resize the UPS or use less demanding equipment.
Site Wiring Fault: This LED may be in the back of the unit instead of the front. When powered on, the UPS will test the three signals that come into it from its power cord: the hot, neutral and ground pins on the plug. Possible problems include the socket having the hot and neutral lines reversed, or the ground disconnected, for example. If this LED is lit, it is an indication of a possible problem in the circuit feeding the UPS, not the unit itself. You should have a qualified electrician examine the circuit.
Replace Battery: As mentioned in the section discussing the battery, the UPS will check the battery periodically to ensure that it is charging properly and staying within operating parameters. If the battery fails the test, this LED will be illuminated, indicating that the battery needs to be replaced
Thanks,
The Cheesy Animation Factory -3D Architectural Rendering
JimmyN:
...(LIPO) packs don't have a protection circuit, they provide a balance connector for monitoring the individual cell voltages when charging. You'll need a LiPo capable charger that uses a balance connector for monitoring so you won't have a "vent with flame" event should one of the cells go over 4.2 when charging.
Low amperage LiPo packs use a protection circuit, i.e. cell phones, notebooks, tablets, etc...
Uhhh! JimmyN thanks for these informations... but they alarm me a little bit!
As you understand, I'm a newby about batteries. I thought to use batteries for drones just because of their weights. But in my project the safety is crucial: the Arduino and the strip LEDs are placed inside a pillow!
Now, if I understand your post, the "vent with flame" could happen ONLY during the recharging phase (if the charger does not use a balance connector), but not when the Arduino is working and the charger is disconnected , is it right?
Then, because of I do not drive any motors, but just a strip LEDs, do you think it could be better to use
LiPo packs with protection circuit (i.e. cell phones) as you described in your post?