You will find the necessary programs in this tutorial :
https://www.robotique.site/tutorial/t...
To transmit a message from a smartphone to an Arduino Uno via Bluetooth, you'll need to follow these general steps:
1- Get the Required Hardware:
Arduino Uno board
HC-06 Bluetooth module
Smartphone with Bluetooth capability
2- Connect HC-06 Bluetooth Module to Arduino:
Connect the TX pin of the Bluetooth module to the RX pin of the Arduino Uno.
Connect the RX pin of the Bluetooth module to the TX pin of the Arduino Uno.
Connect the VCC and GND pins of the Bluetooth module to the 5V and GND pins on the Arduino Uno.
3- Upload Code to Arduino:
Write a simple Arduino sketch to read data from the Serial port.
4- Pair Bluetooth Module with Smartphone:
Enable Bluetooth on your smartphone.
Pair the smartphone with the Bluetooth module. The default Bluetooth module's PIN might be '1234' or '0000'.
5- Write a Bluetooth App (on Smartphone):
You can use various platforms to create a simple app for sending data over Bluetooth. For Android, you might use the App Inventor platform.
Use Bluetooth APIs to establish a connection with the paired Bluetooth module and send data.
Program Arduino UNO to receive a message from the Smartphone
Write a simple Arduino sketch to read data from the Serial port.
This program allows Arduino UNO to :
connect to Smartphone
receive the message from the Smartphone
display the message in the serial monitor of Arduino IDE
Develop a mobile application to send a message to 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 text fields to write a message.
Add button to sen the message to Arduino
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 send message from Smartphone to Arduino via Bluetooth
Testing :
1- Upload the MicroPython code to Arduino.
2- Install and launch the app created with App Inventor on your smartphone.
3- Connect to Arduino from the mobile app.
4- Check that the message is sent to the Arduino