I'm trying to make a Low Voltage Cutoff for my boombox with the Arduino. My needs for this is the Arduino to disconnect the battery at 11.6 volts. How would I do this, what would I need? I am new to the analog to digital business and need help for the value to put in the code for the digital value.
The arduino will be powered by the same battery and I put the code with the first post that I made. I just need to know how to get the right digital value for the voltage out the divider going into arduino. How would I get the value? I'm new to the analog to digital.
Make an accurate voltage divider with precision resistors, and there is no need to calibrate it.
Otherwise, make a 3:1 divider with three 10K resistors (two in series to make 20K on top and one 10K in the bottom) and calibrate it with your multimeter.
It is not a good idea to power the Arduino with a "12 V" lead acid battery via the barrel jack, because the voltage can go well over 14 V during charging, and that is too high for the on board voltage regulator.
What value is (or would be) returned by analogRead() when the battery voltage falls to 11.6v?
You can calculate that value by measuring the voltage with a multimeter when it is higher and noting the corresponding value from analogRead(). Do that measurement and tell us the values. Better still get two separate sets of values for two different battery voltages.
Could the relay be used on the power input if the arduino so when the threshold value gets hit, then the arduino and the boombox just shut off? Like the relay is a closed circuit when arduino is powered, then when the value is hit, then the relay would shut off everything. Mabye.
coolyyz321:
Could the relay be used on the power input if the arduino so when the threshold value gets hit, then the arduino and the boombox just shut off? Like the relay is a closed circuit when arduino is powered, then when the value is hit, then the relay would shut off everything. Mabye.
That is certainly possible. But you need a relay that requires power to hold it closed. The way your code is written
if (VoltageReading <785)
{
digitalWrite(RELAY, HIGH);
}
it looks like it is normally closed and that would not switch everything off.
If the relay does switch everything off you will need to hold the ON switch long enough for the Arduino to boot and take charge of the relay with a digitalWrite(make-relay-go-on) in setup()