3/15 - score: 9.5/10  great!

2/22 - score: 8.5/10  your project seems to be progressing nicely.  Your OLDJ is good but updating got a little sparse since last check.  At some point you will need to make a quality version of the hokey red component slide for this journal and your poster so that viewers will be able to quickly grasp what you’re doing.

2/1 - score: 9/10  keep it up!  good daily entries.  i’m still not seeing that overview drawing of your entire setup... very important for understanding.  Get that in here soon

1/19/13 - score: 9/10  Very nice work!  you should include a summary of your proposal here as well. I’d like you to try posting your code elsewhere for clarity - either with GoogleCode (i’ve never tried) or simply in another folder on Google drive with your name on it.

Online Album: https://www.icloud.com/photostream/#A3JtdOXmGndJqe

                Code is in a separate doc along with my proposal

Smarter Thermostat

Description of project:

My project will be  a complete remodeling of how a person communicates with their household. My aim is to create a phone app that will allow a user to control appliances such as their thermostat lights and even coffee maker. This will create a more  convenient lifestyle very quickly and I plan on adding complexities to the project once I have it communicating such as the ability to turn on when the phone is within a certain distance of the house pattern tracking and perhaps incorporate the power outlets making virtually everything controllable.

Basic Outline:

I will begin by creating a functioning communication system with the Electric Imp and Arduino that is able to do simple communications. I will then expand this to controlling the  thermostat. Once  I have it functioning I will begin to create a more complex logic for the controls that will recognize gps locations and patterns. Finally I will incorporate light system

Parts outline

Servos 5 $ each already have these

Arduino 30 $

Light socket 15$

Electric Imp 30 $

Arduino shield 10$


Have researched into methods of communicating between microcontrollers and devices over the internet

        Electric imp seems to be the easiest method of communicating

        allows you to operate arduinos over their server and easily create apps for both android and iphone



Received the Electric Imp and soldered the Imp shield together. Plugged in the card and was able to see some responses from it but haven’t successfully connected it to the internet yet

for pi

1/18Finally got the electric imp connected to the internet.

Doesn’t seem to work on the school’s wifi but have it connected to houses wifi

Can now use the online planner


The program hello world is now functioning. displays the message hello, world! if imp is connected


Can now control an LED off of a computer anywhere

researching temperature sensors


good example codes



ordered temperature sensors for online monitoring




Ordered temp sensors for monitoring.


attempting to run a program that tracks an analog value

will upload the code when functional

found a way to create a graph with the data]

researched cosm as a way of storing data for the project



beginning to investigate the usage of cosm

        it appears to be an easy way of taking information over the information and displaying them in visuals like graphs

it also appears to be good for creating computer applications

Is able to send info to another graph

What Cosm does

Cosm allows me to easily upload data to a website and create visuals like graphs


creating a cosm interface currently

adding a key into my electric imp program






 Have gone back to basics with the temperature sensor in order to ensure its functionality

        the serial monitor on the arduino is now displaying the temperature in farenheit and celsius along with the raw data.


have posted the code for the arduino temperature sensor on the code page. it is accurate to about 2 degrees. I will be callibrating it today by changing the ratio and using ice to give me a known value


Have gotten the sensor working more accurately


Researching methods of sending a value from an arduino to an electric imp so i can take the value from the the arduinos temperature sensor using serial communication.


updated code

2/4 wired the arduino for communication between imp


Trouble shot the fact that the a0 wasn’t working using a multimeter. it appears that the shield is causing the problem because a0 works with the arduino but not the shield... I therefore switched the sesor to a1

Need to research the serial communication between arduino and electric imp.


Researched usage of the imp and the programming language is not at all logical... so I’m planning on doing the majority of my programming with the arduino and then just using the serial communication


Have gotten the serial communication between the arduino and the electric imp working. If I type something into the serial monitor on the arduino it will appear on the electric imps Icon on the internet which means I can also push the value to Cosm. This means that I can send the Sensor value to the cloud easily. :) Will post the code shortly. I cut the example down to a quarter of the length

Pic of logic behind project


my program is using ascii to transfer

need to figure out how to convert ascii or just send it as an int


the communication is now sending integers instead so I will shortly be able to send the actual temperature

Check code section for more info on the code

the online planner is now displaying a value depending on a potentiometer. Now I just need to get it working with the temperature sensor which shouldn’t be too hard considering I have already done that.


the sensor is now working and is displaying the temperature over the internet. This is a huge leap for my project because I can now do all of the main parts

Got my first interested customer


Did some research into controlling the imp from a phone and this website has some useful information on how I could create a website to do this.



downloaded Android app development kit and am working on the tutorials


have installed the drivers for the phone to run the app on the phone instead of the simulator

have a basic android app working on my phone

I am able to enter a number into it and it will send the value to the http address that I provide it. This will send it to the electric imp


Have uploaded my code into the document for my java application

Did the code from the tutorial

Highlighted the changes that I made from the tutorial

