Ładowarka akumulatorów

Akumulatory NiMHImg_9705

Akumulatorki są świetnym źródłem energii dla przenośnych urządzeń. Pozwalają zaoszczędzić mnóstwo pieniędzy oraz ich używanie jest bardziej korzystne niż używanie tradycyjnych baterii. W celu zachowania jak najdłuższej żywotności akumulatorki powinni być poprawnie ładowane. Oznacza to, że potrzebna jest dobra ładowarka akumulatorów.
Można wydać mnóstwo pieniędzy na ładowarkę ze sklepu, jednak dużo lepszą frajdę da zbudowanie własnej ładowarki
Zobaczmy jak można to zrobić z wykorzystaniem Arduino.

Na początku warto zaznaczyć, że nie ma uniwersalnej metody ładowania dla wszystkich akumulatorów. Każdy typ akumulatora używa innego procesu chemicznego, zatem każdy z nich powinien być inaczej ładowany. Dla uproszczenia, poniższy opis dotyczyć będzie akumulatorów typu NiMH – Nickel-Metal Hydride.

Elementy

Do wykonania ładowarki będzie potrzebować:Img_9718

– gniazdo baterii AA
– akumulator NiMH
– 10 Ohm rezystor (o mocy minimum 5W)
– 1 MOhm rezystor
– 1 uF kondensator
– IRF510 – MOSFET
– TMP36 – czujnik temperatury
– płytkę prototypową
– kable podłączeniowe
– źródło zasilania 5V

Jak ładować akumulatory NiMHImg_9715

Są różne sposoby ładowania akumulatorów NiMH. Metoda zależy głównie od tego jak szybko chcemy naładować akumulator.
Współczynnik ładowania (Charge rate) jest mierzony w zależności od pojemności akumulatora. Jeżeli akumulator ma pojemność 2500mAh i jest ładowany prądem 2500mA, wówczas współczynnik wynosi 1C. Jeżeli jest ładowany prądem 250mA, współczynnik wynosi C/10.

W momencie, gdy ładujemy akumulator bardzo szybko (współczynnik ładowania większy od C/10) należy monitorować temperature i napięcie, gdyż łatwo może dojść do przeładowania akumulatora. Taka sytuacja może uszkodzić akumulator.
W przypadku kiedy akumulator jest ładowany powoli (współczynnik ładowania poniżej C/10) wówczas prawdopodobieństwo uszkodzenia maleje. Dlatego powolne ładowanie jest uważane za bezpieczne i pozwala uzyskać maksymalną żywotność baterii.

Ładowarka akumulatorów NIMH została zaprojektowana ze współczynnikem ładowania C/10.

Obwód ładowania

arduino-battery-circuit

Obwód jest podłączony do źródła zasilania 5V. Niestety nie można podłączyć go do portu USB ze względu na pobór prądu. 5 voltowe źródło zasilania podaje napięcie poprzez 10 Ohmowy rezystor do tranzystora MOSFET. Rezystor umożliwia pomiar prądu kierowanego do baterii (analogowe PINy Arduino są podłączone do rezystora). Tranzystor steruje przepływem prądu i jest sterowany cyfrowym wyjściem PWM z Arduino. Sygnał PWM jest wygładzany za pomocą kondensatora 1uF i 1M rezystora.
Obwód umożliwia Arduino kontrolowanie prądu płynącego do baterii z ładowarki akumulatorów.

Czujnik temperatury

Jako dodatkowe zabezpieczenie został wykorzystany czujnik temperatury TMP36 do monitorowania stanu baterii. Sensor wysyła napięcie proporcjonalne do temperatury. Nie wymaga on kalibracji. Został on zamontowany w gnieździe baterii. Piny sensora są podłączone do płytki Arduino. Odpowiednio 5V (zasilanie), GND (masa) oraz analogowe wyjście.

Ładowarka akumulatorów – kod źródłowy

W kodzie należy dostosować pojemność baterii batteryCapacity – domyślnie to 2500.

//http://www.allaboutcircuits.com/projects/create-an-arduino-controlled-battery-charger/

int batteryCapacity = 2500;     //capacity rating of battery in mAh
float resistance = 10.0;     //measured resistance of the power resistor
int cutoffVoltage = 1600;     //maximum battery voltage (in mV) that should not be exceeded
float cutoffTemperatureC = 35;     //maximum battery temperature that should not be exceeded (in degrees C)
//float cutoffTemperatureF = 95;     //maximum battery temperature that should not be exceeded (in degrees F)
long cutoffTime = 46800000;     //maximum charge time of 13 hours that should not be exceeded

int outputPin = 9;     // Output signal wire connected to digital pin 9
int outputValue = 150;     //value of PWM output signal 

int analogPinOne = 0;     //first voltage probe connected to analog pin 1
float valueProbeOne = 0;     //variable to store the value of analogPinOne
float voltageProbeOne = 0;     //calculated voltage at analogPinOne

