There is a new version of the Climaduino and the Climaduino Controller with some very significant changes.

  • Supports multiple zones
  • Uses the Arduino Yún
  • Works with Central A/C
  • Communicates using the MQTT protocol (can integrate with other systems besides the Climaduino Controller)
  • Does not have an LCD or temperature setting buttons (they will need to be added back at some point)

For more information, visit the develop branch of both projects Git in the git repo:


Not everyone lives somewhere with central air, or is willing to pay for a Nest or similar "smart" thermostat. The Climaduino is a DIY Arduino-based thermostat designed to control a wall unit A/C. I incorporated both temperature and humidity sensors in order to optimize comfort and reduce energy usage. I then developed a Raspberry Pi-based web interface to control the Climaduino from my phone.

This is still a work in progress, but is definitely functional. I am posting this instructable so others can both build their own smart thermostats, and hopefully build on this project with their Climaduino improvements.

Here are the features so far:

Climaduino thermostat

  • Arduino-based
  • temperature and humidity sensors
  • Relay to control A/C
  • LCD Display
  • Buttons to control temperature
  • Controls both temperature and humidity
  • Settings stored in EEPROM and survive power failures
  • Short cycle protection for efficiency and compressor protection

Climaduino Controller

  • Raspberry Pi-based
  • Wifi-enabled
  • Mobile-optimized web interface to control Climaduino settings
  • Historical temperature and humidity graphs
  • Programmable temperature and humidity changes

Why did I want to build this? Mainly because it was fun to do and I've always been very interested in climate control. (I know that sounds weird, but it's true.) It's also because humidity is a huge issue in my area, South Florida. I designed the Climaduino Thermostat to take this into account. The A/C will stay on just a little bit longer when it's humid to wring more moisture out of the air. I also added a humidity control mode. It can save a significant amount of power and prevent coming home to a mold-infested house. Humidity control mode ignores temperature and only runs the A/C when things get too humid. It's useful when going out of town or when the house is empty (of people and pets).

Obligatory warning
If you perform any of the steps in this instructable, you assume all risk for the outcome. Working with high voltage can be extremely dangerous. Improperly altering your A/C unit could lead it to malfunction or completely break. Please be careful.

Electrical Safety: Safety and Health for Electrical Trades Student Manual

Step 1: Supplies

The following will be needed to complete this project.

Climaduino Thermostat

  • 1 x Arduino - I'm using an Arduino Uno
  • 1 x Solderless breadboard
  • 2 x buttons - momentary on (optional)
  • 1 x DHT22 temperature and humidity sensor
  • 1 x LCD display (optional) - Not sure of the model, but it is parallel-based and uses the LiquidCrystal library
  • Resistors:
    1 x 4.7K ohms
    1 x 220 ohms (only required if LCD is used)
  • Wires to connect everything
  • The DHT library installed in Arduino/libraries
  • Climaduino Thermostat source code

Climaduino Controller

