Introduction: Getting Sensor Reading on Your Smartphone Using Arduino and Bluetooth.
Hey, guys, today I will be showing you how to get readings from sensors connected to Arduino on your smartphone.What we will do is we will write code to display all the values coming from sensor to Bluetooth module and using an app we will be able to see those value.
Materials required
- Arduino
- Bluetooth Module (HC-05 or HC-06)
- Female to female jumper wires
- Male to Male wires
- Male to female wires
- Any sensor(I am using moisture sensor)Breadboard
Step 1: Connecting the Bluetooth Module
- VCC of HC-05 to 5V Arduino(The 5v should be connected to breadboard so that sensor can also get power)
- TX HC-05 to Arduino Pin 10 (RX)
- RX HC-05 to Arduino Pin 11 (TX)
- Important: HC-05 RX ist not connected to Arduino RX and vice versa.
Step 2: Wiring Moisture Sensor
- 5V/VCC to Arduino Pin 5V
- GND to GND Arduino
- A0 Pin to A0 Pin of Arduino
Step 3: Code
Copy and upload the following code to your Arduino.
#include
SoftwareSerial BTserial(10, 11); // RX | TX int sensorPin = A0; int sensorValue = analogRead(sensorPin); void setup() { BTserial.begin(9600); } void loop() { sensorValue = analogRead(sensorPin); BTserial.print(sensorValue); BTserial.print(";"); //message to the receiving device delay(20); }
Step 4: Go to Play Store and Download Any of the Following Apps
Feel free to do some experiments! Please, let me know if something is not explained precisely enough!