int analogPinTwo = 1;     //second voltage probe connected to analog pin 2
float valueProbeTwo = 0;     //variable to store the value of analogPinTwo
float voltageProbeTwo = 0;     //calculated voltage at analogPinTwo

int analogPinThree = 2;     //third voltage probe connected to analog pin 2
float valueProbeThree = 0;     //variable to store the value of analogPinThree
float tmp36Voltage = 0;     //calculated voltage at analogPinThree
float temperatureC = 0;     //calculated temperature of probe in degrees C
//float temperatureF = 0;     //calculated temperature of probe in degrees F

float voltageDifference = 0;     //difference in voltage between analogPinOne and analogPinTwo
float batteryVoltage = 0;     //calculated voltage of battery
float current = 0;     //calculated current through the load (in mA)
float targetCurrent = batteryCapacity / 10;     //target output current (in mA) set at C/10 or 1/10 of the battery capacity per hour
float currentError = 0;     //difference between target current and actual current (in mA)



void setup()
{
  Serial.begin(9600);     //  setup serial
  pinMode(outputPin, OUTPUT);     // sets the pin as output
}



void loop()
{
    
  analogWrite(outputPin, outputValue);  //Write output value to output pin

  Serial.print("Output: ");     //display output values for monitoring with a computer
  Serial.println(outputValue); 

  valueProbeOne = analogRead(analogPinOne);    // read the input value at probe one
  voltageProbeOne = (valueProbeOne*5000)/1023;     //calculate voltage at probe one in milliVolts
  Serial.print("Voltage Probe One (mV): ");     //display voltage at probe one
  Serial.println(voltageProbeOne);  
  
  valueProbeTwo = analogRead(analogPinTwo);    // read the input value at probe two
  voltageProbeTwo = (valueProbeTwo*5000)/1023;     //calculate voltage at probe two in milliVolts
  Serial.print("Voltage Probe Two (mV): ");     //display voltage at probe two
  Serial.println(voltageProbeTwo);  
  
  batteryVoltage = 5000 - voltageProbeTwo;     //calculate battery voltage
  Serial.print("Battery Voltage (mV): ");     //display battery voltage
  Serial.println(batteryVoltage); 

  current = (voltageProbeTwo - voltageProbeOne) / resistance;     //calculate charge current
  Serial.print("Target Current (mA): ");     //display target current 
  Serial.println(targetCurrent);  
  Serial.print("Battery Current (mA): ");     //display actual current
  Serial.println(current);  
      
  currentError = targetCurrent - current;     //difference between target current and measured current
  Serial.print("Current Error  (mA): ");     //display current error 
  Serial.println(currentError);     

  valueProbeThree = analogRead(analogPinThree);    // read the input value at probe three  
  tmp36Voltage = valueProbeThree * 5.0;     // converting that reading to voltage
  tmp36Voltage /= 1024.0; 
 
  temperatureC = (tmp36Voltage - 0.5) * 100 ;     //converting from 10 mv per degree wit 500 mV offset to degrees ((voltage - 500mV) times 100)
  Serial.print("Temperature (degrees C) ");     //display the temperature in degrees C
  Serial.println(temperatureC); 
 
 /*
  temperatureF = (temperatureC * 9.0 / 5.0) + 32.0;     //convert to Fahrenheit
  Serial.print("Temperature (degrees F) ");
  Serial.println(temperatureF); 
 */
 
  Serial.println();     //extra spaces to make debugging data easier to read
  Serial.println();  



  if(abs(currentError) > 10)     //if output error is large enough, adjust output
   {
    outputValue = outputValue + currentError / 10;

    if(outputValue < 1)    //output can never go below 0
     {
      outputValue = 0;
     }

    if(outputValue > 254)     //output can never go above 255
     {
      outputValue = 255;
     }
    
    analogWrite(outputPin, outputValue);     //write the new output value
   }
 
 
  if(temperatureC > cutoffTemperatureC)     //stop charging if the battery temperature exceeds the safety threshold
   {
    outputValue = 0;
    Serial.print("Max Temperature Exceeded");
   }
   
  /*
  if(temperatureF > cutoffTemperatureF)     //stop charging if the battery temperature exceeds the safety threshold
   {
    outputValue = 0;
   }
   */
   
   if(batteryVoltage > cutoffVoltage)     //stop charging if the battery voltage exceeds the safety threshold
   {
    outputValue = 0;
    Serial.print("Max Voltage Exceeded");
   }  
 
   if(millis() > cutoffTime)     //stop charging if the charge time threshold
   {
    outputValue = 0;
    Serial.print("Max Charge Time Exceeded");
   }  

   delay(10000);     //delay 10 seconds before next iteration
}



 

Źródło

Projekt został przetłumaczony przez http://www.elektronika24.pl i pochodzi ze strony:
http://www.allaboutcircuits.com/projects/create-an-arduino-controlled-battery-charger/

 

Zobacz też