Lighting an LED using Radio communication between two Micro:bit boards

Micro:bit 26-06-23
481 0

Tutorial plan

1- Introduction to the Micro:bit Board Radio Module

2- Controlling an LED by radio communication from the Micro:bit board

3- The components needed to control an LED by Micro:bit

4- Mounting the Micro:bit board with an LED

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.

Controlling an LED by radio communication from the Micro:bit board

To control an LED 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- Connect an LED to one of the micro:bit's GPIO pins (for example, P0). Ensure to use a current-limiting resistor (e.g., 220-470 ohms) in series with the LED.

2- Open the Microsoft MakeCode editor.

3- Write the following code to send radio messages:

makecode-radio-sending

Download program

 

4- 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 an LED:

makecode-radio-reception

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), it will turn on the LED connected to P0 micro:bit (B).

whenever you press button B on the transmitter micro:bit (A), it will turn off the LED connected to P0 micro:bit (B).

 

The components needed to control an LED by Micro:bit

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

Micro:bit board

Micro:bit board

The Micro:bit is a small programmable development board with an ARM microcontroller. It has built-in LED indicators and GPIO (General Purpose Input/Output) pins that can be used to control external components like an LED.

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.

LED (Light Emitting Diode)

Red LED

Choose an LED of your preferred color. LEDs have two leads, a longer positive (anode) lead and a shorter negative (cathode) lead.

Resistor

Resistor

To limit the current flowing through the LED and protect it from excessive current, you will need a current-limiting resistor. The value of the resistor depends on the specific LED and the power supply voltage. A typical value is around 220-330 ohms, but you can calculate the exact value using Ohm's law.

Jumper wires

Jumper wires

You will need jumper wires to connect the Micro:bit to the LED 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 LED as needed. Be sure to follow good connection and safety practices when handling electronic components.

Mounting the Micro:bit board with an LED

To mount an LED with the Micro:bit board, you can follow these steps:

1- Connect the LED and resistor: Insert one leg of the resistor into the positive leg of the LED (anode, usually the longer leg), and connect the other leg of the resistor to pin P0 on the Micro:bit board . Next, connect the negative leg of the LED (cathode, usually the shorter leg) to ground (GND) on the Micro:bit board.

2- Connect the resistor to the P0 pin: Connect the other end of the resistor to the P0 pin of the Micro:bit board.

Mounting the Micro:bit board with an LED

Mounting the Micro:bit board with an LED

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