SEND ANALOG DATA VIA BLUETOOTH

Bluetooth analog

/*

This bluetooth module is basically useful for sending data displayed on serial monitors to clients or pairs. Data from Arduino is sent via RX and TX pins. For example we will send data on pin A0

First we first remove the TX and RX pin from Arduino, then we upload the code above, then we connect the cable to the RX and TX Arduino pins again, then the data has been transmitted via Bluetooth.

To read data via bluetooth, we need a computer that can access Bluetooth signals. If we use Windows 10, activate Bluetooth by clicking the Bluetooth icon on the task bar —> Show Bluetooth Devises, then on the Manage Bluetooth devices display HC-05 will appear, click then do a pair, a password will be asked, fill in 1234 as a password, then Bluetooth is ready to be accessed. We can do how to access data sent via bluetooth by opening the Arduino IDE version 1.6.xx. Point the port to the port used by bluetooth, then open the serial monitor, then the data sent via bluetooth will be displayed.
Another way to access data via Bluetooth is with Tera Term software, we can download it for free. After we install we open the connection menu will appear, select serial and select the port that is used bluetooth, then the data will be displayed. The advantages of this Term Tera we can store data displayed by means of log data into a notepad file.

*/

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);

// print out the value you read:

Serial.println(sensorValue);

delay(1); // delay in between reads for stability

}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s