connect@howdiyworld.com
|

Street Light Automation

BLOCK DIAGRAM

Procedure

  1. LDR Sensor and LED
  2. Connections
  3. Program
  4. Automating Street Light

What is a LDR Sensor?

This resistor works on the principle of photo conductivity. It is nothing but, when the light falls on its surface, then the material conductivity increases.

What is a LED?

A LED or Light Emitting Diode is a Semiconductor  two terminal(Pin) component, the two terminals are (+)Positive and (-)Negative. The voltage is applied to positive terminal and negative terminal should be ground light is emitted. Here we are using 12V LED so the maximum Voltage for positive terminal is 12V and minimum is 3V. If we use anything above 12V the LED will get short circuit.

Connections

  • Connect the LED’s positive to 38th pin
  • Connect the LED’s Negative(GND) pin to 34th pin
  • Connect LDR’s VCC pin to 4th Pin
  • Connect LDR’s Ground(GND) pin to 6th Pin
  • Connect LDR’s D0 pin to 8th piN

Program

import RPi.GPIO as GPIO

import time

GPIO.setwarnings(False)

GPIO.setmode(GPIO.BOARD)

GPIO.setup(8,GPIO.IN)

GPIO.setup(38,GPIO.OUT)

while True:

    a=GPIO.input(8)

    if a==0:

        print(“Day")

        GPIO.output(38,False)

    else:

        print(“Night")

        GPIO.output(38,True)

Automating Street Light

         In this screen you can see the status if its Day or Night, If it is night the LED will be ON.

Social media & sharing icons powered by UltimatelySocial
Facebook
Twitter
YouTube
LinkedIn
Instagram