Radio Project
We created a radio to send and receive messages between two micro:bits. We also used radio to sense how close another micro:bit is. One micro:bit is the seeker while another serves as the beacon.
Supplies
- 2 micro:bits
- MakeCode or Python editor
- battery pack
Radio Group
We set the radio group to 143 and all the players use the same group. The micro:bit transmits its serial number so that players can tell one beacon apart from another. Also, we reduced the power of the antenna to shorten the range of transmission on the beacon's code.
Where R U?
- Seeker presses on button A to send a string "Where r u?" and a sad face icon.
- Beacon receives both string and icon.
Find Me!
Beacon replies to the message by pressing button A that sends the string "Find me!" and a sad face icon.
Beacon Sends a Signal
Beacon presses on button B and broadcasts number 0, ten times. A beat plays while a heart beat is shown on the beacon's LED display.
Seeker Receives Signal
- The seeker receives the message, it stores the strength of the signal in a variable called signal and shows it on its LED display.
- Radio signals get stronger the closer you are to the transmitter, so if the signal is strong it means the other micro:bit is probably close.
- It displays a bar graph which gets bigger the stronger the signal and the closer you are. It uses the maths map block to map radio signal strength numbers from the range -95 (weak) to -42 (strong) to a range 0 to 9 we can use to draw a bar graph.
The Code
The Draft
This is the design brief for this project. It includes pre-programming strategies of the radio setup.
Reflection
REFLECTION
Radio Signal Project: A Microbit Communication System
By Regina Sevilla and Joel Sevilla
For this assignment, we undertook the Radio Signal Project, which leverages two Microbits to create a wireless communication system. This project was chosen for its use of multiple devices and the opportunity to explore radio communication. Each Microbit was coded to send and receive messages via radio function, with one Microbit programmed to transmit a signal upon button press and the second set up to receive the signal and respond, such as by activating an LED or displaying a message on its screen.
While no physical external components were used, the project relied heavily on the radio communication feature, which extends the Microbits' standalone capabilities. A significant achievement was successfully synchronizing communication between the two Microbits. To align the timing and signal strength properly was a challenge but quite rewarding when it results in a more consistent data transmission. We used the following coding blocks: radio to send and receive a number, string, logic blocks, trigger or input blocks, loops, plot bar graph and created variables.
Ensuring reliable communication between Microbits proved difficult, particularly when faced with incorrect timing, incorrect code, signal interference and range limitations. This was addressed by refining the code and adding delays to allow sufficient time for signal transmission and reception. Since the project used radio signals, the simulator was not sufficient to model, test and debug coding tasks. We had to write the code and constantly download to the real micro:bits and test them side by side. During in-person evaluation, peers suggested enhancing user interaction through clearer visual feedback. In response, the prototype was improved to display a text message and to plot a bar graph on the receiving Microbit upon successful signal transmission.
While the project was implemented using block-based programming, using Python could have offered greater code complexity, enhanced debugging capabilities, access to more libraries and functions, improved error handling, and potentially more efficient radio communication management. On the other hand, the simplicity of block-based programming allowed for a focus on core concepts without syntax complications. In addition, the previous reading assignments gave us an idea about what Python is. However, we have not learned yet how to actually code using Python.
This project provided valuable experience in wireless communication systems, emphasizing the importance of synchronization, error handling, and user feedback in device-to-device interactions. It demonstrated the potential of Microbits for creating simple yet effective communication systems.