Have added servos to my program so that it will compare the value received from my phone and the value currently and push the buttons until the values are the same therefore I will be able to control the thermostat.

I will upload the code as soon as I have debugged it


I have added my servos into the program and debugged it

It is now in the program doc

I’m now looking at how to communicate the data from my phone.


Have looked into how to control a home thermostat with an arduino and ran across this which makes me reticent to attatch the arduino to the furnace and ac directly servos would make it difficult to

1. You need a fail-safe turn-on device (usually a mechanical bimetal switch at around 40 deg.F) to call for heat. Otherwise, your pipes can freeze if the thermostat fails.

2. You need a fail-safe turn-off device (again, often bimetal). Otherwise, it can overheat your house if the thermostat fails on.

3. Furnaces have elaborate fail-safe protection so they can’t turn on the gas flow without proving the burner has lit. They typically try to light a few times, and then “lockout” to require human intervention to check it and fix the problem. The lockout is reset by removing the call for heat, and then re-establishing it. If your thermostat does this on its own, it can DEFEAT the safety lockout, and flood your home with unignited gas!


Have looked into developing my app on an iphone instead and it appears that it may be easier.

From what I can tell the iOS app dev software is much more user friendly and hopefully will speed up this process. In the meantime I am planning on doing some research into pattern recognition for the temperature.


After some further research, I have found out that it requires a mac to develop and in addition, you are required to have a license which costs 99 $ a year to use.

I may have a friend who has the license and could get me started, the only other option would be to illegally boot a mac system on my computer

3/4 I am working on creating a more logical version of my flow chart for my poster and design journal to make it easier to see how the whole system interfaces with itself.

I have been researching into how thermostats work. They only have 2 wires usually, but they also have a lot of hardware in them that is used for safety purposes. I suppose that I wouldn’t have worry about this for my prototype, but there are a lot of safety hazards that I will have to research in depth with regards to things like emergency shut switches and various government requirements and recommendations.


worked on poster and created a prototype of my servo pushing, i have something that will push the button on the thermostat using servos. Now I just need to get the code working properly to send the value from the android app and comparing the values.

Made diagrams and flowcharts to better explain the logic and basic notion of my project.

Did some research into how to use gps... I think I’m going to use this piece of code and then the app will be able to calculate the phones distance from home and make any needed adjustments.

3/7 Have updated the photo album with some more pictures and am designing case for the thermostat to try printing on the 3d printer


 Made a clearer diagram of how the thermostats communication works

made flow chart


Talked to Gary about being my mentor. He says that he has a lot of the programming knowledge that I need for doing things like AI and GPS intelligence and possibly modifying the program of the other app.

His main experience is in Java and C++ which would be very good for my project.

For my plan on this project, I plan to spend a long time over spring break on this and make a working one which can push buttons on my thermostat and recieve a value from the phone. This will act as a proof of concept and from there I will be able to start making one that works like a normal thermostat and attatches directly to the house.


I am working on the servos currently to make them work with pushing with the buttons, I have them reacting, but it doesn’t seem to be working properly.

I will post a video of them once I finish debugging the program

After some more work with the servos I realized that my random number generator to simulate the temperature wasn’t working which was giving me issues. I asked my parents about this and they seemed to think that it was an overwrite issue. I have been unable to fix this, but I think this isn’t necessary to fix since it is just simulating the signal being received from the phone. The servos are working though if I give it a specific number of times to move. I just need to figure out the issue with the logic.

The servo now prints how many times it will push so I should be able to get the subroutine working now.

This is my application. I plan on getting some help from Gary to get it working since I don’t have that much experience with java and that is his main language

Outside is retrieved over the internet from Accuweather and then I still need to hook up the inside condition to receive the temp from the electric imp server.

This was the initial version of the app



Here is my video  of the servos working as button pushers

I have tested it and it pushes the button consistently.



I now have a code which will send the data through my basic app through http


I have decided to get my project working with my simple app currently since I don’t have too much experience with the programming language. Once this is working the new app that I have will be able to copy and paste the code over into a location which I will have to find. Looking through code for the app I found online, I believe it stores the overall temp as a variable so I would be able to just send this.



Worked on the fabrication of the servo pusher today. I am using double sided velcro to attatch it to the thermostat. I have tested it’s ability to stay attatched and I believe that it will work. I now need to go to Joanne’s to buy some elastic so that I can wrap it around the thermostat to help me push the buttons. I am also working on the code to send the

4/9 I have done an outline of the rest of my project and how I plan about doing it now. The next step is to get the information communicating. I looked into COSM for the overall .project and transferring info and while it might be useful for tracking over the computer it is useless for transferring data between the app

Later at home I made a HTML website and IT IS SUCCESSFULLY SENDING THE DATA THROUGH TO THE WEBSITE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I can now update the temp :)

I now need to figure out the HTML for displaying the measured temp

the HTML code is posted in my code section


Today I was able to publish the HTML to a website on free webs. It is still succesfully sending the integer to the electric imp. This means that I will now be able to recieve the value from the electric imp website

