Case 01: Automated Smart Playground Lamp
Level:★☆☆☆☆
Motion sensor is used to detect if there are people moving in the playground, if there are, the LED light will be turned on; otherwise, it will be turned off.
![smart%20city%20label_edited.png](https://static.wixstatic.com/media/3377f1_8edf4ba83ff6498e95eca912b412d504~mv2.png/v1/crop/x_62,y_28,w_598,h_110/fill/w_834,h_154,al_c,lg_1,q_85,usm_1.20_1.00_0.01,enc_auto/smart%2520city%2520label_edited.png)
![smart%20city%20label_edited.png](https://static.wixstatic.com/media/3377f1_8edf4ba83ff6498e95eca912b412d504~mv2.png/v1/crop/x_62,y_28,w_598,h_110/fill/w_834,h_154,al_c,lg_1,q_85,usm_1.20_1.00_0.01,enc_auto/smart%2520city%2520label_edited.png)
Home
/
Smarthon Products
/
Smart City IoT Starter Kit /
Case 01: Automated Smart Playground Lamp
Goal
Create an automated smart playground lamp using motion sensor
Materials
- micro:bit X1
- Smarthon iot:bit X1
- LED Light X1
- Motion Sensor X1
- USB Cable X1
- Playground Cardboard Model X1
- Screws X2
- Nuts X2
![case1_completed.jpeg](https://static.wixstatic.com/media/3377f1_3475d91c80b244b397ba7158b86fadc9~mv2.jpeg/v1/fill/w_400,h_300,al_c,q_80,usm_1.20_1.00_0.01,enc_auto/case1_completed.jpeg)
Step 1
- Put together all the cardboard parts
- Attach the LED light to the top of the model
![case1_completed.jpeg](https://static.wixstatic.com/media/3377f1_3475d91c80b244b397ba7158b86fadc9~mv2.jpeg/v1/fill/w_400,h_300,al_c,q_80,usm_1.20_1.00_0.01,enc_auto/case1_completed.jpeg)
Step 2
- Connect Motion sensor to P0
- Connect LED light to P1
![case1_completed.jpeg](https://static.wixstatic.com/media/3377f1_3475d91c80b244b397ba7158b86fadc9~mv2.jpeg/v1/fill/w_100,h_75,al_c,q_80,usm_0.66_1.00_0.01,blur_2,enc_auto/case1_completed.jpeg)
Step 3
- Go to MakeCode page
- Click Advanced in the code block
- Click on Extensions
- Search https://github.com/SMARTHON/pxt-iot-bit and click “WiFi-IoT-bit”
![case1_completed.jpeg](https://static.wixstatic.com/media/3377f1_3475d91c80b244b397ba7158b86fadc9~mv2.jpeg/v1/fill/w_100,h_75,al_c,q_80,usm_0.66_1.00_0.01,blur_2,enc_auto/case1_completed.jpeg)
![case1_completed.jpeg](https://static.wixstatic.com/media/3377f1_3475d91c80b244b397ba7158b86fadc9~mv2.jpeg/v1/fill/w_100,h_75,al_c,q_80,usm_0.66_1.00_0.01,blur_2,enc_auto/case1_completed.jpeg)
Step 4
- The motion sensor will constantly check the value of the motion sensor. If someone is moving (motion sensor value >= 700), the LED will light for 10 seconds.
- Download code and transfer to micro:bit
- Insert micro:bit into WiFi IoT expansion board
![case1_completed.jpeg](https://static.wixstatic.com/media/3377f1_3475d91c80b244b397ba7158b86fadc9~mv2.jpeg/v1/fill/w_100,h_75,al_c,q_80,usm_0.66_1.00_0.01,blur_2,enc_auto/case1_completed.jpeg)
Well Done!
You have successfully built your very own smart lamp!