Arduino Voltage Checker?

Announcement - Help us fight the BOTS! Please report all spam including stuff in your inbox!

TheBatteries

Administrator
Joined
Oct 8, 2016
Messages
2,116
Is there any way to get an Arduino to recognize when the battery is fully charged and flip a relay? I'm thinking if I set my charge controller to 57.4v (4.1v) and have the Arduino check for 56v (4.0v), I could have it flip a relay to turn on a secondary load, such as a water heater, once the cells are fully charged (4.0v) to capture wasted solar power.

I'm aware there is a device that does this for grid-tie power that was mentioned in the group before. I'm looking to do it DIY with my battery setup. I don't like when my batteries charge completely by noon and all that power is wasted...

Thanks.
 

AZ_Tekkie

Member
Joined
Oct 8, 2016
Messages
168
That is an interesting idea. I just increased the load on my inverter so my batteries don't get fully charged. They come close though. Would be a great option though once i add more panels and more battery storage.
 

Nismo nick

Member
Joined
Oct 8, 2016
Messages
62
I like this idea. It could be usefull for those that wish to use a 3s design and charge from a solar panal. I fall into this catagory for one or two projects i have in the wings.
 

PaulKennett

Member
Joined
Oct 9, 2016
Messages
86
The only problem is battery voltage level does not indicate the state of charge.

That's why lithium charging systems talk about "Constant Current / Constant Voltage" (CC-CV). The charger will start by holding the current steady and letting the voltage rise slowly, then when the voltage gets to 4.2V the charger switches to keeping the voltage steady at 4.2V and slowly reducing the current - that second phase fills the last 20% (roughly) of the capacity.

So the implication is that when the voltage of the battery first reaches 4.2V your battery is only 80% (roughly) charged.

[Could anyone with a better understanding of the process verify clarify that summery?]

Cheers, Paul
 

Bassiexp

New member
Joined
Nov 17, 2016
Messages
4
mike said:
Is there any way to get an Arduino to recognize when the battery is fully charged and flip a relay? I'm thinking if I set my charge controller to 57.4v (4.1v) and have the Arduino check for 56v (4.0v), I could have it flip a relay to turn on a secondary load, such as a water heater, once the cells are fully charged (4.0v) to capture wasted solar power.

I'm aware there is a device that does this for grid-tie power that was mentioned in the group before. I'm looking to do it DIY with my battery setup. I don't like when my batteries charge completely by noon and all that power is wasted...

Thanks.

For a test 14s battery pack I am thinking about using this over/undervoltage protection thingy. Apparently u can set the low voltage between 40V-56V and high voltage between 52V-68V so about a pack size of 13s to 17s. And than have an external relay switch the load or cut the battery or something. This because of the low switching current and surprisingly low DC voltage to be switched.

DVM-A/48V DC 48V Adjustable Over/Under Voltage Protection Monitoring Relay
 

Nathan

New member
Joined
Dec 5, 2016
Messages
28
Code:
double cellVoltage(char* cell){
  unsigned int ADCValue;
  double Voltage;
  double Vcc;

  Vcc = readVcc()/1000.0;
  ADCValue = analogRead(cell);
  Voltage = (ADCValue / 1024.0) * Vcc;
  return Voltage;
}

long readVcc() {
  long result;
  // Read 1.1V reference against AVcc
  ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
  delay(2); // Wait for Vref to settle
  ADCSRA |= _BV(ADSC); // Convert
  while (bit_is_set(ADCSRA,ADSC));
  result = ADCL;
  result |= ADCH<<8;
  result = 1125300L / result; // Back-calculate AVcc in mV
  return result;
}

The above code will return a voltage based upon the internal 1.1V base reference, which allows for voltage increases and decreases on the arduion. to use, simply connect the gnd of the Arduino up to a battery ground, the posititve to a Analog input pin and call it using something similar to the below:

Code:
  #define PINREF A0
  void setup(){
    Serial.begin(9600);
  }

  void loop(){
    Serial.println(cellVoltage(PINREF));
  
  }

I use similar code in my project, so whilst the second part of the code is untested and may need debugging, the top part works as its direct copy and paste from my project.
 

Lux_Gamer

Member
Joined
Oct 11, 2016
Messages
63
You should use a voltage divider for such a high voltage
the arduino can read a voltage up to 5v
correct me if i am wrong

Lux,
 

Nathan

New member
Joined
Dec 5, 2016
Messages
28
I had assumed that he was going to be chcking one sell in series, which would give you a 0-4.25 volt range.. especially as he had used single cell figures in brackets

mike said:
Is there any way to get an Arduino to recognize when the battery is fully charged and flip a relay? I'm thinking if I set my charge controller to 57.4v (4.1v) and have the Arduino check for 56v (4.0v), I could have it flip a relay to turn on a secondary load, such as a water heater, once the cells are fully charged (4.0v) to capture wasted solar power.

But you are quite right, he will need a voltage divider if he wants the arduino to take the full 57.4V load.
 

AE0MT

New member
Joined
Jan 6, 2017
Messages
2
mike said:
Is there any way to get an Arduino to recognize when the battery is fully charged and flip a relay? I'm thinking if I set my charge controller to 57.4v (4.1v) and have the Arduino check for 56v (4.0v), I could have it flip a relay to turn on a secondary load, such as a water heater, once the cells are fully charged (4.0v) to capture wasted solar power.

I'm aware there is a device that does this for grid-tie power that was mentioned in the group before. I'm looking to do it DIY with my battery setup. I don't like when my batteries charge completely by noon and all that power is wasted...

Thanks.

Can you give me any information on the device you mention? I want to do something similar. My charge controller is a simple MPPT controller that is charging a pair of 12v AGM batteries at the moment, and I would really love to send the delta between max solar wattage and battery charging to a grid tied inverter. I use my batteries to power the DC things in my ham radio station, and many days in the summer I end up having excess power.

Thank you.
 
Top