When my wife and I had our first child last winter, we got an electric space heater to keep the area immediately around our baby girl nice and warm. As we moved from room to room, we brought the heater with us, all the while thinking we were being super efficient having point-of-use climate control. A month later we get an electricity bill twice our normal amount and realize it would have been cheaper to just heat the whole house with the gas furnace around the clock.
Winter is upon us again, so this time I upgraded to a WiFi thermostat so I can turn on the heater while I'm downstairs or warmly tucked under the covers. This is much more convenient, but we're still heating the whole house even though most of the time we're all in one part of the house.
Looking at our motion sensor logs that control our lighting, it's pretty obvious that we spend 4-5 hours downstairs as a family after work, and then go upstairs to our bedrooms around 9pm where we sleep until we leave the next morning for work. Weekends are a little different, but Monday through Friday works like clockwork (especially with a 10 month old on a strict sleep schedule).
I've looked at HVAC systems that have multi zone temperature monitoring and wirelessly controllable duct baffles, but the hardware is very expensive and all the software looks like it was an afterthought (with little support or updates as technology gets better). I already have some WiFi enabled temperature sensors in my house for point of use AC unit controllers and have been itching for a reason to use some small servos in a project. All I need are WiFi connected servos that can open/close duct vents in my HVAC system...should be easy enough.
MediaTek's new LinkIt Smart 7688 Duo HDK is a WiFi connected microprocessor running OpenWRT with an onboard arduino-compatible microcontroller. It's perfect for this project since it has all the I/O pins needed for multiple sensors and servo motors plus WiFi capability to communicate with my existing temperature sensors. Also, since it already has OpenWRT installed with uHTTPd, I can run the WebApp directly on the LinkIt Smart 7688 HDK for a completely self contained package.
That's it! When you select the"LinkIt Smart 7688 Duo"board in the Arduino IDE you can either push your sketch via serial like every other board, or you can upload over WiFi (this will come in very handy later). The Linkit Smart 7688getting started guide and developers guide may be helpful for you as well.
If you want to allow the microcontroller to use the WiFi directly in your arduino sketch (which we will be doing), you just ssh into the HDK and flip a bit to enable the Arduino Yun library compatibility.
You can just copy/paste the lines from here:
uci set yunbridge.config.disabled='0'
My WebApp runs on php, so I just used opkg package manager to get it installed since it's included in OpenWRT on the LinkIt Smart 7688:
opkg install php5-cgi
I then updated the /etc/config/uhttpd file to interpret php by adding this line:
and restarted uHTTPd
The temp sensors are just ATtiny85s or Arduino Nanos connected to a DHT11 or DHT22 and sending that temperature/humidity information to a web server via an ESP8266 over software serial. I have a full writeup on those sensors on heresince they were originally designed and developed as phase II of my point-of-use air conditioner project (this part is completely optional, but it will give you additional metrics that can be used to tune the system and eventually automate it).
The LinkIt Smart 7688 HDK itself is in my attic connected directly to the duct vents. On the OpenWRT side a cronjob updates the vent state text file. The MCU side running the arduino sketch checks this text file periodically and adjusts the vents accordingly.
# Open downstairs vent at 3pm on weekdays
0 15 * * 1-5 /bin/echo 1 > /www/vent.txt
# Open both vents at 6pm on weekdays
0 18 * * 1-5 /bin/echo 0 > /www/vent.txt;
# Close downstairs vent at 9pm on weekdays
0 21 * * 1-5 /bin/echo 2 > /www/vent.txt;
# Close upstairs vent at 9am on weekdays
0 9 * * 1-5 /bin/echo 1 > /www/vent.txt;
To check the status of the vents and manually reconfigure them, I created a small WebApp that is hosted directly on the LinkIt Smart 7688. With dyndns and port forwarding I can view and control all of this from outside the house if I need to.
I may one day add additional WiFi connected servos to vents in each room and have them all connect back to the single LinkIt Smart 7688.
Currently the temperature probes are only dumping the readings to a csv file so I can easily track and graph it. It would be nice to kick on the heater early if the house is particularly cold, but my WiFi thermostat doesn't have an API yet. I would also like to tie into my home automation system so the vents automatically adjust based on real time room occupancy derived from motion sensors rather than being entirely based on time of day (especially for weekends because of our dynamic schedules).