3D printed Arduino supported rechargable dimmable 3W LED desk lamp

in arduino •  7 years ago 

Made with :
Arduino Pro Mini ,
IRF540 mosfet ,
3X 1W COB LED module ,
2X 18650 (dismantled from laptop battery, 2P) ,
Powerbank charger module ,
JST pair cables ,
Potentiometer with aluminium cap ,
PLA printed 3D models.

Take care about the code. If you don't smooth analogRead values, you will get flickering effect so badly. Here I pasted the code:


double total;
int adim;
int sensorValue =0;
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
pinMode(3, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
sensorValue = analogRead(A1);
total=total+sensorValue;
adim++;
if(adim==256)
{
Serial.println(adim);
Serial.println(total);
sensorValue=total/256;
Serial.println(sensorValue);
adim=0;
total=0;
int y = map(sensorValue, 1, 1023, 1, 255);
analogWrite(3,y );
Serial.println(y);
}
delay(1);
}


This circuit can be made with 555 circuit or Attiny rather than Arduino . The 555 circuit needs some resistors and capacitors and I don't sure if it can give high frequency PWM's like mcus. The low frequency PWM driven LEDs are giving headaches to people. And one last final word, the most important part of this type of projects is the model of the product. In this case I used a lot of tapes and glues even I use 3D printer for outer body (I didn't have so much time to improve the model). My model doesn't look so durable also.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!