Light Sensor LED Brightness Control System With ATMEGA328 UNO V3.0 R3 for Arduino

by ICStation in Circuits > Arduino

15562 Views, 12 Favorites, 0 Comments

Light Sensor LED Brightness Control System With ATMEGA328 UNO V3.0 R3 for Arduino

536c7eac9d29c9be99000023.jpg

ICStation team introduce you this light sensor LED brightness control system with our self-developed product ICStation ATMEGA328 UNO V3.0 R3 Board Compatible Arduino.It uses DC5V to work and it can change the brightness of highlight light emitting diode according to the light intensity of surrounding environment.It is a low-cost and simple lighting control system which can be used energy-saving lighting in the places such as passageway and road.

Functions of the system:

1.After startup, the analog light sensor will give a brightness of LED according to the light intensity of surrounding environment.

2.If the surrounding light becomes darker and darker, while the LED becomes brighter and brighter.

3.If the surrounding light becomes brighter and brighter, while the LED becomes darker and darker.

4.If the light intensity of surrounding environment is stronger than the analog output value which we pre-set in the program, the LED will go out.

Components List

图片1.jpg

Schematic Diagram

图片9.png

Connect the +5V Power Supply and GND of Development Board to the Bread Board

图片2.jpg

The red wire connects the power supply and the black wire connects the GND

Connect the Analog Light Sensor With 3P DuPont Line

34.jpg

Connect the analog light sensor with 3P DuPont line and connect the pin to the another end of 3P DuPont line.

Put the Light Sensor and LED on the Bread Board

图片5.jpg

Connect the Cathode and Anode of Components to the Common Terminal

图片6.jpg

Connect the power supply end and GND of the components to the common cathode and anode of bread board

Connect the Signal End of Component to the Development Board

图片7.jpg

Connect the signal end of analog sensor and highlight LED light emitting diode to corresponding pins of the ICStation UNO R3 development board compatible with Arduino

Code of the Program Design

图片8.jpg

Specific source program as follows:
int _ABVAR_1_Bright;

void setup()

{   

_ABVAR_1_Bright = 0;

  Serial.begin(9600);

}

void loop()

{   

Serial.print( analogRead(A0) );  

 Serial.println("");  

 _ABVAR_1_Bright = analogRead(A0) ;   

analogWrite(3, map ( _ABVAR_1_Bright , 50 , 900 , 0 , 255 ) );

if (( ( _ABVAR_1_Bright ) < ( 50 ) ))  

 {

analogWrite(3, 0);   

}

}

The Video to Show the Effect

Tutorial for Arduino▶5 Light Sensor/ LED Brightness Control System