To see the website look here:


I am looking into transferring the data by cosm to the website but haven’t found the code yet to do this


Pics of website





Working on the code, the value from the html is now being recieved consistently I worked out that tit was a bug for when just pressing enter instead of clicking on the button. I am now working on the temperature sender so that the html will send to the arduino where it will be useful

Using program sweep_w_funcs

the program is now able to transfer the integer without the excess info such as channels. To do this I edited the HTML program to get rid of the channel parameter.


Today in class I fabricated a servo pusher which is successfully pushing the buttons. I may need to use a stronger way of attatching it though like glue since it is a fairly stiff button. I now know the value that it needs to go to to make the button push.

Picture of the Button pusher

I couldn’t work on the programming this weekend because there was a bug with the website and it couldn’t recognize the electric imp connecting, which meant that it couldn’t compile the software

The servo needs to be set to 43 in order to press the button according to the serial monitor


I rewrote the program for receiving and transferring the data because I realized that it would be overloading the data transfer. Now it will only transfer every specific time interval which will be easily  modified. The program is now much shorter, and will hopefully allow it to actually communicate the sent data.

The servo button pusher is just about working, There are some bugs though with the variable, because it doesn’t always return to the same position.


The website is still transmitting the data, so I have fixed the bug that was occuring,  but I am having issues with the arduino transfer, once I solve this problem, I will only have to complete the transfer through HTTP Request and the button pusher will work. Then I will begin looking at hacking into the hardware of an actual thermostat.

HTTP IN working again.


Something has gone wrong with my electric imp. I am not able to connect with it and it isn’t displaying in my planner. I am trying to get it to work, but it is proving difficult. I think it might be an issue with account recognition.

After spending a good 30 minutes trying to debug this, I found someone on the forum who had had a similar problem with there project. After reading it, I entered a simple piece of code to get the imp up and running again.

The electric imp code is now working again transferring the temperature using the code thermostat1 on the arduino and using TX2 on the electric imp

The problem in my code was an extra set of parenthesis causing it to fail to compile

IT’S WORKING, the arduino is now recieving the variable sent through from the HTML which means that all of my communications are set up. I just need to get the program finished

the current programs are thermostat1 on both the arduino and electric imp.

thermostat1 is a modified version of TX2


I tried to set up my PHP on my website, but according to the website it is not supported. I am trying to setup my website on a different which will work with PHP to allow me to send data to it.


Over the weekend I worked on my program attempting to combine my servo pusher program with my data transferring program. I was successful in that the temperature is being transferred and starting to push the correct servo except the servos keep pushing because there is a logic error causing it to just keep on pushing until the temperature is correct which would not be helpful. Other than this bug though, my program is working as it should. I think I can just add a simple counter that will

5/7 debugging program

I am having difficulty getting the cosm insert into the html code. I believe that Freewebs is blocking the incoming signal because they can’t support a signal in PHP format. I have found a number of sources stating the different that it can and can’t. My next idea is to just put a link to allow me to easily get to the graph on cosm. This wouldn’t really take away from it especially since cosm does such a good job of visualizing the information in an easy to read format.The mobile site is now up and running. It fits nicely onto the phone screen and gives a good visual.

Went through my program this evening to look for problems

I found some problems and the program is working a little bit better. I think I’m getting some interferance from issues with the serial communication continuing to send numbers. I need to do some research, but I believe the flush command may help fix this problem. I am going to talk to Gary to get some help with this.

I have posted the program in the code section.

5/14 I am working on getting cosm working again. With my luck they have recombined into a new organization which means that the entire interface is new and I lost all of my settings. The new webstie is called Xively.


I have just gotten the Xively interface working. I am researching into getting an insert of the graph into the website, otherwise I will just have to put a link to send a link.


I am working on cutting the arduino out of the project so it is more cost effective and I believe that the inconsistencies that are happening in my program are coming from the inconsistencies with the serial communications. I have the electric imp taking in a signal from the website so that I can control the servo from anywhere. Now I am setting up the temperature sensor so that it will be able to do what the previous one did. if this all goes well I might have it up and running by Wednesday. It will be much more cost effective as well

I have now spent about 5 hours working on it today, and I have the temperature sensor working with the electric imp instead of the arduino, so I have now proven this to be possible since I already have that code working. Now I would just need to run the electric imp which would cut the cost down to about 40 dollars instead of the 79 it was before :)

Final summary

This project still has great potential to grow. The thermostat is capable of many additions such as GPS and pattern recognition that would greatly enhance the usability of the product. With correct computer sciences knowledge, one could add features such as artificial intelligence using pattern recognition to create a schedule which would constantly react to the users settings. I plan on doing finishing the programming side of this project next year so that it will incorporate all of the scheduling I mentioned above. I have already talked to gary and he has approved this for my final project saying that array knowldedge learned in the class will help with pattern tracking.

This project has given me a much better knowledge of programming, and has sparked a much deeper interest for computer sciences for me.

Here is an image of my final poster