Back to Parent

Outcome


Intention

The intention behind this project is to make it so that the LED light turns on when there is no light. This will be very helpful for anyone who needs a nightlight or is scared of the dark.

Img 9388.thumb
Show Advanced Options
Img 9390.thumb
Show Advanced Options
Show Advanced Options

I first started with this code that allowed us to know how much light there is available. (Shown above on the breadboard). I did run into some problems early on. I did not choose the right resistor when I first started. I also made the mistake of not connecting the resistor next to D2. Then I forgot to move the wire to the correct spot after changing the resistor. Then at the end when I thought I had solved all the problems I realized that I forgot to wire the red wire to the (+). 

Then I proceeded to modify the code so that I could dim the lights so that there was more light when the lights were dim to off. I also attached a short video demonstrating how the light works. Alongside the code. Changing the code so that it dimmed was pretty simple. It only involved changing the line that talks about ledBrightness.

Img 9393.thumb
Show Advanced Options
Img 9391.thumb
Show Advanced Options
Show Advanced Options

Product

I created a product that can light up any area that is in darkness. It would also help save energy if there is light already there because what it would do in that case is dim or turn off. 

I learned that connecting the breadboard is just as important as the code itself. Making sure you connected all the pieces in the correct spots. 

There could be more that I could add. For example adding a button to turn the light on or off. I could use multiple LED lights and make it light up more. 

Show Advanced Options
Drop files here or click to select

You can upload files of up to 20MB using this form.