6. Lighthouse
The lighthouse is another great project for young children for the same reasons as the traffic light. They are all familiar with a lighthouse and fully under stand what it needs do.
The lighthouse is another great project for young children for the same reasons as the traffic light. They are all familiar with a lighthouse and fully under stand what it needs do.
Half the battle with any project you teach in school is finding a context that is relevant to the children's lives and that they fully understand. Even better if that context serves a useful function.
Half the battle with any project you teach in school is finding a context that is relevant to the children's lives and that they fully understand. Even better if that context serves a useful function.
Task:
Task:
Create a lighthouse model that can sense light and dark and automatically operate a light to flash on for 1 second and off for three seconds when it is dark.
Create a lighthouse model that can sense light and dark and automatically operate a light to flash on for 1 second and off for three seconds when it is dark.
It must also have a buzzer for a fog horn that will sound for 2 seconds then switch off for 2 seconds when a button is pressed.
It must also have a buzzer for a fog horn that will sound for 2 seconds then switch off for 2 seconds when a button is pressed.
Algorithm:
Algorithm:
Repeat forever
Repeat forever
if input is high
if input is high
switch the LED on
switch the LED on
pause for 1 second
pause for 1 second
switch the LED off
switch the LED off
pause for 3 seconds
pause for 3 seconds
else switch the LED off
else switch the LED off
if the push switch is closed
if the push switch is closed
switch the buzzer on
switch the buzzer on
pause for 2 seconds
pause for 2 seconds
switch the buzzer off
switch the buzzer off
pause for 2 seconds
pause for 2 seconds
Model:
Model:
There is no need to buy a fairground ride kit. In fact the children will learn much more if they design and build the ride themselves. making this an ideal STEM project.
There is no need to buy a fairground ride kit. In fact the children will learn much more if they design and build the ride themselves. making this an ideal STEM project.
To make this model, all you need is an LED, an LDR, the tube from a kitchen roll and a plastic shot glass, to make the lighthouse. For the rocks you will need some paper and PVA glue, a buzzer and a push switch.
To make this model, all you need is an LED, an LDR, the tube from a kitchen roll and a plastic shot glass, to make the lighthouse. For the rocks you will need some paper and PVA glue, a buzzer and a push switch.
You will need to add about 40 cm of wire to the legs of the LED and the LDR and 20 cm of wire to the buzzer and push switch.
You will need to add about 40 cm of wire to the legs of the LED and the LDR and 20 cm of wire to the buzzer and push switch.
The connector blocks are to make the connection between the lighthouse model and the gpiO interface.
The connector blocks are to make the connection between the lighthouse model and the gpiO interface.
MakeCode editor script:
MakeCode editor script:
Micro Python script:
Micro Python script:
from microbit import *
while True:
if pin2.read_analog() > 950:
pin1.write_digital(1)
else:
pin1.write_digital(0)
if button_a.was_ pressed():
pin0.write_digital(1)
else:
pin0.write_digital(0)