Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
DIY home thermostatDIY home thermostat
with Arduino YUNwith Arduino YUN
and DHT22and DHT22
Marian Marinov <mm@yuhu.biz>
The Problem...
Hardware
Software
- Arduino bridge
https://www.arduino.cc/en/Reference/YunBridgeLibrary
- DHT-sensor-library
https://github.com/ada...
Connect and test the DHT22
Modify the arduino bridge sketch
111 if (pin == 8) {
112 h = dht.readHumidity();
113 t = dht.readTemperature();
114 if (is...
Prepare the YUN
● Install the missing software
– opkg install bash bc git
● Create the holding dir
– mkdir -p /www/t/js
● ...
Setup
● temp.sh
● add the cron job
● temp.sh collects the temp and stores it in
out_stats.js
● temp.sh also rotates old da...
...Demo Time......Demo Time...
DIY home thermostat with Arduino YUN
DIY home thermostat with Arduino YUN
Upcoming SlideShare
Loading in …5
×

DIY home thermostat with Arduino YUN

1,659 views

Published on

How to create internet enabled thermostat with Arduino and DHT22

The code is here: https://github.com/hackman/home-thermostat

Published in: Engineering
  • Be the first to comment

DIY home thermostat with Arduino YUN

  1. 1. DIY home thermostatDIY home thermostat with Arduino YUNwith Arduino YUN and DHT22and DHT22 Marian Marinov <mm@yuhu.biz>
  2. 2. The Problem...
  3. 3. Hardware
  4. 4. Software - Arduino bridge https://www.arduino.cc/en/Reference/YunBridgeLibrary - DHT-sensor-library https://github.com/adafruit/DHT-sensor-library - jQuery https://jquery.com/ - CanvasJS http://canvasjs.com/ - Bash and bc
  5. 5. Connect and test the DHT22
  6. 6. Modify the arduino bridge sketch 111 if (pin == 8) { 112 h = dht.readHumidity(); 113 t = dht.readTemperature(); 114 if (isnan(h) || isnan(t)) { 115 client.println("Failed to read from the DHT sensor!"); 116 return; 117 } 118 client.print("Temperature: "); 119 client.print(t); 120 client.print("C Humidity: "); 121 client.println(h); 122 return; 123 }
  7. 7. Prepare the YUN ● Install the missing software – opkg install bash bc git ● Create the holding dir – mkdir -p /www/t/js ● Download the js libs itno /www/t/js ● git clone https://github.com/hackman/home-thermostat
  8. 8. Setup ● temp.sh ● add the cron job ● temp.sh collects the temp and stores it in out_stats.js ● temp.sh also rotates old data into log_stats.js ● Ajax request from t.html to change.sh turns the system on for at least 30min ● Ajax request from t.html to temp_logs.sh list the last actions
  9. 9. ...Demo Time......Demo Time...

×