Using Arduino UNO to Transmit data to Smartphone via Bluetooth

Arduino UNO 07-11-24
12 0

Tutorial plan

1- Components Needed to send message from Arduino to Smartphone

2- Wiring the Components

3- Program Arduino UNO  to send message to Smartphone via Bluetooth

4- Develop a mobile application to receive  message from Arduino UNO

 

 

The Arduino Uno paired with a Bluetooth module like the HC-05 or HC-06 allows for wireless communication with other Bluetooth-enabled devices such as smartphones, computers, or other Arduinos.

To send a message from an Arduino Uno to a smartphone via Bluetooth using the HC-06 module and a push button, and to create a custom app using MIT App Inventor to receive the message, follow these steps:

 

Components Needed to send message from Arduino to Smartphone

Arduino UNO :

Arduino Uno

The Arduino Uno board is a microcontroller board based on the ATmega328P microcontroller. It's one of the most popular and widely used boards in the Arduino family due to its simplicity and versatility.

It is the central control unit for your project.

HC-06 module bluetooth

HC-06 Bluetooth Module

The HC-06 Bluetooth module is a commonly used serial communication module that enables Bluetooth connectivity for various projects, including Arduino-based systems. It acts as a serial port Bluetooth module, allowing wireless communication between devices.

This module is used for sending data from Arduino UNO ro Smartphone via Bluetooth.

Push button:

The push button is a simple input device that sends a signal to the Arduino when pressed. The Arduino detects button sends message to Smartphone.

Jumper Wires:

Jumper wires

For making temporary connections and wiring between components.

Breadboard:

Test plate

A breadboard is a useful tool for creating temporary electronic circuits. It allows you to connect components without soldering.

 

Wiring the Components

1- Connect the HC-06 Bluetooth Module to the Arduino:

HC-06 VCC to Arduino 5V

HC-06 GND to Arduino GND

HC-06 TX to Arduino digital Pin 2

HC-06 RX to Arduino digital Pin 3

2- Connect the Push Button to the Arduino:

Connect one side of the button to Arduino analogic A0

Connect the other side of the button to GND

 

Program Arduino UNO  to send message to Smartphone via Bluetooth

The following code sends a message over Bluetooth when the button is pressed:

 

Develop a mobile application to receive  message from Arduino UNO

1- Create the designer of mobile app with App Inventor.

- Use the available Bluetooth components to establish a connection with the Arduino.

- Add button to connect Arduino to HC-06 module Bluetooth

- Add button to disconnect Arduino from HC-06 module Bluetooth

- Add label field to display the message sended from Arduino UNO.

Here is the Designer part of the application with App Inventor :

2. Programming the application with App Inventor:

1- 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- Add the the necessary blocks to connect the smartphone to the HC-06 Bluetooth module

3- Use these programming blocks to receive data from Arduino UNO via Bluetooth

Download projectDownload application

 

Testing :

1- Upload the Code to the Arduino. Reconnect the TX and RX pins to the HC-06 once the upload is complete.

2- Pair the HC-06 with Your Smartphone:

- Enable Bluetooth on your phone.

- Find and pair with the HC-06

3- Open Your Custom App:

- Press the “Select Bluetooth Device” button and choose the HC-06.

- Once connected, press the button on the Arduino circuit.

4- Each button press should send the message “Hi my name is Arduino board” to the app, which will display it in the Label.

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