Back to Parent

Outcome


Imagine a simple three component sensing device (an LED, a sensor and one additional sensor or input). Using a switch, the photoresistor will start to work then and sense whether or not the led night light is needed. With lower levels of light, the light turns on and when it gets bright the led dims as its no longer needed. When one is ready to go to bed they can use the switch to completely turn it off.

Show Advanced Options
Show Advanced Options

Sensors Exercise 1:

The program shows how much light is available. When there is lots of light the LED is bright. When there is little light it’s dim.

Show Advanced Options
Show Advanced Options

Sensors Exercise 2:

Modify the program so that the LED shows the opposite. When there is little light, it will be bright and when there’s lots of light, it will be off.  

Show Advanced Options
Show Advanced Options

Sensors Exercise 3:

Instead of fading your light, why not turn it on or off when the light reaches certain levels.

For example, if the light levels are below 600 turn the light on (and bright), otherwise turn it off.

Modify the program to work in this way.  

Show Advanced Options
Show Advanced Options

Future Application:

Something that could be interesting to add would be the possibility to set schedules for the night light that could then automatically turn off instead of having to manually hit a switch when you want to go to bed. I also think the LED could be more of a light strip that's more of an ambient light source, allowing more opportunity for colors and brightness. 


Reflection:

One of the tricky aspects of this project was getting the reading of the photoresistor and figuring out how to publish that reading. This was important because then I could set up the values in the code so that they were accurate to the room I was in and the conditions that made the light turn on. At first the program wasn't working because I wasn't getting the lowest values I thought I would get when covering the photoresistor with my sleeve. The photoresistor was still getting values of light even when I thought I was completely covering it up.

Drop files here or click to select

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