ICStation Team
Published

Light Sensor LED Brightness Control System

Use an ATMEGA328 Uno to fade an LED.

BeginnerFull instructions provided1,307
Light Sensor LED Brightness Control System

Things used in this project

Hardware components

ICStation UNO
ICStation UNO
with USB compatible with Arduino
×1
Bread board
×1
Highlight LED
×1
Analog light sensor
×1
Hard jumper wire
×1
Jumper wire
×4
5V DC power supply
×1
3-pin header
Male to male
×1
DuPont line
×3

Story

Read more

Schematics

1.jpg

Code

Untitled file

Plain text
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); 

}

}

Credits

ICStation Team

ICStation Team

27 projects • 46 followers
ICStation.com is a leading company specializes in all kinds of IC products, such as electronic devices and components, development modules, development boards,

Comments