Introduction:

The street lights are needed to turn on in the evening and off in the morning. This is conventionally done by some person manually. But, in the absence of that person, due to unavoidable reasons, may arise problems with such manual operation. Hence there is a desirable need to make the task autonomous. The following circuit that is described here performs this job automatically. This circuit employed the output from an uncomplicated light/dark activated circuit and oblige a relay in its output which can be further attached to switch ON/OFF a street light and electrical application in a household also.

 

 Power Supply:

A power supply is needed for the operation of the circuit. Since there is a microcontroller that operates at 5 Volt DC and a Relay that operates at 12 Volt DC we need a power supply capable of providing these two voltage levels. The following circuit is designed considering the availability of a 230 Volt power supply at the street light.

 Voltage Supply Circuit (230 Volt AC to 5 Volt DC):

  1. 230 Volt to 12 Volt Step-Down Transformer: It steps down the voltage to 12 Volt to be used by our Power Supply Circuit for the Microcontroller as well as the Voltage Offset Circuit.
  2. Diode Bridge Rectifier: A bridge Rectifier made of Four Diodes rectifies the 12 Volt AC of the Transformer secondary, i.e. Only Positive Parts of the signals i.e. DC.
  3. Smoothing Capacitor: A 1000uF 25 Volt Smoothing capacitor smooths out the Voltage coming from the Bridge Rectifier.
  4. CD7805 and LM7812 Voltage Regulator: A Voltage regulator eliminates any ripple present in the Voltage supply after the capacitor so that a maximum allowable ripple of .05 Volt is present, i.e. the Output is close to Pure DC suitable for the sensitive Microcontroller. These two voltage regulators give +5Volt and +12V DC respectively.

 

 

 

 

 Complete Circuit Schematic of Street Light Controller:

 

 

 Circuit Operation:

  1. The LDR (Light Dependent Resistor)’s resistance changes when light falls on it. If this change can be detected by some circuit then some sort of automation can be performed based on low and high light conditions. Here a Voltage divider is constructed using the LDR with another 20K TrimPot in series, the voltage at the common point is measured, which is in proportion to the amount of light falling on the LDR.
  2. This Voltage is given as input to the ADC of the Microcontroller, which converts it into digital form, which is compared with a predefined value. If the measured value is lower than the pre-set value, i.e. less light is falling and hence the Lamps are turned ON. Similarly, the Lamps are turned OFF if the Pre-set value is Greater than the Measured Value.
  3. The control ON/OFF signal is given to the Relay driver. The Transistors, when forward biased by the signal from Microcontroller Turn the Relay ON, which makes the Lamps Glow. Similarly, if A logic Low, is given by the microcontroller to the base of the transistor then the Transistor turns OFF, thereby Turning OFF the Lamp.

 

 Relay Driver:

 

 

 The Street light model developed is shown below.

 

 

 https://www.youtube.com/watch?v=MSZiHfyEjhQ

// include the library code:
#include "LiquidCrystal.h"

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 8, 12, 11, 10, 9);
int Relay1 = 3;
int Relay2 = 2;

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("NITR StreetLight");
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  //Serial.begin(9600);
}

void loop() {
  int LDR1 = analogRead(A0);
  int LDR2 = analogRead(A1);

  if (LDR1 < 750) // Check Condition for LDR1
  {
    digitalWrite(Relay1, HIGH);
    lcd.setCursor(0, 1);
    //lcd.print("L1=      ");
    lcd.print("L1=ON   ");
  }
  else
  {
    digitalWrite(Relay1, LOW);
    lcd.setCursor(0, 1);
    lcd.print("L1=OFF  ");
  }

  if (LDR2 < 750)
  {
    digitalWrite(Relay2, HIGH);
    lcd.setCursor(8, 1);
    //lcd.print("L2=      ");
    lcd.print("L2=ON   ");
  }
  else {
    digitalWrite(Relay2, LOW);
    lcd.setCursor(8, 1);
    lcd.print("L2=OFF  ");
  }
  delay(1000);
}