Camping Light Dimmer

I got this light to take away with me to camp just in case I had to set up in the dark and was great for that. When I used it as a tent light it was much too bright and decided to put some type of dimmer in it. I used the PLEX board to control the LED with a push button to choose the brightness. The dimmer uses a MOSFET with PWM at 33%, 66% and 100% duty cycle to dim the LED. A capacitor was added across the push button to minimize the debounce of the switch which makes the program not jump multiple brightness with one push. Each time the button is pushed, the brightness increase by 33% until 100% where is decrease back to 33%.
Now this light will work nicely in the tent as well setting up. I’m going to add a USB port for charging and maybe add a solar panel to help keep the battery charged.
This light also funny on what information they provide about it self. On the back it saids that it has a 8800 mAH battery at 3.7V but when i open it up it uses 4X 2200 mAH batteries at 3.7V each. I think a pair is in series and then parallel with each other which means its a 4400 mAH battery at 7.4V. Them saying that it has a 8800 mAH is not a lie but it makes it seem that it has more power than what it really has.

Code for Project

GNU General Public License v3.0

//#include <EEPROM.h>

int ledPin = 11;
int buttonPin = 1;
int addr = 1;
byte fadeValue = 85;

void setup() 
  pinMode(buttonPin, INPUT);
  //fadeValue =;  
  analogWrite(ledPin, fadeValue);


void loop() 
  if(digitalRead(buttonPin) == HIGH)
    while(digitalRead(buttonPin) == HIGH){}

    fadeValue = fadeValue + 85;
    //EEPROM.write(addr, fadeValue);
  analogWrite(ledPin, fadeValue);

Latest Projects

Popular Projects