Wednesday, 24 July 2013

Monitor Temperatures on your phone with an Arduino

After using the Bluetooth link to connect to the Chronograph I thought I'd use it to remotely monitor some temperatures, mainly because my fridge was acting up.

I connected the BT interface to the Arduino (my own version), this is quite easy because you just connect the TX from the Arduino to the RX of the BT interface and the sketch just uses the serial.print command.  This means you can test it out on your PC using the serial console in the Arduino IDE.

For testing I just make a small sketch to continuously output two random temperatures.

long randNumber;
long randNumber1;
long randNumber2;
long randNumber3;

void setup() {
Serial.begin(57600);
randomSeed(analogRead(0));
}

void loop() {
randNumber = random(5, 20);
randNumber1 = random(1, 10);
randNumber2 = random(5, 20);
randNumber3 = random(1, 10);
Serial.print(randNumber);
Serial.print(".");
Serial.print(randNumber1);
Serial.print("A");
Serial.print(randNumber2);
Serial.print(".");
Serial.print(randNumber3);
//Serial.print("A");
delay(10000);

}
The sketch outputs two decimal values delimited by the 'A' character, you can use any I suppose.


Within the App there is a settings screen where you can set Farenheit, enable the raw data to be seen on the main screen and edit the two temperature labels to something more meaningful.

I think I'll need to add the ability to alter the rate at which the app checks for data, currently it is 5 seconds, half of the 10 second rate from the arduino

My real world transmitter uses low power and only transmits once every minute and sleeps in-between.

If the transmitter used mains power and was permanently awake then I could request a reading when the app connects

App can be downloaded here or QR code  

No comments:

 Time for another post. A while ago I bought a new Oscilloscope, a RIGOL DHO914, but this scope doesn't have WiFi built in just a LAN co...

Popular Posts