Pages: [1] 2   Go Down
Author Topic: Home Heat Thermostat - 7day prog., IR control, Graphic LCD  (Read 8431 times)
0 Members and 1 Guest are viewing this topic.
BC, Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey everyone,

I used this site a fair bit while building my thermostat, and like many others I enjoy seeing the finished project so here's mine.

All of the progress (with pictures) was documented here: http://mcmicken.ca/tag/arduino-thermostat/

The thermostat is used to control my gas fireplace (millivolt switch) and main living space baseboard heaters (two units controlled by an internal relay).

Features:
  • Graphic LCD
  • Infra-red Control
  • 7 Day Programmable Schedule + Ad-hoc Mode
  • Temperature Graph + History
  • Fireplace Manual Override

Components:
  • Arduino Mega 1280
  • KS0108 128×64 LCD
  • IR Receiver (unknown type)
  • DS1307 RTC
  • DS18B20
  • Light Dependent Resister (generic)
  • 4 Channel 5V Relay Module (ywrobot from ebay)

The result:


There's tons more pics on my website, and if anyone has questions or wants the code shoot me a PM.

**edit** I've posted the code here: http://mcmicken.ca/arduino/Thermostat_V1.html

- Graham
« Last Edit: December 14, 2011, 12:51:03 am by gmcmicken » Logged

New River, Arizona
Offline Offline
God Member
*****
Karma: 16
Posts: 906
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Nice job.  I like your display.  I did something similar, but like all these projects, I took a different philosophy.  I only made the thermostat semi autonomous, it's web enabled so it grabs the time from a GPS clock I have (different project).  I took my power from the control system for the air handler I have.  I decided to allow mine to be controlled from something else and that way I can set in my easy chair and use a web interface to change stuff.  I also have another controller that can time things and change the thermostat settings.

The really cool thing about projects like this is that when we think of something else we want to do, we can do it.  We don't have to buy a new device, just reprogram the old one.
Logged

Trying to keep my house under control http://www.desert-home.com/

BC, Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yea for sure, cutting a hole for usb on the side was a must. Now I can re-program it whenever an idea strikes.

I thought about doing the networked thing, but came to the conclusion it would be more novelty than function, since I could achieve everything it needed to do being a standalone device. Maybe in the future I'll add wireless and build a few slave thermostats to be controlled by this unit for other rooms or something  smiley-grin

I'm interested to hear how you did your power, I really wanted to "steal" power from the 24VAC relay wire but it was getting too complicated and then the kicker was my relay board drawing ~150mA.



Logged

New River, Arizona
Offline Offline
God Member
*****
Karma: 16
Posts: 906
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I just used a voltage converter to go from a rectified and partly filtered 37V down to 9 or so.  The 24V jumps up to 37 when you rectify and filter it....  I also used 30ma 5V relays to run stuff.  These little guys are cool and don't actually need a buffer transistor to work.  It's a good idea to have the transistor there though to keep the load off the arduino.  The details are on my blog, see the signature line.
Logged

Trying to keep my house under control http://www.desert-home.com/

BC, Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I just checked it out, funny I actually read through your blog before I even started this project. I was originally going to choose the same case you did but realized I wouldn't be able to squeeze everything down into the receptacle area. Everything just barely fits into the WM56 I used!
Logged

New River, Arizona
Offline Offline
God Member
*****
Karma: 16
Posts: 906
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You do realize I cheated...right?  I opened the wall and there was this great big ol open space back there.  So, I built a shelf inside the hole and mounted all the component on the shelf.  Then, the front is nothing but a faceplate covering the hole in the wall.  This also provided air flow and a nice place to fold cables around in.  I have a USB cable in there for programming that I pull out to plug into my laptop.  I like your idea of a plug better though, I'll have to look into that.

Heck, since there's no line voltage in there we can do most anything inside the wall.
Logged

Trying to keep my house under control http://www.desert-home.com/

BC, Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well that's just it - I couldn't steal power so I needed line voltage. The Canadian building & electrical codes are kind of strict too so I had to have a CSA certified receptacle, which couldn't share any space with low voltage stuff... and was also sealed from the wall cavity.

So, either I had the wall wart plugged in to a visible receptacle with a pass-through into the wall cavity for the low voltage wire, or I mount a recessed receptacle with the PacTec enclosure over top. I chose the latter.

Logged

