DESIGN OF AN AUTOMATIC TRANSFER SWITCH FOR HOUSEHOLDS SOLAR PV SYSTEM

Friendly environmental energy sources campaign associated with their availability at almost zero cost have resulted in the increase of Renewable energy use throughout the world. In Africa and specifically in the Democratic Republic of Congo and Uganda, Solar Energy constitutes a tremendous resource. 

However, households who decide to acquire Solar PV systems end up facing two major challenges: When it is cloudy usually after rain i.e. Solar production is low yet there is a need to use power. When there is need during a normal day to supply a load which draws more current beyond solar PV system capacity. 

This project responds to these challenges by providing a solution to households who wish to still have power even when there is no enough sun irradiance for their solar PV system. And also it provides a solution to the need for drawing more current at a specific time, knowing that most households and small businesses rarely purchase a solar PV system that meets their power load requirements.

Thus, this project consists of a system that will continuously keep measuring the voltage of power sources (Inverter Output and Mains) and the current being drawn by the loads.  The primary power source is the Solar PV system and the Mains (Grid), is therefore the secondary. When solar production is low (below 200V), the system will switch to the Grid until it detects voltage within the allowable limits from the Inverter and switches back to solar. While powered by the Grid, if its voltage goes below the said-level, power is disconnected.

A Microcontroller controls the load and supplies. Two digital voltmeters and a digital Ammeter are incorporated as a subsystem to measure the voltage of both sources and the current being drawn by the loads.  A Liquid Crystal Display (LCD) continuously displays the status of the system i.e. voltage of both sources and current being drawn.

 
 
 
Project Code: 
 
#include <LiquidCrystal.h> // include the library code:
 
const int SOLAR_IN = A5;
const int MAINS_IN = A4;
const int CRRNT_IN = A3;
const int SOLAR_OUT = A1;
const int MAINS_OUT = A0;
//const int MAX_VOL = 3953; //=( (100/[330+100]) )*17000mV; //the voltage (in mV) that is from 240V AC
const int MAX_VOL = 757;  //ADC value given from 240V AC
const int CUT_OFF = 200;  //ADC value given from 240V AC
const int mV_PER_AMP = 66;
const int ACS_OFFSET = 2500; //2500
const int SOLAR_MAX = 2; //Max current expcted from solar
double crrnt_crrnt = 0;
//ARROW
//byte ARROW[8] = {0x00, 0x04, 0x08, 0x1F, 0x08, 0x04, 0x00, 0x00};
byte ARROW[8] = {0x00, 0x00, 0x04,  0x08,0x1F, 0x08, 0x04, 0x00};
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
void setup()
{
  pinMode(SOLAR_IN, INPUT); 
  pinMode(MAINS_IN, INPUT);
  pinMode(CRRNT_IN, INPUT);
  pinMode(SOLAR_OUT,OUTPUT);
  pinMode(MAINS_OUT,OUTPUT);
  digitalWrite(MAINS_OUT, LOW); 
  digitalWrite(SOLAR_OUT, LOW); //initially turn load off
  lcd.begin(16, 2);// set up the LCD’s number of columns and rows:
  lcd.print(”  KASALI ATS”);
  lcd.setCursor(0, 1);// set the cursor to column 0, line 1
  lcd.print(“CONTROL SYSTEM”);
  delay(1000);
  lcd.createChar(‘~’, ARROW);
}
double getCurr()
{
  int rawVal = analogRead(CRRNT_IN);
  double milliV = (rawVal/1023.0)*5000;
  float amps = ((float)milliV – ACS_OFFSET)/mV_PER_AMP;
  return (double)amps;
}
double getCurrent()
{
  double cur = 0;
  for(int i=0; i<100; i++)
  {
    double cur2=getCurr();
    if( cur2>cur ){ cur = cur2; };
    delay(1);
  }
  if(cur<0.1){ cur=0; } //ignore innacurace at 0
  return cur;
}
int getVol(int pin)
{
  int vol = analogRead(pin);
  vol = map( vol, 0, MAX_VOL, 0, 240); 
  return vol;
}
void switchOn(int ind)
{
  if(ind==1)
  {
    digitalWrite(MAINS_OUT, HIGH); 
    digitalWrite(SOLAR_OUT, LOW);
    lcd.setCursor(6, 0); lcd.write(‘~’);
    lcd.setCursor( 8, 0); lcd.print(crrnt_crrnt);lcd.write(‘A’);
  }
  else if(ind==2)
  {
    digitalWrite(MAINS_OUT, LOW); 
    digitalWrite(SOLAR_OUT, HIGH);
    lcd.setCursor(6, 1); lcd.write(‘~’);
    lcd.setCursor( 8, 1); lcd.print(crrnt_crrnt);lcd.write(‘A’);
  }
  else
  {
    digitalWrite(MAINS_OUT, LOW); 
    digitalWrite(SOLAR_OUT, LOW);
  }
}
void loop()
{
  int sol = getVol(SOLAR_IN);
  int mai = getVol(MAINS_IN);
  crrnt_crrnt = getCurrent();  //measure current
  lcd.clear();
  lcd.print(“S:”); lcd.print(sol);  lcd.setCursor(5, 0); lcd.print(“V”);
  lcd.setCursor(0, 1);
  lcd.print(“M:”); lcd.print(mai);  lcd.setCursor(5, 1); lcd.print(“V”);
  
  if( (sol>CUT_OFF) && crrnt_crrnt<SOLAR_MAX) //if solar is ok and the output current 
  {
    switchOn(1); //use solar
  }
  else  if( mai>CUT_OFF ) //if mains is ok
  {
    switchOn(2); //use solar
  }
  else
  {
    switchOn(3);
  }
  delay(300);
}
 
 

DESIGN OF AN AUTOMATIC TRANSFER SWITCH FOR HOUSEHOLDS SOLAR PV SYSTEM

Related Articles

Responses