--> Project II - 25. Arduino PIN Monitoring using Android | basic arduino tutorial

Tuesday, August 8, 2017

Project II - 25. Arduino PIN Monitoring using Android

| Tuesday, August 8, 2017
Arduino PIN Monitoring using Android





Reading logic data on digital pins from pins 2 to 13 and Analog data from A0 to A5 on Arduino UNO. The results are transfered  and displayed on the Android app by Bluetooth connection . Android application used Bluetooth Electronics, the application is in playstore but we also provide on Download link on the end of this page.

Hardware Requirement
  • HC-05 Bluetooth Module
  • Arduino UNO
  • Power supply +5 Volt

HC-05 Bluetooth Module | Source



Block Diagram


Schematic

Arduino - HC-05 Bluetooth Module Wiring




Source Code/Sketch


String colors[]={"R0G0B0","R0G150B0"}; //Warna LED LOW dan HIGH pada Android
String receive_chars="abcdefghijkl";
float voltage;
void setup() {
//Inisialisasi pin 2 s/d 13 sbg digital input
for(int i=2;i<=13;i++) pinMode(i, INPUT);
//Inisialisasi Serial untuk modul bluetooth
Serial.begin(9600);
}
void loop() {
//baca pin digital kemudian datanya dikirim via serial
for(int i=2;i<=13;i++){
Serial.print("*"+String(receive_chars.charAt(i-2))+colors[digitalRead(i)]+"*");
}
//baca data analog untuk dikirim serial dg tampilan grafik pd Android
Serial.print("*G"); //karakter 'G' sebagai penanda data grafik yg dikirim
for(int i=0;i<=5;i++){
voltage=analogRead(i)*0.0048828;
Serial.print(String(voltage)+",");
}
Serial.print("*");
delay(100);
}

How it Works
1. Connect the Arduino with Peripherals needed
2. Plug in the Power Source on the device
3. Compile and upload the script program above to your arduino
4. Open the Android Bluetooth Electronic and select Connect tab on your device


5. Tap Discover button on the top - left corner an then Pair >> Connect > done


6. But, if your bluetooth module can not be read or can not be detect, try to connect with manual 
    setting on default setting of your android device and use 1234 as the password. Look at the image 
    below

7. After yout modul has been connected, select the Uno Monitor tap, then tap
    the run button.


8. That's all



The data sent is data that match the condition of Arduino UNO pin. Because the digital pin condition there is no input and without pull up internally then pin 2 s / d 13 floating logic (floating) on the pin is logically uncertain, sometimes HIGH or LOW. While in Analog data is also the same, that its value is not stable because there is no incoming analog data (no input). If you want to give inputs on pins 2 to 13 you can create a circuit like this:




Video for Project II - 25. Arduino PIN Monitoring using Android





Download required file

Related Posts

No comments:

Post a Comment