Example Code for micro:bit-Smart Streetlight

At night, when people walk under the streetlight, the sound sensor detects the sound and the LED lights up for a while and then turns off.

Hardware Preparation

BOS0004 BOS0017
BOS0009 Sound Sensor BOS0004 Ambient Light Sensor BOS0017 LED Module
BOS0029 BOS0027 BOS0031
BOS0029 Logic "Not" Module BOS0027 Logic "And" Module BOS0031 Duration Module(0 to 6 second)
Mainboard micro:bit microbit expansion board
BOS0035 Mainboard-3IO MBT0039 micro:bit BOS0040 micro:bit BOSON Expansion Board

Software Preparation

Supports graphical programming platforms such as MakeCode, and Mind+.

Wiring Diagram

Non-programming Project

Connection Diagram:

Programming Project

Connection Diagram:

Connection 2-2

Other Preparation Work

Tip: micro:bit and its expansion board will be used in programming projects.

Result

Video Demo

Non-programming Programming
Streetlight-1 Streetlight2

Additional Information

Program Flowchart:

Flowchart 2

Was this article helpful?

TOP