Indoor Temperature Monitor

Indoor Temperature Monitor is a simple DIY project based on Arduino, a .NET app that used to record and monitor indoor temperature. Since I have an old, unused Arduino Uno board, so I bought 1-wire digital temperature sensor (DS18B20) and made use of it for this project.

Software development

Indoor Temperature Monitor is a simple GUI app written in .NET C# and WPF. This application uses OxyPlot library to plot the graph that reads temperature values sent by Arduino board using serial port connection. The background color of the current temperature will automatically change based on a certain temperature range. The temperature reading will be logged into a CSV file for a certain interval of time.

IndoorTempMonitor - simple GUI app written .NET C# and WPF
IndoorTempMonitor - simple GUI app written .NET C# and WPF

Source Code on GitHub

Hardware development

Arduino board setup with DS18B20

Graphical representation for DS18B20 with Arduino Uno
Graphical representation for DS18B20 with Arduino Uno

Arduino code

Here’s the Arduino sketch, compiled with Arduino software v1.6.13:

#include <OneWire.h>
#include <DallasTemperature.h>

#define ONE_WIRE_BUS 2 /* Connect to Pin 2 */

/* Set up a oneWire instance to communicate with any OneWire device*/
OneWire ourWire(ONE_WIRE_BUS);

/* Tell Dallas Temperature Library to use oneWire Library */
DallasTemperature sensors(&ourWire);

void setup() /* SETUP: RUNS ONCE */
{

delay(1000);
Serial.begin(9600);
//Serial.println("Temperature Sensor: DS18B20");
delay(1000);

/* Start up the DallasTemperature library */
sensors.begin();

}


void loop() /* LOOP: RUNS CONSTANTLY */
{

//Serial.println();
//Serial.print("Requesting temperature...");
sensors.requestTemperatures(); // Send the command to get temperatures
//Serial.println("DONE");

//Serial.print("Device 1 (index 0) = ");
//Serial.print(sensors.getTempCByIndex(0));
Serial.println(sensors.getTempCByIndex(0));
//Serial.println(" Degrees C");
delay(1000);

}