Bluetooth connection between Micro:bit and Smartphone

Micro:bit 18-01-25
37 0

Tutorial plan

1- The Micro:bit board and Bluetooth

2- Relationship between Micro:bit and App Inventor

3- Program the Micro:bit board to connect to the Smartphone

4- Develop mobile application to connect Smartphone to Micro:bit

 

 

The Micro:bit board and Bluetooth

The BBC micro:bit is a small, programmable microcontroller board designed for educational purposes. It comes equipped with Bluetooth Low Energy (BLE), which allows it to communicate wirelessly with other devices, such as smartphones, tablets, or other micro:bit boards.

Using Bluetooth on the micro:bit

1. Pairing a micro:bit

Hold down button A and button B, then press the reset button.

Release the reset button while holding the other two.

Follow the displayed instructions to pair using a smartphone or computer.

2. Programming Bluetooth

Use a programming platform like Microsoft MakeCode, Python, or Scratch.

Enable the Bluetooth package in MakeCode or the microbit module in Python for Bluetooth functionalities.

 

Relationship between Micro:bit and App Inventor

The relationship between the BBC micro:bit and MIT App Inventor lies in their ability to work together to create interactive systems that combine hardware and software. By leveraging the micro:bit's sensors and outputs and App Inventor's ability to build Android apps, users can design and implement creative projects that bridge physical computing with mobile app development.

How They Work Together

1. Micro:bit as the Hardware Interface

Equipped with sensors (accelerometer, compass, temperature) and outputs (LEDs, GPIO pins).

Acts as the "hands and eyes" of the system.

2. App Inventor as the User Interface

Provides the front-end for user interaction via an Android app.

Acts as the "brain" for processing and visualizing data or controlling the micro:bit.

3. Wireless Communication via BLE

Bridges the gap between the micro:bit and App Inventor apps.

BLE services like UART enable smooth data exchange for real-time interaction.

 

Program the Micro:bit board to connect to the Smartphone

To program the Micro:bit to connect to Smartphone via Bluetooth using MakeCode, follow these steps:

1-Go to the MakeCode website (makecode.microbit.org).

2- Click on "New Project" to start.

3- Add Bluetooth Extension:

Click on the "Extensions" option in the bottom left corner.

Search and add the "Bluetooth" extension by clicking on it.

4- Add the code blocs :

Download program

 

Develop mobile application to connect Smartphone to Micro:bit

1- Open MIT App Inventor.

2- Create a new project.

3- Go to the Palette and add the following components:

- BluetoothClient (under Connectivity)

- User interface elements like Buttons, TextBoxes, or Labels.

3- Click on the "Blocks" tab to switch to the Blocks Editor.

- Starting with Android 12, Bluetooth permissions have been enhanced to improve security and user data protection. This is why we must declare the authorizations that your application needs in the AndroidManifest.xml file. For Bluetooth, you'll need to include ACCESS_FINE_LOCATION, BLUETOOTH_SCAN, and possibly BLUETOOTH_CONNECT permissions, depending on the features you're using.

2- Use these programming blocks to connect the smartphone to the Micro:bit board via Bluetooth:

Download project Download application

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