Lighting a lamp using Radio communication between two Micro:bits

Micro:bit 14-11-23
107 0

Tutorial plan

1- Introduction to the Micro:bit Board Radio Module

2- The components needed to control a lamp by Micro:bit

3- Mounting the Micro:bit board with a lamp

4- Turn on a lamp by radio communication from two Micro:bit boards

 

 

Introduction to the Micro:bit Board Radio Module

The BBC micro:bit is a pocket-sized computer board designed for educational purposes. It has a built-in radio module that allows micro:bit boards to communicate with each other wirelessly. The radio module on the micro:bit uses Bluetooth Low Energy (BLE) technology, which enables short-range communication between devices.

The radio module on the micro:bit board allows for wireless communication and data transfer. It operates on the 2.4 GHz frequency band and supports a range of up to 30 meters (or about 100 feet) in an open space environment. The micro:bit radio module can be used for various applications, such as creating interactive games, sending messages between devices, or building remote-controlled projects.

To use the radio module on the micro:bit, you can program it using the micro:bit’s programming environments, such as the Microsoft MakeCode editor or the MicroPython programming language. These environments provide blocks or functions specifically designed to control the radio module and enable communication between micro:bit boards.

By utilizing the radio module, you can establish a communication link between multiple micro:bit boards, allowing them to exchange data, coordinate actions, or create collaborative projects. It’s a powerful feature that adds interactivity and connectivity to your micro:bit projects.

The components needed to control the lamp by Micro:bit

To control the lamp using a Micro:bit, you will need the following components:

Two Micro:bit boards

Micro:bit board

The micro:bit is a small, programmable microcontroller board designed by the BBC in the UK to encourage kids to learn coding and electronics. It has various built-in features like an LED display, buttons, sensors (accelerometer and magnetometer), Bluetooth connectivity, and GPIO (General Purpose Input/Output) pins. The board can be programmed using various programming languages including JavaScript, Python, Scratch, and more, making it versatile for educational purposes and hobbyist projects.

The GPIO expansion card for the Micro:bit card

The GPIO expansion card for the Micro:bit card

The GPIO expansion board for the Micro:bit board expands the capabilities of the Micro:bit board by adding more input/output (GPIO) pins and additional functionality.

Relay Module:

You’ll need a relay module that is compatible with the Micro:bit and can switch the high-voltage lamp. Ensure it’s rated for the voltage and current required for your lamp.

Lamp (220V):

The lamp you want to control, which is rated for 220V. Ensure it’s in working condition and safe to use.

Power Supply for the Lamp:

You’ll need a power source for the lamp, typically a 220V AC power supply.

Wiring:

Various wires and cables for connecting the components in your circuit.

Jumper wires

Jumper wires

You will need jumper wires to connect the Micro:bit to the relay and the current-limiting resistor. Make sure you choose the appropriate type of jumper wires (e.g., male-to-male, male-to-female, or female-to-female) based on your specific setup.

Test plate

Test plate
The breadboard is a common tool used in robotics and electronics to create circuit prototypes and temporary connections. It makes it easy to test and connect electronic components together without having to solder the connections.

Once you have gathered these components, you can properly connect them and program the Micro:bit board to control the relay as needed. Be sure to follow good connection and safety practices when handling electronic components.

Mounting the Micro:bit board with a lamp

To control a lamp using a Micro:bit board, you will need to use a relay module to safely interface the low-voltage Micro:bit with the high-voltage lamp. Here are the step-by-step instructions to set up the Micro:bit with a lamp:

1- Safety First: Ensure the lamp is disconnected from any power source before proceeding.

2- Connect the Relay to the Micro:bit:

– Connect the relay’s control pin (S) to pin P0 of Micro:bit board

– Connect the pin (+) of relay to pin 3.3V of Micro:bit board.

– Connect the relay’s ground pin (GND) to the Micro:bit’s GND.

3- Connect the Lamp and the power supply to the Relay:

– Connect one of the lamp’s wires to the relay’s common (COM) terminal.

– Connect the phase (live) wire of the power supply to the normally open (NO) terminal of the relay.

– Connect the neutral wire of the power supply directly to the neutral wire of the lamp.

Mounting the Micro:bit board with a lamp

Mounting the Micro:bit board with a lamp

Turn on a lamp by radio communication from the Micro:bit board

To control a lamp using radio communication from one micro:bit board to another, you’ll need two micro:bit boards—one acting as a transmitter and the other as a receiver. Here’s a step-by-step guide on how to accomplish this:

Transmitter (Micro:bit A):

1- Open the Microsoft MakeCode editor.

2- Write the following code to send radio messages:

makecode-radio-sending

Download program

 

3- Download the code to the micro:bit (A) and disconnect it from the computer.

Receiver (Micro:bit B):

1- Connect another micro:bit board to your computer and open the programming environment.

2- Write the following code to receive radio messages and control the lamp:

Download program

 

3- Download the code to the micro:bit (B) and disconnect it from the computer.

Now, whenever you press button A on the transmitter micro:bit (A), the receiver micro;bit will turn on the lamp.

whenever you press button B on the transmitter micro:bit (A), the receiver micro;bit will turn off the lamp.

0 comment

Leave a comment

Veuillez noter s'il vous plaît*

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Purpose of this website

Educational robotics refers to the use of robots and robotics technology to promote learning in educational settings. It involves the integration of technology, engineering, and computer science into the classroom, allowing students to engage in hands-on, project-based learning experiences.
In this context, our website represents an excellent resource for parents, teachers and children who wish to discover robotics.

Contact details

Zaouiet Kontech-Jemmel-Monastir-Tunisia

+216 92 886 231

medaliprof@gmail.com

Pictures of the articles

Robotic site created by MedAli-Teacher info