$USD
  • EUR€
  • £GBP
  • $USD
PROJECTS micro:bit

micro:bit Project 11: Remote Doorbell

DFRobot Oct 17 2018 1142

For those who have a doorbell in their homes, it may be quite a common issue that sometimes the ring is not loud enough to travel over rooms. To solve this problem, a wireless indicator may be helpful. In the chapter, we will learn how to make the doorbell to control a remote LED that we can carry around.

Component list

micro:bit
Boson Expansion board
1× LED module
1× motion sensor module
1× knob module 
1× USB cable

Connection

We will need two micro:bit in this project, one is attached to the door bell and sends out message (transmitting end), the other receives the signal and controls the LED indicator (receiving end). The micro:bits communicates over radio.


Connection diagram of micro:bit transmitter:

Connection diagram of micro: bit receiver:

Program

Task1: program for the transmitter

STEP1: We have been quite familiar with the button module and the motion sensor, however, how can we send out their status through over the radio? To achieve this, we will learn how exactly the radio works in the following session.

The "Radio" function can be found on the left side of the MakeCode window. .


We need to first understand the following 3 most commonly used functions under “Radio”:
set group:

Function description: There are a total of 255 different radio channels. The transmitter and the receiver should be set in the same group to communicate. send out number:

Function description: send out a number over radio. on radio received:

Function description: Upon a number is received, it will execute the program inside the “on radio received” loop.
We will also need to program the receiver to make the corresponding reaction based on the received number.
Notice: the variable "receivedNumber" inside the “on radio received” function represents the received number.

STEP2: After knowing how to use the radio function, it is the time to use input modules to trigger the radio signal. To make it a bit more challenging, we will try to program the micro:bit send out a message when someone rings the bell, and send out another message when there is just someone passing by. To achieve this, we will need the button module and a motion sensor. The flow chart below gives you an idea of how to write the program.

STEP3: Put the function blocks together. The complete program will be look like as following.


Task2: program the receiver

STEP1: The receiver is able to execute different action based on the received signal. The flow chart below will help you in building the program. 

STEP3: Put the function blocks together. The complete program will be look like as following.

Exercise

Add a “Please wait” notice to the doorbell when someone rings the bell.


REVIEW