---
title: "PROJECT 8: SMART STREET LIGHT "
description: Smart Street lights are needed as they improve energy efficiency, enhance public safety, reduce operational costs, and provide better lighting control. They can automatically adjust brightness based on activity and weather conditions In this experiment we are going to consider…
url: "https://nedu.rw/documentation/project-8-smart-street-light/"
updated: "2026-10-13"
category: InnoKit MPK A100 / Experiments you can do with MPK A100
---

# PROJECT 8: SMART STREET LIGHT 

Smart Street lights are needed as they improve energy efficiency, enhance public safety, reduce operational costs, and provide better lighting control. They can automatically adjust brightness based on activity and weather conditions

In this experiment we are going to consider a prototype of the smart street light using LDR. **As soon as** the light reaching the LDR falls below a certain level, the Arduino microcontroller **automatically** turns ON a couple of LEDs. **Based on** the value the microcontroller reads, the program will **subsequently** set the LEDs to HIGH or LOW. This simulates how to turn ON and OFF the light on the street at night.

## Objectives

The aim of this experiment is to help a leaner: 

- **To begin with**, understand the operation of the Light Dependent Resistor (LDR) **in order to** effectively control the street light.
- To understand the working principle of street lights. 
- Make a prototype and design of an automatic street light.

## Material to Use

| ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdOo7uR5m1ETIEDsM1RxaAFkoZik_rv6Vrh2b0W673tdJS71eT3tF_Jr_noT60Y49aCDWLPjkZOBn_F05HCEK3iu_3nD41o5vNZ4Keys08_Xu2_DQ-v2gO-_Zi0TZJlNDe7zgJSeuzZStURofGJLSE3BabwxYJX6IBa-Nb3VAQrveE8-mV6yVU?key=EIFaBMwRIuJeDoZo9taXbw) | ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfthWg5pB_MHLFvPJjadBpMdV-KRx4Gj9Zn1ZZkUOgf_4qXJZU7Z7cFcMkni3SJESnXS_Cw-NRC_PuwRtt-lLshAHcEyGPv7EgjSwY6mQtcS9gYQm6z5GpXM7oZ-KbahIU8GZ85ja4mXpnlp8stYeaDboEMZBOYTCp91B08D7QFtkwX-MnbdZc?key=EIFaBMwRIuJeDoZo9taXbw) | ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXc7LGxzUpdpU4Un6_z-kvBcIZ26gaJD_9nLBl6WB0-GwSzw0K7Ed86JwTzFrtI-d9Fr8n1vx7ujI1B6I4UyRFnigOXiKq7k84TdN10Bjbp-1mSwEGd8-7mxmvbz-lk48LoYDBzZNOBQb5BDiFOO4UAi4ViRIrXnR68WJXcW5zuRylxJ8jUVxiM?key=EIFaBMwRIuJeDoZo9taXbw) |
| --- | --- | --- |
| ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeQTHoT1VWxBMFB-co1vl5eFNLBtmc8qbdEytiWkxbkG_2pFaSTseQzh8RGd21RZ_k8kyukZQsPbutKNY0PByZ90v2wuRbtloulJVjwwhsO6WKfMLwWEtXPPQJClD_p4h5_yA_3jX2Iz58jPBfK4keXOspMAaaWsYagboUENDhdYvAyPghtFA?key=EIFaBMwRIuJeDoZo9taXbw) |  |  |

## Circuit diagram

![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcbdJ0o47CjNCAxBEVdzJ_Y3pK6i8CRJx7BK7lQvRVh7N6q2okLl0eBW_jrHilf4feAYwdzwvo-2ItMU_-M7xd5Tm-YeX3GPC9aHrYJcB7ixcvruRj7oOrKFK35FACbdP1jcjBIXLH_YHE7Vh1k?key=EIFaBMwRIuJeDoZo9taXbw)

***                                                          Figure: Schematic diagram***

***Figure: Components used to make connection on the board***

## Arduino Code

    1234
