I've always had a desire to build my own thermostat as I think it would be a practical and useful device for both experimenting and actual use as an HVAC controller.
The last thing I designed/build before 10y break from electronics was thermostat
(bit more complex then the this one as it was to be used in industry but ..). I'm not clear on how far have you gone with it, but, from my exp the software is much harder to implement then the hardware (and I am the software guy)... It is much more complex then it initially looks like (if you want to have some proper control and not to kill the heaters / use too much power ..)
Although I've called the design Cricket from the start this is a much more modern design and here's what I have followed hopefully by feedback and suggestions by you.
/me likes the Cricket name
... IIRC cricket's change the duty cycle (or freq) of the skreeeks related to temperature or humidity... so "proper" name
Eight character 14 segment LCD display with decimal points
PIC18F6390 LCD controller or 18F8490 (I may need the extra pins)
IMHO you do not need to go LCD... It is true that LCD will
- use less power
- emit less heat
But, if you are going to control some heating elements - darn, you are going to sit on the power
, no need to worry about few milliamps... Standard 16x1 (or 16x2) char panels emit next to no heat if back light is off, and you do not want to have back light on all the time... (auto turn off 30sec after keypress)... Much easier to program, many many many many many wires less
and much more functionality. Not to mention the ability to choose among many more uC's to get the "right one for the job" as here you are pretty much limited to few pic's with LCD controller.
I2C temperature IC LM75A or equ.
I used mostly 1wire temp sensors as it allows much longer distances then i2c. What I would suggest if you really want to make "fancy" and "usable" device is to:
- use one onboard temp sensor
- use one "attached to device via wire" temp sensor (1wire digital protocol - you can attach more then one device on this bus)
- add a receiver that can receive data from remote wireless sensor (2+ canals)
Let me elaborate on the last point. If the room is big enough, one point for measurement is not enough and sometimes, due to technical difficulties, architectural stupidity or any other reason the actual device has to be mounted on place that is "wrong" to measure temperature for the room it is controlling.
You can then have a menu that
- can turn on/off any detected temperature sensor
- add "weight" to every active sensor
so the "real" temperature you are monitoring is temperature that is calculated using data from all sensors using the weight algorithm.
Now, with regards to "receiver" for the device, you can go IR (death easy / cheap) but that put's some limits to the device or RF which is bit more expensive and not that cheap but then you can have also the "outside temperature" sensor that do not have to affect the indoor temperature monitoring / thermostat operation, but can be displayed on the device
(very useful option IMHO)
I2C RTCC with battery backup or trickle charger eg: DS1340
RTCC - always
.. DS1340 or some other .. does not matter much
5V Simple Switcher supply eg: LM2675
RS485 communications
ICD debug support
I'd add IR receiver for remote control .. maybe even 2way IR (so you can build remote control that will have full control over device, menu's etc..)
How many relays? 3 seems enough for 1 Heat & 1 Cool
I'd go with more then 3 in total ...
3 different ones for heating elements (as you might be able to measure temp in different points of the room, you need to be able to control different heating elements)
1 relay for cooler + Pulse for cooler (just a pulse for on/off)
1 relay for fan (if too big temperature difference between different parts of the room - you turn on fan)
Switching relays (very low power consumption) vs standard?
IMHO - you are sitting on the mains ?! why waste money
How many buttons would be the minimum to run a thermostat?
I'd go with
1x rotary encoder (to change value up/down, move trough menu left/right)
1x menu/select button
1x reset button (hidden behind the device)
for what ?! to "authorize" before you make changes?
User expansion? Analog / I2C / digital?
what is expansion ... I already noted I'd like to have one wire interface for additional sensors and RF/IR interface for additional wireless sensors ... 1wire is kinda standard so I'd not go with i2c/spi/rs* ...
Wall mounting options? Case?
you need
- power (2-3 wires)
- relay contacts going to "big relay's"
so, you probably need to have "mounting box" inside the wall and your device "on top of it" ...
Would you like to build your own thermostat?
bin there done that
Regarding power, I'd add a 12V DC source inside (you have to assume you will get 110/220V AC so you need PSU) ... you will need 3V or 5V to power the uC and rest of the board, I suggest you add a 12V DC source inside the box so one can feed that 12V directly trough onboard relays to power the "big relays".
Few "extra" option I'd put there:
- data logger (some i2c eeprom storing data once every 15 or 30 minutes)
- IR A/C control
(you would need to record some IR commands from A/C remote controller and then you can send them from device controlling the A/C via IR)
- more relay's + more sensors + more complex software - controlling temperature in all rooms in whole house
Yes, I assumed SW will enable things like "18C 06:00 - 08:00; 26C 08:00-09:00; 24C 08:00-03:00; 12C 03:00-06:00" as I do not believe tha i2c RTC is just to display time on display