Very cool!!!<br> I thought of something very similar. Obviously using my open source java library control. Actually there is still no web interface (you can just control <strong>Arduino from network</strong>) but it works very well with <strong>Raspberry</strong>. If you are interested check it at <strong><a href="http://www.ardulink.org" rel="nofollow">www.ardulink.org</a></strong>
Izu, that looks very intriguing. It is an extremely cool project that I would love to experiment with at some point. Thanks for letting me know about it.
Thank you. Give me a feedback when you'll try it.
<p>Dear bbustin, could you provide for me Raspberry pi controller code if I want to use raspberry pi and arduno uno over usb please? <br><br>I did everything as was mentioned in this tutorial, but I get error message if I try to click on submit or on settings or history for example, I can&acute;t get the readings too :/</p><p>Help me please, thank you :)</p><p><br>I used this for Arduino:</p><p><a href="https://github.com/bbustin/climaduino/tree/stable-usb-connected" rel="nofollow">https://github.com/bbustin/climaduino/tree/stable-...</a></p><p>And this one for pi:</p><p><a href="https://github.com/bbustin/Climaduino-web-controller/tree/stable-usb-connected" rel="nofollow">https://github.com/bbustin/Climaduino-web-controll...<br></a></p>
Hi Deekaylol,<br><br>The code you used should work for that; however, I think that the problem here is that there is a new version of Django that was released in the interim. The old code is not working with the new version of Django.<br><br>Maybe you could try uninstalling Django and then installing the older version:<br>pip install Django==1.6.10<br><br>If that works, please let me know and I will update this instructable so others do not run into the problem.
<p>Dear bbustin,<br><br>That did the trick ! I was able to uninstall Django with pip uninstall, and install the version you mentioned, the reading is working, great :) Thank you,you are the king bro ! ;)<br><br>I got two more questions, I hope you could help me:</p><p>1, I see Heating option, but I in the Arduino code, I just see one relay output &quot;const int pinRelay = 10; // pin for relay&quot; , could you provide some information about this ? I would be really thankful, If you coud edit the code for second relay, which could control the heating.<br><br>2, Could you provide some information how the temperature could be changed to SI ? I mean to Celsius, since I&acute;d like to use that code to control heating/cooling system in our bungallow (AC and Heating is connected to 220V so the relay shoud do the trick.)<br><br><br>I look forward to hear from you.<br><br>Best regards, deekaylol<br></p>
<p>Hi Deekaylol,</p><p>The original code currently only handles one relay for cooling. I had put the heating in there for the future. The current code handles heating as well; however, it works in a completely different way and has different requirements.</p><p>Changing the code to display Celsius should be easy. Change line 216 in the code from</p><p>&quot;float readingTemp = dht.readTemperature(true);&quot;</p><p>to</p><p>&quot;float readingTemp = dht.readTemperature(false);&quot;</p>
<p>Dear bbustin,<br><br>I was ablet to edit the code, second powerstate and pinrelay did the trick, it&acute;s a bit buggy at the moment, but working. But I was stucked with the F to C converting, that was so easy. Thank you very much !<br><br>Have a nice day ;-)<br><br>deekaylol</p>
Hi Tom,<br><br>I think that about the init script not following the LSB standards may be ok. One way to tell is to see if the rest of the steps work. If they do not, let me know and I will try my best to come up with some steps that should work.<br><br>I'm sorry this has been so difficult. The code you are using is the newest and best, but I have not had time to polish things up or write an install guide yet.
<p>hi bbustin. We got it, the fact you told us to reset the Yun distro actually worked. I guess this is a valuable experience. We continue to work on it as adding more features like controlling washer too. But your help is so great and we want to say thank you..</p><p>actually, we have to change a tiny bit in mqtt_bridge.py</p><p>mqtt_connect('<strong>climaduino.local</strong>') with our Pi's address. then it started collecting data.</p><p>wget mqtt_bridge.py and send_setting.py is another experience. we actually did wget whole html file instad of python file.</p>
<p>Hi Tom,</p><p>I am really happy it is working now. I updated the README file to now tell others to first update their Y&uacute;n. If I can help with anything else, let me know.</p>
<p>thank you for your respond. </p><p>First, we uploaded sketch to arduino Yun and tried to see how data be transmitted, (no shield yet). even though, we used </p><p><strong>ssh root@yourYunsName.local 'telnet localhost 6571'</strong></p><p>tried to get data but the error : <strong>telnet bad address &quot;localhost&quot;</strong> stopped this happening.</p><p>how we can define the Yun hostname is big thing</p><p>Second, at the same time, we installed develop code controller for Raspberry pi but cannot understand how Raspberry pi able to communicate with Yun, we understood that MQTT bridge does that part but how Pi is able to load the data from Arduino Yun is a big challenger. All steps were followed.</p><p>but the question is : <strong>should we install MQTT into Pi as well</strong>? most of other projects we saw MQTT been installed to all machines it communicates with. how can MQTT in Yun able to communicate with Pi if the receiver doesn't have the same program to receive the message? </p><p>I would like to hear you back soon, we tried many steps but not going anywhere further yet. the data is not transmitted. no communicate between Yun and Pi . </p>
Hi Tom,<br><br>The code in the Develop branch of the controller has instructions for installing MQTT on the Pi. What you have is an MQTT broker server on the Pi. Then you have the MQTT bridge component on the Pi that talks to the MQTT broker. The Y&uacute;n has an MQTT bridge component as well which communicates with the MQTT broker on the Pi.<br><br>For some reason the Y&uacute;n does not seem to support MDNS, so I had to add instructions in the README about adding the Raspberry Pi's IP to the hosts file until I can figure out how to get MDNS working properly on the Y&uacute;n.<br><br>So the communication is from each component to the MQTT broker server. The Y&uacute;n puts messages on the MQTT broker and the Climaduino Controller software picks them up. This information is stuff like current temperature and humidity, whether the system is on or not, whether the fan is on or auto. The Climaduino Controller software subscribes to those types of messages with the MQTT broker. Whenever the Y&uacute;n sends one of these messages out to the MQTT broker, the MQTT broker sends the message to the Climaduino Controller.<br><br>The process also works in reverse. When the Climaduino Controller needs to ask the Climaduino to change a setting (such as changing the temperature set point), it sends this information to the MQTT broker. The Y&uacute;n is subscribed to those kinds of messages with the MQTT broker. So whenever the broker gets one of the setting messages, it sends it to the Y&uacute;n.<br><br>The MQTT broker is what handles all of the data receiving, storing, sending. The MQTT Bridge components on the Y&uacute;n and the Pi are the ones that interface with the MQTT broker.<br><br>The MQTT bridge on the Y&uacute;n is different code than the MQTT bridge on the Pi. So the Pi should have the Climaduino Controller code from the Develop branch and the Y&uacute;n should have the Climaduino code from its Develop branch. Both have README files that are not great (remember the Develop branch is very much a work in progress), but give a general idea of some of the steps that are needed to get it up and running.<br><br>Time-permitting I really want to make this a lot easier to deploy. Maybe some sort of installer routine and better documentation. If you see any areas where a specific type of documentation would help or something is very unclear, let me know. That way I can improve those parts and we can work together to make this project even better and easier for anyone to use.
<p>Hi Brian</p><p>It worked we updated the version of the yun to be compatible with the software and the readings made it to the local.</p><p>we did however modifi the mqtt_bridge.py on the mqtt_connect = &quot;climaduino.local&quot; to mqtt_connect = ''our raspberry pi IP &quot; and it panned out.</p><p>also in the /etc/rc.local the latest version we believe that the mDNS is working because it showed</p><p> localhost</p><p>so we didn't have to add anything else to that file. thought you should know as an update.</p>
<p>Hi Bbustin</p><p>The information you sent to us <br>about checking the status of the mosquitto on the pi came back with the message</p><p>[ok] mosquitto is running</p><p>I also apt-get mosquitto and it <br>said that the latest version is already installed.</p><p>so we are still stuck with the <br>same problem which is when we telnet from the pi through the command:</p><p>telnet localhost 5700</p><p>it comes back with:</p><p>trying</p><p>trying::1...</p><p>telnet: unable to connect to <br>remote host: Address family not supported by protocol.</p><p>Also we studied the <br>mqtt_bridge.py script and saw that the /tmp/climaduino_mqtt_bridge socket file <br>is plugged in the socket_address variable however I don't see anything in that <br>file and I believe that there is a discrepancy there. also the screen -r gave <br>us no screen to be resumed.</p><p>we are also available today at <br>anytime for the virtual conference call just replie to me in a personal message</p>
<p>Hi Bbustin,</p><p>in the raspberry pi I telnetted : telnet localhost 5700 this spitted out the following respons</p><p>telnet: unable to connect to remote host: address family not supported by protocol.</p><p>I also ettmpted to just telnet through the following command:</p><p>telnet 5700 </p><p>it came back with the following message:</p><p>telnet: unable to connect to remote host: connection refused</p><p>when typing </p><p> netstat -an | egrep 'Proto|LISTEN'</p><p>it return with </p><p>TCP listening on port 22, 23, and 1883 but no instance for 5700 </p><p>i also tried telnetting on the yun </p><p>telnet climaduino.local 5700</p><p>it didn't work so I found the ip of the pi and telnetted</p><p>telnet 5700 and the response was </p><p>telnet: unable to connect to remote host: connection refused</p><p>I am not sure what is wrong.</p><p>also you mentioned a virtual conference call. please let me know when and how we can do that if you still up for it.</p>
It sounds like the MQTT broker may not be running on the Raspberry Pi. On the Pi, try typing 'service mosquitto status' to see if it is up. If it does not exist, try making sure it is installed by running 'sudo apt-get install mosquitto'. If it was not installed, this last command will install it and start it.<br><br>I will send you a private message about setting up a conference call in case that does not work...
Hi Bbustin,<br>I am TomL5 Partner working on the same project. So I in turn would like to ask you a couple of questions. Firstly, after following your instructions to the Tee, are we supposed to get data from the sensor into the WUI (Web User Interface) or is that still a work in progress . Second are we suppose to configure the Telnet. And if so how can we get it to point to the proper place to fetch data from the Yun. As it seems the MQTT protocol is not establishing any connection with the local host because when running a shell command line<br>Found in the arduino Yun documentation http://arduino.cc/en/Guide/ArduinoYun : telnet localhost 6571. We get the telnet bad address 'localhost'. I did find that the port that you specified on the MQTT_bridge.py to communicate with the local host is 5700 do we need to specify that anywhere else in the micro controllers configuration. I have a felling that there is something missing in that regard. Because I have tested and successfully received data from the DHT22 from an Uno but no data from the Yun. We also tried to remove the Seed shield to see if the discrepancy is in that structure of the work however to no avail. Please point us to the right direction so we can be on the same page as the latest and greatest
Hi. The test of telnetting to port 6571 on the Arduino Y&uacute;n is not a good test. The reason is because the MQTT broker is not running on the Arduino Y&uacute;n. If you want to test MQTT, then on the Raspberry Pi, try telnetting to localhost port 5700. If that works, then the next step is to test is the Arduino Y&uacute;n has connectivity to the MQTT broker running on the Raspberry Pi. Try telnetting from the Y&uacute;n to climaduino.local port 5700. If that does not work, find the IP of the Raspberry Pi. Then go back to the Y&uacute;n and try telnetting to the Pi's IP port 5700. If that works, then the issue is the hosts file. <br><br>If everything checks out, then we can continue the troubleshooting. The first thing to do on the Y&uacute;n is to type 'screen -r'. This should give you the console output of the Y&uacute;n's MQTT broker. If it is working, it should say it is sending settings. If it is not, there may be an error there. To get out of there without killin the MQTT bridge, press Ctrl + A, then let go of both and press D. <br><br>If everything looked fine there, then we can continue with troubleshooting steps on the Pi. I'm not home on my computer (everything above is from memory), but if those steps do not find the prolem I can come up with more when I get home. <br><br>If needed, we can also set up a virtual online conference call where you can show me what is happening. I really want to help you guys to get this working...
<p>hi bbustin. we uploaded the code and script as you mentioned in your steps with Yun. but when we go the web, we dont have any reading from DHT22 and when we type new temperature or humidity values they dont get send in the thermostat display Is this the file send_reading.py installation somehow affected to collect data. we using honeywell trueIAQ connected with relay shiled. we connected the NOs 2 and 3 into the Heating pin and the Fan pin op thermostat. we also dont have a HVAC system hooked. </p>
Hi Tom,<br><br>It sounds like you are using the code in my development repository. This code works significantly differently than the code in the instructable.<br><br>The key difference is using the Arduino Y&uacute;ns WiFi and Linux processor. The communications between the controller and the Climaduino code on the Y&uacute;n is also vastly different. The MQTT pub/sub protocol is used. The Y&uacute;n's Linux processor runs the mqtt_bridge.py file. This reads any settings for the device. It also opens a file-based socket for the send_readings.py file to be able to set the readings on the MQTT broker. <br><br>For this to work, it must be paired with the development branch of the Coimaduino controller code. Since this is all. Dry experimental, there are bound to be some rough edges. I am glad to help you to get this up and running and am ecstatic that someone else will be using this new code.
<p>thanks a lot my friend. We try to understand the concept and idea how all connected wireless.we using all news board Yun and Pi B+; plus all the developing code. i guessed we messed up with connection since we try to hook Arduino Yun board and Raspberry Pi B+ by USB cable. and somehow DHT22 not able to collect data. Also, when we tried to add device on Django admin page, about adding informatioi of Yun Hostname and Zonenumber. i used root for hostname and .climaduino for zonename. but i believe this step maynot be right then it may affected to Pi communicates with Yun to load data? your information is so great and we should be careful since begining. Thank you very much</p><p>best regard </p><p>TomL5</p>
<p>Hi Tom,</p><p>First make sure that you are using the develop branch for both the Climaduino and Climaduino Controller parts of the project. The Climaduino code in develop, for instance, will not work with the master branch of the Climaduino controller. It sounds like you are not using the develop branch for the controller as zone number has been removed.</p><ul><li><em><a href="https://github.com/bbustin/climaduino/tree/develop" rel="nofollow">https://github.com/bbustin/climaduino/tree/develop</a></em><li><em><a href="https://github.com/bbustin/Climaduino-web-controller/tree/develop" rel="nofollow"><em>https://github.com/bbustin/Climaduino-web-controller/tree/develop</em></a></em></ul><p>Each of those repositories had a README file as part of the develop branch that gives some initial steps for how to set everything up. I've not had a chance to polish things up much as it is still very much a work in progress. (It does work though as I am using it to control a central AC at the house for the last month.)</p><p>The steps at a high level are:</p><p>- Follow the README steps to get the Climaduino-web-controller code in the develop branch running on your Raspberry Pi and the MQTT broker set up.</p><p>- Get Arduino Y&uacute;n on your WiFi network or connected through ethernet</p><p> - Get code loaded onto the Arduino AVR portion of the Arduino Y&uacute;n (upload the sketch).</p><p>- Get the mqtt_bridge.py and send_readings.py components installed on the Linux part of the Arduino Y&uacute;n. There are details how to do this in README file in the mqtt_yun_bridge folder.</p><p>At this point when browsing to climaduino.local, you should see a zone that was added automatically. If you click on the button, you should see the readings and settings for your climaduino.</p><p>Note: Do not give the Y&uacute;n the hostname climaduino. Only the Raspberry Pi should have a hostname of climaduino. The Y&uacute;n's hostname can reflect where it is or be an arbitrary name depending on your preferences.</p><p>Hope this helps. Please let me know. I'm glad to help.</p>
<p>I got this problem since I run the command in Pi. Do you have an idea? </p><p>i just follow the same steps like you posted. I thought maybe file in develop may corrupt the work?</p><p>pi@climaduino ~/climaduino $ python manage.py syncdb</p><p>Operations to perform:</p><p> Synchronize unmigrated apps: history</p><p> Apply all migrations: admin, contenttypes, settings, auth, sessions</p><p>Synchronizing apps without migrations:</p><p> Creating tables...</p><p> Installing custom SQL...</p><p> Installing indexes...</p><p>Running migrations:</p><p><strong> No migrations to apply.</strong></p><p>pi@climaduino ~/climaduino $ sudo cp ~/climaduino/startup_script\ for\ Debian/climaduino-controller /etc/init.d</p><p>pi@climaduino ~/climaduino $ sudo update-rc.d climaduino-controller defaults </p><p>update-rc.d: using dependency based boot sequencing</p><p><strong>insserv: Script climaduino-controller is broken: incomplete LSB comment.</strong></p><p><strong>insserv: missing `Required-Start:' entry: please add even if empty.</strong></p><p><strong>insserv: missing `Required-Stop:' entry: please add even if empty.</strong></p><p><strong>insserv: missing `Default-Start:' entry: please add even if empty.</strong></p><p><strong>insserv: missing `Default-Stop:' entry: please add even if empty.</strong></p><p><strong>insserv: Default-Start undefined, assuming empty start runlevel(s) for script `climaduino-controller'</strong></p><p><strong>insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `climaduino-controller'</strong></p>
<p>Hello,</p><p>I am having a nightmare of a time getting rrdtool to install. I am using a raspberry Pi 2 and have tried the steps in your instructable with both the latest version of wheezy with the adafruit tools installed and also with the occidentalis v0.2 distro. In both cases I am getting the following error when executing the easy_install python-rrdtool command above:</p><p>(pi)pi@raspberrypi ~ $ easy_install python-rrdtool</p><p>Searching for python-rrdtool</p><p>Reading <a href="https://pypi.python.org/simple/python-rrdtool/" rel="nofollow"> https://pypi.python.org/simple/python-rrdtool/</a></p><p>/home/pi/local/lib/python2.7/site-packages/pkg_resources/__init__.py:2512: PEP440Warning: 'python (rrdtool-1.4.7)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migrate to PEP 440 compatible versions.</p><p> PEP440Warning,</p><p>Best match: python-rrdtool 1.4.7</p><p>Downloading <a href="https://pypi.python.org/packages/source/p/python-rrdtool/python-rrdtool-1.4.7.tar.gz#md5=7112a594ccd7759d59eaebf061ddacbd" rel="nofollow"> https://pypi.python.org/packages/source/p/python-...</a></p><p>Processing python-rrdtool-1.4.7.tar.gz</p><p>Writing /tmp/easy_install-wPVPRm/python-rrdtool-1.4.7/setup.cfg</p><p>Running python-rrdtool-1.4.7/setup.py -q bdist_egg --dist-dir /tmp/easy_install-wPVPRm/python-rrdtool-1.4.7/egg-dist-tmp-yrYogk</p><p>checking build system type... armv7l-unknown-linux-gnueabi</p><p>checking host system type... armv7l-unknown-linux-gnueabi</p><p>checking target system type... armv7l-unknown-linux-gnueabi</p><p>checking for gcc... gcc</p><p>checking for C compiler default output file name... a.out</p><p>checking whether the C compiler works... yes</p><p>checking whether we are cross compiling... no</p><p>checking for suffix of executables...</p><p>checking for suffix of object files... o</p><p>checking whether we are using the GNU C compiler... yes</p><p>checking whether gcc accepts -g... yes</p><p>checking for gcc option to accept ISO C89... none needed</p><p>checking how to run the C preprocessor... gcc -E</p><p>checking for grep that handles long lines and -e... /bin/grep</p><p>checking for egrep... /bin/grep -E</p><p>checking for ANSI C header files... yes</p><p>checking for sys/types.h... yes</p><p>checking for sys/stat.h... yes</p><p>checking for stdlib.h... yes</p><p>checking for string.h... yes</p><p>checking for memory.h... yes</p><p>checking for strings.h... yes</p><p>checking for inttypes.h... yes</p><p>checking for stdint.h... yes</p><p>checking for unistd.h... yes</p><p>checking minix/config.h usability... no</p><p>checking minix/config.h presence... no</p><p>checking for minix/config.h... no</p><p>checking whether it is safe to define __EXTENSIONS__... yes</p><p>checking for a BSD-compatible install... /usr/bin/install -c</p><p>checking whether build environment is sane... yes</p><p>checking for a thread-safe mkdir -p... /bin/mkdir -p</p><p>checking for gawk... no</p><p>checking for mawk... mawk</p><p>checking whether make sets $(MAKE)... yes</p><p>checking for style of include used by make... GNU</p><p>checking dependency style of gcc... gcc3</p><p>checking whether to enable maintainer-specific portions of Makefiles... no</p><p>Audit Compilation Environment</p><p>checking how to run the C preprocessor... gcc -E</p><p>checking for gcc... (cached) gcc</p><p>checking whether we are using the GNU C compiler... (cached) yes</p><p>checking whether gcc accepts -g... (cached) yes</p><p>checking for gcc option to accept ISO C89... (cached) none needed</p><p>checking whether gcc and cc understand -c and -o together... yes</p><p>checking for a sed that does not truncate output... /bin/sed</p><p>checking for fgrep... /bin/grep -F</p><p>checking for ld used by gcc... /usr/bin/ld</p><p>checking if the linker (/usr/bin/ld) is GNU ld... yes</p><p>checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B</p><p>checking the name lister (/usr/bin/nm -B) interface... BSD nm</p><p>checking whether ln -s works... yes</p><p>checking the maximum length of command line arguments... 1572864</p><p>checking whether the shell understands some XSI constructs... yes</p><p>checking whether the shell understands &quot;+=&quot;... yes</p><p>checking for /usr/bin/ld option to reload object files... -r</p><p>checking for objdump... objdump</p><p>checking how to recognize dependent libraries... pass_all</p><p>checking for ar... ar</p><p>checking for strip... strip</p><p>checking for ranlib... ranlib</p><p>checking command to parse /usr/bin/nm -B output from gcc object... ok</p><p>checking for dlfcn.h... yes</p><p>checking for objdir... .libs</p><p>checking if gcc supports -fno-rtti -fno-exceptions... no</p><p>checking for gcc option to produce PIC... -fPIC -DPIC</p><p>checking if gcc PIC flag -fPIC -DPIC works... yes</p><p>checking if gcc static flag -static works... yes</p><p>checking if gcc supports -c -o file.o... yes</p><p>checking if gcc supports -c -o file.o... (cached) yes</p><p>checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes</p><p>checking whether -lc should be explicitly linked in... no</p><p>checking dynamic linker characteristics... GNU/Linux ld.so</p><p>checking how to hardcode library paths into programs... immediate</p><p>checking whether stripping libraries is possible... yes</p><p>checking if libtool supports shared libraries... yes</p><p>checking whether to build shared libraries... yes</p><p>checking whether to build static libraries... yes</p><p>checking if gcc likes the -Werror flag... yes</p><p>checking if gcc likes the -fno-strict-aliasing flag... yes</p><p>checking if gcc likes the -Wall flag... yes</p><p>checking if gcc likes the -std=gnu99 flag... yes</p><p>checking if gcc likes the -pedantic flag... yes</p><p>checking if gcc likes the -Wundef flag... yes</p><p>checking if gcc likes the -Wshadow flag... yes</p><p>checking if gcc likes the -Wpointer-arith flag... yes</p><p>checking if gcc likes the -Wcast-align flag... yes</p><p>checking if gcc likes the -Wmissing-prototypes flag... yes</p><p>checking if gcc likes the -Wmissing-declarations flag... yes</p><p>checking if gcc likes the -Wnested-externs flag... yes</p><p>checking if gcc likes the -Winline flag... yes</p><p>checking if gcc likes the -Wold-style-definition flag... yes</p><p>checking if gcc likes the -W flag... yes</p><p>Checking for Header Files</p><p>checking for ANSI C header files... (cached) yes</p><p>checking for dirent.h that defines DIR... yes</p><p>checking for library containing opendir... none required</p><p>checking langinfo.h usability... yes</p><p>checking langinfo.h presence... yes</p><p>checking for langinfo.h... yes</p><p>checking for stdint.h... (cached) yes</p><p>checking for inttypes.h... (cached) yes</p><p>checking libgen.h usability... yes</p><p>checking libgen.h presence... yes</p><p>checking for libgen.h... yes</p><p>checking features.h usability... yes</p><p>checking features.h presence... yes</p><p>checking for features.h... yes</p><p>checking for sys/stat.h... (cached) yes</p><p>checking for sys/types.h... (cached) yes</p><p>checking fcntl.h usability... yes</p><p>checking fcntl.h presence... yes</p><p>checking for fcntl.h... yes</p><p>checking fp_class.h usability... no</p><p>checking fp_class.h presence... no</p><p>checking for fp_class.h... no</p><p>checking malloc.h usability... yes</p><p>checking malloc.h presence... yes</p><p>checking for malloc.h... yes</p><p>checking for unistd.h... (cached) yes</p><p>checking ieeefp.h usability... no</p><p>checking ieeefp.h presence... no</p><p>checking for ieeefp.h... no</p><p>checking math.h usability... yes</p><p>checking math.h presence... yes</p><p>checking for math.h... yes</p><p>checking sys/times.h usability... yes</p><p>checking sys/times.h presence... yes</p><p>checking for sys/times.h... yes</p><p>checking sys/param.h usability... yes</p><p>checking sys/param.h presence... yes</p><p>checking for sys/param.h... yes</p><p>checking sys/resource.h usability... yes</p><p>checking sys/resource.h presence... yes</p><p>checking for sys/resource.h... yes</p><p>checking signal.h usability... yes</p><p>checking signal.h presence... yes</p><p>checking for signal.h... yes</p><p>checking float.h usability... yes</p><p>checking float.h presence... yes</p><p>checking for float.h... yes</p><p>checking stdio.h usability... yes</p><p>checking stdio.h presence... yes</p><p>checking for stdio.h... yes</p><p>checking for stdlib.h... (cached) yes</p><p>checking errno.h usability... yes</p><p>checking errno.h presence... yes</p><p>checking for errno.h... yes</p><p>checking for string.h... (cached) yes</p><p>checking ctype.h usability... yes</p><p>checking ctype.h presence... yes</p><p>checking for ctype.h... yes</p><p>checking for an ANSI C-conforming const... yes</p><p>checking whether time.h and sys/time.h may both be included... yes</p><p>checking whether struct tm is in sys/time.h or time.h... time.h</p><p>Test Library Functions</p><p>checking for acos... no</p><p>checking for acos in -lm... yes</p><p>checking for strftime... yes</p><p>checking for vprintf... yes</p><p>checking for _doprnt... no</p><p>checking whether byte ordering is bigendian... no</p><p>checking for nl_langinfo... yes</p><p>checking for tzset... yes</p><p>checking for round... yes</p><p>checking for rint... yes</p><p>checking for fsync... yes</p><p>checking for mbstowcs... yes</p><p>checking for opendir... yes</p><p>checking for readdir... yes</p><p>checking for chdir... yes</p><p>checking for chroot... yes</p><p>checking for getuid... yes</p><p>checking for strerror... yes</p><p>checking for snprintf... yes</p><p>checking for vsnprintf... yes</p><p>checking for vasprintf... yes</p><p>checking for fpclass... no</p><p>checking for class... no</p><p>checking for fp_class... no</p><p>checking for isnan... yes</p><p>checking for memmove... yes</p><p>checking for strchr... yes</p><p>checking for mktime... yes</p><p>checking for getrusage... yes</p><p>checking for gettimeofday... yes</p><p>checking whether strerror_r is declared... yes</p><p>checking for strerror_r... yes</p><p>checking whether strerror_r returns char *... yes</p><p>Map/Fadvis/Madvise checking</p><p>checking for fdatasync... yes</p><p>checking for fsync... (cached) yes</p><p>checking for socket... yes</p><p>checking for getaddrinfo... yes</p><p>checking sys/mman.h usability... yes</p><p>checking sys/mman.h presence... yes</p><p>checking for sys/mman.h... yes</p><p>checking for stdlib.h... (cached) yes</p><p>checking for unistd.h... (cached) yes</p><p>checking for getpagesize... yes</p><p>checking for working mmap... yes</p><p>checking for mmap... yes</p><p>checking for munmap... yes</p><p>checking for msync... yes</p><p>checking whether madvise is declared... yes</p><p>checking for madvise... yes</p><p>checking whether posix_fadvise is declared... yes</p><p>checking for posix_fadvise... yes</p><p>Libintl Processing</p><p>checking whether NLS is requested... yes</p><p>checking for msgfmt... /usr/bin/msgfmt</p><p>checking for gmsgfmt... /usr/bin/msgfmt</p><p>checking for xgettext... /usr/bin/xgettext</p><p>checking for msgmerge... /usr/bin/msgmerge</p><p>checking for ld used by GCC... /usr/bin/ld</p><p>checking if the linker (/usr/bin/ld) is GNU ld... yes</p><p>checking for shared library run path origin... done</p><p>checking for CFPreferencesCopyAppValue... no</p><p>checking for CFLocaleCopyCurrent... no</p><p>checking for GNU gettext in libc... yes</p><p>checking whether to use NLS... yes</p><p>checking where the gettext function comes from... libc</p><p>IEEE Math Checks</p><p>checking for fpclassify... no</p><p>checking for fpclassify with &lt;math.h&gt;... yes</p><p>checking for isinf... yes</p><p>checking whether isfinite is broken... no</p><p>checking if IEEE math works out of the box... yes</p><p>Resolve Portability Issues</p><p>checking tm_gmtoff in struct tm... yes</p><p>checking __tm_gmtoff in struct tm... no</p><p>checking if msync with MS_ASYNC updates the files mtime... yes</p><p>checking for _NL_TIME_WEEK_1STDAY... no</p><p>checking for nl_langinfo(_NL_TIME_WEEK_1STDAY) with langinfo.h... yes</p><p>checking for opterr... yes</p><p>checking for getopt_long... yes</p><p>checking if realloc can deal with NULL... yes</p><p>checking if ctime_r need special care to act posixly correct... no</p><p>checking for the pthreads library -lpthreads... no</p><p>checking whether pthreads work without any flags... no</p><p>checking whether pthreads work with -Kthread... no</p><p>checking whether pthreads work with -kthread... no</p><p>checking for the pthreads library -llthread... no</p><p>checking whether pthreads work with -pthread... yes</p><p>checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE</p><p>checking if more special flags are required for pthreads... no</p><p>checking for cc_r... gcc</p><p>checking do we need malloc/malloc.h... nope, works out of the box</p><p>checking the type of time_t... checking size of time_t... 4</p><p>time_t is 32 bit</p><p>Find 3rd-Party Libraries</p><p>checking dbi/dbi.h usability... no</p><p>checking dbi/dbi.h presence... no</p><p>checking for dbi/dbi.h... no</p><p>checking tcpd.h usability... no</p><p>checking tcpd.h presence... no</p><p>checking for tcpd.h... no</p><p>checking for cairo_font_options_create in -lcairo... yes</p><p>checking cairo.h usability... no</p><p>checking cairo.h presence... no</p><p>checking for cairo.h... no</p><p>checking for pkg-config... pkg-config</p><p>checking for cairo_font_options_create in -lcairo... yes</p><p>checking cairo.h usability... yes</p><p>checking cairo.h presence... yes</p><p>checking for cairo.h... yes</p><p>checking for cairo_svg_surface_create in -lcairo... yes</p><p>checking cairo-svg.h usability... yes</p><p>checking cairo-svg.h presence... yes</p><p>checking for cairo-svg.h... yes</p><p>checking for cairo_pdf_surface_create in -lcairo... yes</p><p>checking cairo-pdf.h usability... yes</p><p>checking cairo-pdf.h presence... yes</p><p>checking for cairo-pdf.h... yes</p><p>checking for cairo_ps_surface_create in -lcairo... yes</p><p>checking cairo-ps.h usability... yes</p><p>checking cairo-ps.h presence... yes</p><p>checking for cairo-ps.h... yes</p><p>checking for pango_cairo_context_set_font_options in -lpangocairo-1.0... yes</p><p>checking pango/pango.h usability... no</p><p>checking pango/pango.h presence... no</p><p>checking for pango/pango.h... no</p><p>checking for pkg-config... (cached) pkg-config</p><p>checking for pango_cairo_context_set_font_options in -lpangocairo-1.0... yes</p><p>checking pango/pango.h usability... yes</p><p>checking pango/pango.h presence... yes</p><p>checking for pango/pango.h... yes</p><p>checking for glib_check_version in -lglib-2.0... yes</p><p>checking glib.h usability... yes</p><p>checking glib.h presence... yes</p><p>checking for glib.h... yes</p><p>checking for xmlParseFile in -lxml2... yes</p><p>checking libxml/parser.h usability... yes</p><p>checking libxml/parser.h presence... yes</p><p>checking for libxml/parser.h... yes</p><p>Prep for Building Language Bindings</p><p>checking for perl... /usr/bin/perl</p><p>checking for pod2man... /usr/bin/pod2man</p><p>checking for pod2html... /usr/bin/pod2html</p><p>checking for the perl version you are running... 5.14.2</p><p>checking for the C compiler perl wants to use to build its modules... cc</p><p>checking for cc... /usr/bin/cc</p><p>checking Perl Modules to build... perl_piped perl_shared</p><p>checking for ruby... no</p><p>checking if ruby modules can be built... No .. Ruby not found or disabled</p><p>checking for lua... /usr/bin/lua</p><p>checking for lua &gt;= 5.0... 5.1 found</p><p>checking lua51/lua.h usability... no</p><p>checking lua51/lua.h presence... no</p><p>checking for lua51/lua.h... no</p><p>checking lua5.1/lua.h usability... no</p><p>checking lua5.1/lua.h presence... no</p><p>checking for lua5.1/lua.h... no</p><p>checking lua.h usability... no</p><p>checking lua.h presence... no</p><p>checking for lua.h... no</p><p>checking for library containing lua_call... no</p><p>Lua headers found but not the libraries! Please reinstall the dev packages for Lua 5.1</p><p>checking for tclConfig.sh in /usr/lib... no</p><p>checking for tclConfig.sh in /usr/lib64... no</p><p>checking for tclConfig.sh in /usr/local/lib... no</p><p>checking for tclConfig.sh in /usr/lib/tcl8.4... no</p><p>checking for tclConfig.sh in /usr/lib/tcl8.3... no</p><p>configure: WARNING: tclConfig.sh not found - Tcl interface will not be built</p><p>checking for a Python interpreter with version &gt;= 2.3... python</p><p>checking for python... /home/pi/bin/python</p><p>checking for python version... 2.7</p><p>checking for python platform... linux2</p><p>checking for python script directory... ${prefix}/lib/python2.7/site-packages</p><p>checking for python extension module directory... ${exec_prefix}/lib/python2.7/site-packages</p><p>checking for headers required to compile python extensions... found</p><p>checking for gnroff... no</p><p>checking for nroff... /usr/bin/nroff</p><p>checking for groff... /usr/bin/groff</p><p>Apply Configuration Information</p><p>configure: creating ./config.status</p><p>config.status: creating examples/shared-demo.pl</p><p>config.status: creating examples/piped-demo.pl</p><p>config.status: creating examples/stripes.pl</p><p>config.status: creating examples/bigtops.pl</p><p>config.status: creating examples/minmax.pl</p><p>config.status: creating examples/4charts.pl</p><p>config.status: creating examples/perftest.pl</p><p>config.status: creating examples/Makefile</p><p>config.status: creating examples/rrdcached/Makefile</p><p>config.status: creating doc/Makefile</p><p>config.status: creating po/Makefile.in</p><p>config.status: creating src/Makefile</p><p>config.status: creating src/librrd.sym.in</p><p>config.status: creating src/librrd.pc</p><p>config.status: creating bindings/Makefile</p><p>config.status: creating bindings/tcl/Makefile</p><p>config.status: creating bindings/tcl/ifOctets.tcl</p><p>config.status: creating Makefile</p><p>config.status: creating bindings/lua/Makefile</p><p>config.status: creating rrd_config.h</p><p>config.status: executing depfiles commands</p><p>config.status: executing libtool commands</p><p>config.status: executing po-directories commands</p><p>config.status: creating po/POTFILES</p><p>config.status: creating po/Makefile</p><p>config.status: executing default commands</p><p>checking in... and out again</p><p>ordering CD from <a href="http://tobi.oetiker.ch/wish" rel="nofollow"> http://tobi.oetiker.ch/wish </a> .... just kidding ;-)</p><p>----------------------------------------------------------------</p><p>Config is DONE!</p><p> With MMAP IO: yes</p><p> Build rrd_getopt: no</p><p> Build rrd_graph: yes</p><p> Static programs: no</p><p> Perl Modules: perl_piped perl_shared</p><p> Perl Binary: /usr/bin/perl</p><p> Perl Version: 5.14.2</p><p> Perl Options: PREFIX=/opt/rrdtool-1.4.7 LIB=/opt/rrdtool-1.4.7/lib/perl/5.14.2</p><p> Ruby Modules:</p><p> Ruby Binary: no</p><p> Ruby Options: sitedir=/opt/rrdtool-1.4.7/lib/ruby</p><p> Build Lua Bindings: no</p><p> Build Tcl Bindings: no</p><p> Build Python Bindings: yes</p><p> Build rrdcgi: yes</p><p> Build librrd MT: yes</p><p> Use gettext: yes</p><p> With libDBI: no</p><p> With libwrap: no</p><p> Libraries: -lxml2 -lglib-2.0 -lcairo -lcairo -lcairo -lm -lcairo -lpng12 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0</p><p>Type 'make' to compile the software and use 'make install' to</p><p>install everything to: /opt/rrdtool-1.4.7.</p><p> ... that wishlist is NO JOKE. If you find RRDtool useful</p><p>make me happy. Go to <a href="http://tobi.oetiker.ch/wish" rel="nofollow"> http://tobi.oetiker.ch/wish </a> and</p><p>place an order.</p><p> -- Tobi Oetiker &lt;tobi@oetiker.ch&gt;</p><p>----------------------------------------------------------------</p><p>In file included from /usr/include/python2.7/Python.h:8:0,</p><p> from rrdtool-1.4.7/bindings/python/rrdtoolmodule.c:44:</p><p>/usr/include/python2.7/pyconfig.h:1161:0: warning: &quot;_POSIX_C_SOURCE&quot; redefined [enabled by default]</p><p>/usr/include/features.h:163:0: note: this is the location of the previous definition</p><p>/usr/include/python2.7/pyconfig.h:1183:0: warning: &quot;_XOPEN_SOURCE&quot; redefined [enabled by default]</p><p>/usr/include/features.h:165:0: note: this is the location of the previous definition</p><p>/usr/bin/ld: cannot find -lrrd</p><p>collect2: ld returned 1 exit status</p><p>error: Setup script exited with error: command 'gcc' failed with exit status 1</p><p>(pi)pi@raspberrypi ~ $</p><p>______________________________</p><p>I have tried loading the apt-get install libpango1.0-dev libxml2-dev as noted in the comments, but it did not help.</p><p>Any help in what I am doing wrong and how to fix would be greatly appreciated</p><p>Thanks,<br>Keith</p>
<p>Hi Keith,</p><p>Can you try running the following and see if it helps?</p><p>sudo apt-get install -y build-essential python-dev python-setuptools libcairo2-dev libpango1.0-dev libxml2-dev rrdtool librrd-dev</p>
<p>sir what is climaduino sketch? <br>in step 4?</p>
<p>Bbustin I have fixed some code up to work on arduino mega</p><p>I was also going to add code for a heater relay instead of JUST AC</p><p>at least how I read it is that you only have AC toggle otherwise I would assume you need 2x relay outputs and also a setup for heat rather than Just cold :D Some of us live in a cold climate and want efficient heating rather than cooling :D or actually I planned on both </p>
<p>I also updated code to work with RGB lcd from adafruit and give feedback via colors based on wether the climaduino was heating or cooling <br><br>Now to figure out how to get code inserted for it to my heating / cooling using a 2nd relay :D</p>
<p>Could you share the code for heater only? Or give me a hint on what to change? I am going to use this to run a pellet stove in Oregon, so I won't need any of the cooling function</p>
<p>apt-get install libpango1.0-dev libxml2-dev<br>For people getting problems with python-rrdtool setup</p>
<p>I would love to use this to control a Trane Electric Furnace and AC Compressor combo. Any thoughts or advice before I dive in?</p>
<p>This looks brilliant - exactly what I want to do. The only addition I need is hot water control. Do you think the arduino is capable of controlling that as well?</p><p>Thanks, Duncan</p>
hi, <br>i am stuck @ step six - setup the controller unit. <br> <br>i Run: <br>pi@raspberrypi ~/climaduino $ python manage.py syncdb <br>And Get: <br> <br>Traceback (most recent call last): <br> File &quot;manage.py&quot;, line 8, in <br> from django.core.management import execute_from_command_line <br>ImportError: No module named django.core.management <br> <br>any thoughts? <br>
I just realised that django was not installing it says i don't have enough space. :( <br> <br>I will get myself another SD card and try again. <br> <br>
Hi afalzon. Let us know how it works when you get the bigger SD card. Can't wait to have another person running this so we can work together to improve it.
Hi bbustin, <br>I have now tried a 16 gig card and im getting the same issue. any thoughts? <br>
Hi afalzon, try running: <br>sudo raspi-config <br> <br>then choose to auto-expand the installation. <br> <br>If this works, let me know and I'll ad it into the steps to make sure no one else has the same problem.
<p>hi bbustin, i had already done that. </p><p>i made a new temp folder on my main partition and that fixed that issue. i still cant get it to work though.</p><p>i have a feeling the versions of everything have changed since these instructions were written and therefore some things may need different steps</p>
<p>I found the following steps here <a href="http://www.raspberrypi.org/forums/viewtopic.php?f=66&t=12210" rel="nofollow">http://www.raspberrypi.org/forums/viewtopic.php?f=...</a>. Maybe they would help?</p><p>cd<br>mkdir tmp<br>export TMPDIR=/home/pi/tmp</p><p>(I know this response is very late, but I want to put it here to help others as well.)</p>
<p>I have a quick question, I followed all the steps, the Thermostat with display work fine, I'm able to see readings through the admin on the PI but if I try run the page to view readings I'm getting the following error </p><p>'Manager' object has no attribute last()' </p><p>I'm not using any virtualenv since I plan to have this eventually running on its own. </p><p>Any suggestions ?? </p><p>Thanks in advance </p>
<p>Hi. I think this is because there are no readings in the database. Try going to <a href="http://climaduino.local/admin/settings/reading/." rel="nofollow">http://climaduino.local/admin/settings/reading/. </a> Then click add reading and add some bogus values. The trick will be to see if this updates with the proper readings later.</p><p>I'm in the process of making some major changes. It will work with multiple zones over a WiFi network using the Arduino Y&uacute;n (http://arduino.cc/en/Main/ArduinoBoardYun?from=Products.ArduinoYUN). The newer code will be better about creating default database entries so there is less of a chance the error you are getting will happen.</p>
<p>I tried your suggestion but got same error, I'll try it with the virtualenv instead, perhaps thats the way it works, I'll keep checking if you gonna post a new version, cool project BTW !! </p>
<p>Thanks! Maybe it is because it is missing a setting? If so, try doing the same same thing here:</p><p><a href="http://climaduino.local/admin/settings/setting/" rel="nofollow">http://climaduino.local/admin/settings/setting/</a></p><p>Just create a setting and see if that helps. That page you are going to is pulling data from both settings and readings. Maybe the code drops the ball if one is missing...</p>
<p>thanks again , I'll give it a try </p>
<p>Let us know if that works. I think, as long as there is both a setting record and a reading record, that view should work. I'm just really glad someone else is building this out. I'd be glad to help out where I can.</p><p>Unfortunately I don't seem to be receiving comment or private message email notifications from Instructables. I'll send you my email in a private message.</p>
look similar to : <br>http://www.lucadentella.it/2013/08/07/ambientmonitor/ <br>
Hi IT-Wizard. Thanks for sending me that link. There are definitely some similarities between the projects and some significant differences. <br> <br>Both projects use the DHT22 temperature and humidity sensor (it is also called the AM2302. They also both report temperature and humidity readings using JSON, and have web interfaces that show the current temperature and humidity. <br> <br>They also differ in many ways. The Climaduino Thermostat uses the readings to turn on or off an A/C. In addition to the temperature and humidity readings, it also reports back the set temperature and humidity in JSON. Rather than the JSON data being directly read by a web browser and the graphing occuring there, it is read by the Climaduino Controller program running on a Raspberry Pi. The data is stored so that historical graphs can be generated. The Controller can communicate back to the Climaduino Thermostat to change set temperature, set humidity, and mode. The web interface is served from the Climaduino Controller on the Raspberry Pi.
Thanks for your replies. I really enjoy all these projects, and I am on my way trying to build my own based on Arduino. As I live in Belgium, our needs are different (more heating than A/C) ;o) <br>
My pleasure. Thanks for the comments and pointing out these other great projects to me. There is code in this project that is there for heating, it's just not finished. I could finish that relatively quickly for you if that would help.

About This Instructable


563 favorites


More by bbustin: Introducing Climaduino - The Arduino-Based Thermostat You Control From Your Phone!
Add instructable to: