Night Light

Using a micro:bit, an analog light sensor, and an LED, we create an automatic night light that turns on in the dark!


YOU WILL NEED

Electronics
• BBC Micro:bit
• Tinkercademy GVS breakout board,
• LED brick
• analog light sensor

Craft Materials
• a small cardboard box
• a piece of crepe paper or coloured cellophane

Stationery
• Penknife


STEP 1

Making the frame
First, we’ll create the frame for the night light. We use a small cardboard box, and cut off any top flaps.



STEP 2

Cutting a hole
Next, we need to cut a small hole on one side of the box.

We will thread our analog light sensor through this hole, so that it can sense the light level outside the box. The light level inside the box would probably not be very interesting.



STEP 3

Threading the light sensor
Now thread the three-coloured GVS wires of the light sensor through the hole so that the sensor is on the outside of the box.



STEP 4

Blocking the micro:bit power light
We need to hide the power light on the micro:bit since it will be on all the time, we don’t want it interfering with our Night Light.

To do this, we’ll cut a piece of cardboard to go inside our box. This will act as a separator with the micro:bit hidden behind it and our LED in front of it.

On this piece of card board, we add a small hole (about 1cm x 0.5cm), that we’ll thread our LED wires through.



STEP 5

Threading the LED
Thread the three-coloured GVS wires of the LED through the hole you cut in the last step!



STEP 6

Connect the components
Finally, assemble all your components! Connect your light sensor to P0, and your LED light to P1. Then, put your micro:bit and battery pack inside the box, sliding the cover into place.



STEP 7

Decorate!
Decorate your night light with some translucent crepe paper and/or coloured cellophane, and you’re done building, and ready to code! Feel free to explore different colours of cellophane for different moods.


Code and References

Made this activity? Good Job! Now spread the word. Share a photo of your creation on social media with #letsgethacking #NightLight