user6263336
Published © CC BY-NC

Generator ATS

Automatic switch controller and generator monitor.

IntermediateWork in progress8 hours26,952
Generator ATS

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
12V Sealed Lead Acid Battery 1.2Ah
×1
Mechanical Changeover Auto Switch
×1
25A SSR
Two required to isolate genset output
×1
8 module Arduino Relay board 5V
×1
12v to 5v Power supply 2A
×1
230V 12v Intelligent battery trickle charger
×1

Story

Read more

Schematics

Block Diag. Gen ATS

Code

CODING IN Progress

Python
Any suggestions will be gratefully received, very new to Python coding, last coding experience was Loco Basic 1985 ish :)
 // set pin numbers:
const int MainsSupplyPin = 2;     // the number of the pushbutton pin
const int RelayPin3 =  3;      // the number of the Relay pin
const int RelayPin4 =  4;
const int GenSwitchPin5 =  5;
// variables will change:
int MainsSupplyState = 0;         // variable for reading the MainsSupplybutton status
int GenSwitchState = 0;         // variable for reading the GenSwitchbutton status

void setup() {
  // initialize the Relay pin3 as an output:
  pinMode(RelayPin3, OUTPUT);
  pinMode(RelayPin4, OUTPUT);
  // initialize the pushbutton pin as an input:
  pinMode(MainsSupplyPin, INPUT);
  pinMode(GenSwitchPin5, INPUT);
}

void loop() {
  // read the state of the pushbutton value:
  digitalWrite(GenSwitchPin5, LOW);
  MainsSupplyState = digitalRead(MainsSupplyPin);

  // check if the MainsSupplybutton is pressed.
  // if it is, the MainsSupplyState is HIGH:
  if (MainsSupplyState == HIGH) {
    // turn Relay on:
    digitalWrite(RelayPin4, HIGH);
    digitalWrite(RelayPin3, HIGH);
    delay(5000);
  } else {
    // turn Relay off:
    digitalWrite(RelayPin3, LOW);
    digitalWrite(RelayPin4, LOW);
  }
}

Credits

user6263336

user6263336

1 project • 22 followers

Comments