5678910 1112131415161718192021222324252627282930313233343536373839404142    #include LiquidCrystal.h>  const int rs =12, en=11, d4=5, d5=4, d6=3, d7=2; LiquidCrystal Lcd(rs,en,d4,d5,d6,d7); int LDR =A0; //corresponding digital value at LDR's terminal connected to pinA0
 int led1=10; int led6=9; int led2 =8; int led3=7;int led4=6;int led5=5; void setup() { Lcd.begin(16,2); pinMode(A0,OUTPUT); pinMode(10,OUTPUT); pinMode(9,OUTPUT); pinMode(8,OUTPUT); pinMode(7,OUTPUT); pinMode(6,OUTPUT); pinMode(5,OUTPUT); } void loop (){ int ldrStatus = analogRead(LDR);  if (ldrStatus Lcd.print("light ON "); Lcd.setCursor(0, 1); digitalWrite(10,HIGH); delay(1000); // value is 0 (Dark), led turns ON digitalWrite(9,HIGH); delay(1000); // value is 0 (Dark), led turns ON digitalWrite(8,HIGH); delay(1000); // value is 0 (Dark), led turns ON digitalWrite(7,HIGH); delay(1000); // value is 0 (Dark), led turns ON digitalWrite(6,HIGH); delay(1000); // value is 0 (Dark), led turns ON digitalWrite(5,HIGH); delay(1000); // value is 0 (Dark), led turns ON } else{ if (ldrStatus >= 100) { Lcd.setCursor(0, 1); Lcd.print("light OFF "); digitalWrite(10,LOW);//if digital value is 1 , Daylight, LED1 turns OFF digitalWrite(9,LOW);// if digital value is 1 , Daylight, LED2 turns OFF digitalWrite(8,LOW);//if digital value is 1 , Daylight, LED3 turns OFF digitalWrite(7,LOW);//if digital value is 1 , Daylight, LED4 turns OFF digitalWrite(6,LOW);//if digital value is 1 , Daylight, LED5 turns OFF digitalWrite(5,LOW);//if digital value is 1 , Daylight, LED6 turns OFF Lcd.setCursor(0, 1); } } }

## Code knowledge

    1718   void loop (){ int ldrStatus = analogRead(LDR);

The loop() function runs continuously and reads the light level from the LDR.

ldrStatus: Holds the analog reading from the LDR, which ranges from 0 (dark) to 1023 (bright).

    19202122232425262728    if (ldrStatus Lcd.print("light ON "); Lcd.setCursor(0, 1); digitalWrite(10,HIGH); delay(1000); // value is 0 (Dark), led turns ON digitalWrite(9,HIGH); delay(1000); // value is 0 (Dark), led turns ON digitalWrite(8,HIGH); delay(1000); // value is 0 (Dark), led turns ON digitalWrite(7,HIGH); delay(1000); // value is 0 (Dark), led turns ON digitalWrite(6,HIGH); delay(1000); // value is 0 (Dark), led turns ON digitalWrite(5,HIGH); delay(1000); // value is 0 (Dark), led turns ON }

**When** the LDR detects a light level of 200 or lower (considered dark), the system **then** prints the message "light ON" on the LCD. It then turns on each LED (connected to pins 10 to 5) one after the other using `digitalWrite(pin, HIGH)`, with a one-second delay (`delay(1000)`) between each. This creates a sequential lighting effect.

    2930313233343536373839404142   else{ if (ldrStatus >= 100) { Lcd.setCursor(0, 1); Lcd.print("light OFF "); digitalWrite(10,LOW);//if digital value is 1 , Daylight, LED1 turns OFF digitalWrite(9,LOW);// if digital value is 1 , Daylight, LED2 turns OFF digitalWrite(8,LOW);//if digital value is 1 , Daylight, LED3 turns OFF digitalWrite(7,LOW);//if digital value is 1 , Daylight, LED4 turns OFF digitalWrite(6,LOW);//if digital value is 1 , Daylight, LED5 turns OFF digitalWrite(5,LOW);//if digital value is 1 , Daylight, LED6 turns OFF Lcd.setCursor(0, 1); } } }

If the light level is greater than or equal to 100, the system displays the message "light OFF" on the LCD and turns off all LEDs by setting `digitalWrite(pin, LOW)`. **Meanwhile**, the system continuously monitors the light level from the LDR and **therefore** updates the light status accordingly.

## Result

***Visual Output:***

In the dark, the system lights up the LEDs one by one and displays "light ON" on the LCD.