New River, Arizona
Offline Offline
God Member
*****
Karma: 16
Posts: 906
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ah, I see.  If you ever go to using ethernet to talk to it, consider power over ethernet as a way of getting power to it.  That way you can hide the power supply somewhere and just use the power at the end point.  Where I am, I could put a power plug inside the wall, as long as there is a way to get to it and it had a proper containing box, wiring, etc.  So, one of my neighbors put a plug in the wall behind a picture and plugged in the lamp that lights up the picture there.  I've seen this done with wall clocks also.  There's this plug mounted on essentially a shelf cut into the interior wall with something over the top of it that needs power.   Hmm, that would be a cool way to mount a digital picture frame, or a tablet, or a.....

Thanks for reminding me.

I'm jealous of that cool display you have though.  Nice job.
Logged

Trying to keep my house under control http://www.desert-home.com/

Cardiff, UK
Offline Offline
Jr. Member
**
Karma: 0
Posts: 69
Programmer of all sorts
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Great work with this project!  I love the clean display and enclosure.  I'm goning to check out your blog later today and find out how you did it. smiley  I think the physical side of it like making the enclosure is where my skills lack smiley-sad

I've been programming something similar; a central heating controller with an Arduino ATMEGA 1280, LCD screen like yours and an ethernet shield.  The idea is that the scheduler program is a PHP script which runs at regular intervals (on a web server somewhere in California) and this sends commands to the Arduino via HTTP requests.   I've made a working basic prototype; i.e. controlling an LED on the Arduino by sending commands from the server using the PHP CURL library.  With the screen I hope to display the current whether using the google weather web service, current news using BBC news RSS (TinyXML lib), current time using NTP, etc.  I'll post my results when complete. smiley-cool   I shall put the arduino near the boiler but was also thinking having a wireless thermostat with temperature display somewhere else in the house.  I'm not sure if I have the skill to pull it off though smiley-eek

I've seen quite a few central heating controllers and they're all completely different!  Do you have any advice to offer about general building/programming?   Is there anything you'd do differently if you rebuilt it?
« Last Edit: October 04, 2011, 12:32:29 pm by supercrab » Logged

My Arduino 7 segment LCD/LED library

http://code.google.com/p/arduino-seven-segment/

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 121
Posts: 8452
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Very professional-looking project.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

BC, Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Great work with this project!  I love the clean display and enclosure.  I'm goning to check out your blog later today and find out how you did it. smiley  I think the physical side of it like making the enclosure is where my skills lack smiley-sad

I've been programming something similar; a central heating controller with an Arduino ATMEGA 1280, LCD screen like yours and an ethernet shield.  The idea is that the scheduler program is a PHP script which runs at regular intervals (on a web server somewhere in California) and this sends commands to the Arduino via HTTP requests.   I've made a working basic prototype; i.e. controlling an LED on the Arduino by sending commands from the server using the PHP CURL library.  With the screen I hope to display the current whether using the google weather web service, current news using BBC news RSS (TinyXML lib), current time using NTP, etc.  I'll post my results when complete. smiley-cool   I shall put the arduino near the boiler but was also thinking having a wireless thermostat with temperature display somewhere else in the house.  I'm not sure if I have the skill to pull it off though smiley-eek

I've seen quite a few central heating controllers and they're all completely different!  Do you have any advice to offer about general building/programming?   Is there anything you'd do differently if you rebuilt it?


Trust me, I'm a fool when it comes to enclosures. I've had countless bad dremel encounters! Actually I don't know if I've ever been satisfied with a project when I used a dremel... So this time I used a razor knife and scored the LCD outline repeatedly until I had a nice groove. Then I heated up the blade and cut through it. It wasn't without fault, I slipped a few times and dragged the blade across the face of the enclosure but that's when I decided to sand and paint it. Really I could have messed it up pretty good and the sanding and painting would have saved the day.

As for the actual programming - I'm pretty content with it. If you read my blog you'll see what I did (and I can give you the code if you wish), I chose a 5 min timer to perform temp analysis and heat control. That way if the temp bounced or something the relays wouldn't be abused. Heat comes on at .4 degrees C below the set temp, and goes off .35 degrees C above the set temp. I wrote a little function to calculate the temp rise slope and set a pre-emptive off timer in case the heat were to rise too fast, but right now I have it commented out because I'm not sure it's necessary.

The bulk of the code is in all of interface and display functions. Libraries really helped me out to keep the code size down but even so, I'm over 1000 lines after removing as much duplication as I could.

I went the route of a standalone system so I'm using a real time clock, it sounds like you might have to do some trickery to get your time working nicely. Without an interrupt and with variable HTTP call duration, you'll need to retrieve your time then start counting locally with the arduino, then update it every once in a while. Unless you're only showing the time on-demand in which you can just retrieve and display a static value.
Logged

