1- How connect Arduino UNO to Smartphone ?
Arduino boards can communicate over Bluetooth using specific Bluetooth modules or built-in Bluetooth capabilities.
Many Arduino boards don’t have built-in Bluetooth but can add Bluetooth functionality using external modules like: HC-06: Classic Bluetooth modules for simple serial communication (e.g., sending/receiving text data).
How It Works:
Wiring: The module connects to the Arduino's serial communication pins (TX, RX) or via a software serial library for flexibility.
Programming: The Arduino is programmed to send or receive data via the serial port, which the Bluetooth module then transmits wirelessly.
Pairing: Devices like smartphones or laptops pair with the module as a Bluetooth device.
Common Applications
Remote Control: Use a smartphone app to control a robot or LED system.
Data Logging: Send sensor data to a mobile device or PC.
IoT Projects: Communicate between Bluetooth-enabled Arduinos or integrate with IoT platforms.
Connecting an Arduino UNO to a smartphone using the HC-06 Bluetooth module and creating a custom app in MIT App Inventor is a great project! Here’s a step-by-step guide:
Arduino UNO
It acts as the central processor, receiving data from the HC-06 module, processing commands, and sending output to the LCD display.
HC-06 Bluetooth module
A classic Bluetooth module (not BLE) used for serial communication. It operates as a slave device, meaning it waits for a connection from a master (e.g., a smartphone).
It provides wireless communication between the Arduino and the smartphone.
It sends/receives data wirelessly via Bluetooth.
Smartphone
It serves as the master device, sending commands to the HC-06 and receiving data from the Arduino.
LCD I2C 16x2 Display
It displays messages sent from the smartphone via the HC-06 module or system status (e.g., connection confirmation).
Jumper wires
It connects the Arduino and HC-06 module.
Breadboard (optional)
It is a reusable platform for building and testing circuits without soldering.
HC-06 Connections:
VCC → Arduino 5V
GND → Arduino GND
TXD (HC-06) → Arduino RX (Pin 2)
RXD (HC-06) → Arduino TX (Pin 3)
I2C 16x2 LCD Display Connections:
The I2C LCD display requires only two wires for data communication:
SDA → Arduino A4
SCL → Arduino A5
VCC → Arduino 5V
GND → Arduino GND
The following code uses LiquidCrystal_I2C
library to communicate with the I2C LCD and handle Bluetooth data from the HC-06.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
#include <SoftwareSerial.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27, 20, 4); SoftwareSerial hc06(2,3); String message=""; void setup(){ lcd.init(); hc06.begin(9600); } void loop(){ lcd.backlight(); lcd.setCursor(0, 0); //Write data from HC06 to Serial Monitor if (hc06.available()){ message+=char(hc06.read()); lcd.clear(); lcd.print(message); //Display the message on the LCD display} else message=""; } |
1- Go to MIT App Inventor and create a new project.
2- Drag the following components from the Palette:
ListPicker: For selecting the Bluetooth device .
Label: To display connection status
BluetoothClient: A non-visible component for managing Bluetooth communication.
We propose to create the design of the application, with the following visual:
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
Download projectDownload application
How It Works :
1- Power the Arduino and connect the HC-06 module to the smartphone.
2- Open the app, click "Select Device," and pair with the HC-06 module.
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.
Zaouiet Kontech-Jemmel-Monastir-Tunisia
+216 92 886 231
medaliprof@gmail.com
Robotic site created by MedAli-Teacher info