i want to send the data to a bluetooth device

/* ReadAnalogVoltage Reads an analog input on pin 0, converts it to voltage, and prints the result to the serial monitor. Graphical representation is available using serial plotter (Tools > Serial Plotter menu) Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.

This example code is in the public domain. */

// the setup routine runs once when you press reset: void setup() { // initialize serial communication at 9600 bits per second: Serial.begin(9600); }

// the loop routine runs over and over again forever: void loop() { // read the input on analog pin 0: int sensorValue = analogRead(A0); // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V): float voltage = sensorValue * (5.0 / 1024.0);

// print out the value you read: Serial.println(voltage); delay(10000); }

I want to display the output on android phone using hc-05. I am new to coding just trying to figure out things . Would anyone help me

BlueTooth-HC05-HC06-Modules-How-To to get you started.

Note that a HC05 bluetooth module can act as either master or slave but a HC06 can only act as a slave.


Bluetooth is simpler than you think. A lot of the exercise with bluetooth is procedure, not code. In the immortal words of one of the more succinct participants on this forum, bluetooth is just "serial without wires".

Does the code you post work on the serial monitor? If so, it will do what you want with bluetooth without any modification. Essentially you disconnect serial monitor, plug bluetooth in, connect using your phone, and read the data.

You might find the following background notes useful

http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf http://homepages.ihug.com.au/~npyner/Arduino/BT_2_WAY.ino

I use Bluetooth Graphics Terminal for a three-channel live graphic display on the phone with 1 sec update. Another one is BlueGraph, which was done by somebody on this forum.

If you want a step-by-step example project then follow my very simple videos #36 & #37 Control your Arduino from your phone - HC06 Bluetooth module which if you complete will arm you for the project you have in mind.

URL in the footer of this post.

Just suggestin' :)