LED Strip Brightness Controller
by adithya1543 in Circuits > Arduino
2940 Views, 1 Favorites, 0 Comments
LED Strip Brightness Controller
LED Strips are famous across the globe for its consumption of low voltage and its brightness .Sometimes we need to adjust the voltage supply and brightness of these LED strips, for example, during your sleep you would get disturbed due to the brightness of LED. This is a arduino project to control the brightness of LED strip . it is user - friendly as it receives brightness value from the user. The brightness value depends on the voltage given to LED strip. If the user gives 5v , it gives the maximum brightness, if the user gives 0.1 volts it supplies low brightness. Arduino could write voltage from 0 - 255 (0-5v splits eg: 1v = 51 units) . But using commands and calculation we can minimise this to 0-5v. Lets go into the project.
Supplies
Requirements :
- Arduino UNO / nano / MEGA
- LED strip (Should work on minimum
- Arduino IDE
- connecting wires (nos 2)
CONNECTIONS
These are the connections to connect LED Strip with Arduino:
ARDUINO LED Strip
GND >> - (negative)
DIGITAL PWM 3 (pin3 ) >> + (positive)
----------------------------------------------------------------------------------------
connect the negative pin of LED strip to groung(GND) pin of arduino
connect the positive pin of LED strip to pin 3 pin of arduino
CODE
The most important thing next to hardware in Arduino is the code .The code is given below. Type this code and upload it using arduino IDE or bluino loader.
float brightness ;
int LED =3; float realbrightness; float delay1; float delay2; float option; void setup () { pinMode(LED,OUTPUT); Serial.begin(9600); Serial.println("Arduino LED strip controller"); Serial.println(" "); Serial.println("Please enter the brightness of LED strip (1-5)"); Serial.println(" "); while (Serial.available() ==0) {} brightness = Serial.parseFloat(); realbrightness = (brightness) * 51.0; if (realbrightness >=6 ) { Serial.println(" Please enter a valid brightness"); } } void loop () { Serial.println(" "); Serial.println("The LED strip is blinking at rate of "); Serial.print(brightness); analogWrite(LED,realbrightness); delay(1000); }
TIME TO TEST !
Connect the Arduino upload the code, open the Serial monitor. The message "Please enter the brightness of LED strip (1-5)" should be displayed .Enter the brightness value and click send . you can view that your LED strip is running in your brightness command!.
ADDITIONAL INFO:
- The brightness can be entered in decimal value.
- brightness entered above 5, will be same as 5.
- As the value gets less, the brightness reduces.
- By default sometimes Arduino drivers may be missing in yout computer . To solve errors ,open device manager and update all unknown drivers.
- Select the correct COM port and version of Arduino.
- Code alternate download :