Cardiff, UK
Offline Offline
Jr. Member
**
Karma: 0
Posts: 69
Programmer of all sorts
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the tips regarding the enclosure!  Fortunately, I don't have a dremel so that's one less tool nearby which could potential ruin a nice build smiley-wink  I think I'll the try the-score-and-hot-knife-method but I reckon the results will probably depend on the thickness of the material used - hopefully I should be alright..

I've had a look for cases and I think I'll probably go for a 2 gang plastic back box and blank faceplate the type you get here in the UK for mains wiring.  These come cheap and cheerful (£2ish) but are also quite brittle so we'll have to see how I get on.  The bonus of using these are that they're easy to get hold of and cheap to replace.  This'll will be my first effort of enclosure making.

I read your blog and saw your video description.  I loved the temperature graph and the setup screens looked like even a girlfriend could use!  I take it you converted the icons into arrays and stored them in PROGMEM.  Did you make import your own fonts too as I don't seem to have those in my version of the GLCD library?

I think they hardest thing so far is actually getting my own requirements set in stone!  I think a temp graph would be a real crowd pleaser but my device is not going to be where a thermostat should be and I can't monitor there.  I could send temperature information wireless from another device but I'm afraid that'll probably have to be another project!  I think your light sensor for dimming the diplay is nice touch smiley

I have my time sorted thanks to some NTP code which I took from the Time library examples and put neatly into a class.  It will update itself once every few hours and on startup.  I should leave this running for a couple of days to test it really.

I'm looking forward to programming the display but it's also quite daunting especially looking for some nice icons that look in 2 colours!
Logged

My Arduino 7 segment LCD/LED library

http://code.google.com/p/arduino-seven-segment/

BC, Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I've had a look for cases and I think I'll probably go for a 2 gang plastic back box and blank faceplate the type you get here in the UK for mains wiring.  These come cheap and cheerful (£2ish) but are also quite brittle so we'll have to see how I get on.  The bonus of using these are that they're easy to get hold of and cheap to replace.  This'll will be my first effort of enclosure making.

Yea those plates are super brittle. I tried to cut one once and went through 4 or 5 of them before I got it looking ok...

I read your blog and saw your video description.  I loved the temperature graph and the setup screens looked like even a girlfriend could use!  I take it you converted the icons into arrays and stored them in PROGMEM.  Did you make import your own fonts too as I don't seem to have those in my version of the GLCD library?

Yep, the GLCD library came with a bitmap tool that created the arrays and PROGMEM declaration. It also came with all the fonts I'm using... I'm pretty sure it's the most recent version too.

I think they hardest thing so far is actually getting my own requirements set in stone!  I think a temp graph would be a real crowd pleaser but my device is not going to be where a thermostat should be and I can't monitor there.  I could send temperature information wireless from another device but I'm afraid that'll probably have to be another project!  I think your light sensor for dimming the diplay is nice touch smiley

I have my time sorted thanks to some NTP code which I took from the Time library examples and put neatly into a class.  It will update itself once every few hours and on startup.  I should leave this running for a couple of days to test it really.

I'm looking forward to programming the display but it's also quite daunting especially looking for some nice icons that look in 2 colours!

Honestly, I just threw in as much cool stuff as I could think of without really wondering if it was going to work or be functional lol...

The icons were maybe the hardest part, I spent way too long in paint trying to make them good. I'm a TERRIBLE artist and when you combine that with 2 colors... ugh.
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 121
Posts: 8452
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Thanks for the tips regarding the enclosure!
Like when you stuff it up you can always paint over the problem smiley

I find enclosures can be the hardest part of any project, not only machining them but finding the right one.
______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Cardiff, UK
Offline Offline
Jr. Member
**
Karma: 0
Posts: 69
Programmer of all sorts
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Honestly, I just threw in as much cool stuff as I could think of without really wondering if it was going to work or be functional lol...

You're right though!  I might as well load up with features what harm can it do apart from costing me some £s?!  smiley-razz 

If I do decide to also build a wireless thermostat controller that I can take to whichever room I'm sat in, I'm guessing I'd need something like an Arduino Uno, Xbee (or something), LCD screen for temp/function (low power), temp sensor and a couple of buttons.  How long could this thing realistically run on some kind of rechargable battery pack?  Say if it sent temp data every minute and the LCD screen was in low power mode.  Is this thing even feasible?
Logged

My Arduino 7 segment LCD/LED library

http://code.google.com/p/arduino-seven-segment/

Pages: [1] 2   Go Up
Jump to: