First serious imp project - The Thermostat

Well, I have created my first serious project with the imp: A Thermostat! It is awesome. I am currently enjoying the fruits of its awesome wireless coding and agent power. Love it!

This is, of course, the first version of the thermostat and is quite limited in terms of IO. Here is my layout:

Pin 1 and 2: Dallas One Wire I2C (using one of the solutions found in this very forum)
Pin 5: Fan Relay
Pin 7: Cool Relay
Pin 8: Heat Relay
Pin 9: Not used yet! (Probably will hookup an analog trimpot or another humidity sensor)

I wanted to but couldn’t do the following due to the limited IO:
SPI LCD
LCD pushbuttons
Motion Sensor

Well, I guess I could have hooked up the Arduino as a serial IO expansion board and used the “Cmd Messenger” library, but, I just wanted to see how far I could get with just the imp! I know it sounds reverse but coding on the imp is wayyy cooler.

I used a relay board from DFRobot: http://www.dfrobot.com/wiki/index.php/Relay_Shield_for_Arduino_(SKU:DFR0144)

I uploaded the code to github: https://github.com/ozzieg/electric-imp-Thermostat

I attached some pics of it.

Notice the large gap for a display that I can’t have just yet. I will probably put an arduino there and re-shuffle the relay outputs.

You could get an I2C display from Adafruit? That’d fit on pins 1 & 2 too, and they have versions with 5 buttons - so you get display and UI without using any more imp pins:

…then you have pin 9 free for the motion sensor :slight_smile:

Nice! Every time I walk past my thermostat I think it might be a project to jump into. It would go nicely with my “Pitchfork” app.

I’ve been hacking arduino shields as well to use the with Imp. If you need more pins, get an imp002 from smartmaker. They are pretty easy to hack into the Adafruit screw shield.

I’ve been working on an imp shield with a relay, but I am totally new to the process… maybe if there were a few interested and knowledgable parties we could get a design and order some bulk boards to keep the cost down. I’m going to keep trying to get Adafruit to actually make one as well. :slight_smile:

Also, I used the serial LCD from Sparkfun… only uses 1 pin, AND (most importantly)… someone already wrote code for it! My n00b Squirrel skills aren’t quite talking I2C and SPI yet…

Aha! Great suggestions! I didn’t think that there was a display to chain on the I2C! I will have to try that out and see how it works. Awesome!

I looked at the smartmaker one, too. For the I2C, just look at the code I shamelessly took from someone else on the forums. Very easy to put together as far as electronics go…I will put up a fritzing one of these days.

I just looked through Adafruit’s library for the I2C chip and RGB shield. It looks like it will be a bit of trial and error work to port it over. But nothing is fun unless it is challenging, I guess.

Any idea when “libraries” will be available for the IDE?

@jwehr a good starting point may be the seeedstudio relay shield - http://www.seeedstudio.com/depot/relay-shield-p-693.html

I’ve use it with the imp and it works well (but does burn a pin per relay instead of using something like I2C)

This is my first shot an an impee. Nothing fancy, just a relay circuit on pin 9, and then the rest broken out to screw terminals and male headers, with a bunch of GND terminals for connecting sensors. Designed with my “Pitchfork” projects in mind.

Still working on it… and I’m at the hard part now…

Sorry for totally taking this thread on a tangent…

Hehe, no worries…looks cool! I am not yet at the point of customizing a board. I want to lego everything up first and then reduce it later.

I am still tweaking the PID values, deadband, and cool on/off times to get it just right. I have to push some of the data to my database.com account and run some reports to see how well it is behaving.

Nice, Ill take a look at your code and see if I’m up to talking the project.

@jwehr if you’re using the DCDC from the april, the layout might need some attention there - the inductor is a long, long way from the DCDC chip. You should attempt to copy the layout from April as closely as possible.

However, given that you have a relay you may not be worried too much about power consumption, so going for an LDO for the imp 3.3v is probably fine - look at the Amber board for an LDO example.