The last thing I designed/build before 10y break from electronics was thermostatI'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.
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.
Eight character 14 segment LCD display with decimal points
PIC18F6390 LCD controller or 18F8490 (I may need the extra pins)
I2C temperature IC LM75A or equ.
RTCC - alwaysI2C RTCC with battery backup or trickle charger eg: DS1340
5V Simple Switcher supply eg: LM2675
RS485 communications
ICD debug support
I'd go with more then 3 in total ...How many relays? 3 seems enough for 1 Heat & 1 Cool
IMHO - you are sitting on the mains ?! why waste moneySwitching relays (very low power consumption) vs standard?
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?iButton support?
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* ...User expansion? Analog / I2C / digital?
you needWall mounting options? Case?
- 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" ...
bin there done thatWould you like to build your own thermostat?
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
Glad to be of helpWow thanks arhi, great stuff.
that is true, they are cheap and "new" to most. Problem is they are fairly "fixed" (not that easy to display txt) althoe you mentioned 14seg "digits" .. that's actually able to display txtThe LCD makes the kits more attractive and I hope kitbuilder will learn how to use a probably unfamiliar technology.
They are extremely low power and inexpensive $4 digikey 153-1113-ND dumb
nice .. I made logger (for my dad, he have some big headache problems) that logs pressure, inside temp and outside temp every 30min .. (only 5leds to show current pressure level, but you connect to usb and download data) .. uses spi pressure sensor (it has temperature sensor built in) and external 1wire sensor for outside temp.... I put largest eeprom I could find in the drawerMore EEPROM yes, that's easy since it's I2C so I'll make sure it's in the design.
IR easy, I put it on most of my kits now. And 1 wire (great stuff) is a simple I/O pin. I'll try to keep RA0,RA1 available for user expansion.
no need for larger packages .. and that is sure way to push hobbyist from the kit as there's not a normal person (yes I know most of us are not normal) who find soldering TQFT relaxing.As for more relays yes but I'm running out of I/O (the 128segment LCD uses more than 40pins! including bias) and I'd like to avoid anything larger than a 64pin TQFP as they can be a bear to solder for the unfamiliar...
donno about that hw encoding, but decoding rotary encoder should be fairly easy. Find some that you find interesting and post a link to datasheet, I'll help you with C18 decoding routine ... (I noticed that you did not make use of IR encoders on the mongoose project of yoursRotary encoders sound like fun, I've got one but never wrote firmware to use it. Some PICs can actually do quaderature encoding in hardware.
I agree the software is the tricky part, that's why I make educational kits. The 18F6390 Has 8K words Flash & 768bytes RAM.
the LCD PIC does all the driving automatically
#define _ENCA PORTA, 5, acc ;encoder line A
#define _ENCB PORTA, 4, acc ;encoder line B
#define _ENC1 wheel, 5, acc
#define _ENC2 wheel, 4, acc
#define _OLDENC1 old_wheel, 4, acc
#define _OLDENC2 old_wheel, 5, acc
#define _FIRSTWH wheel_stat, 0, acc
;trackwheel
wheelfun
btfsc _FIRSTWH
goto firsty
movf PORTA, w, acc
movwf wheel, acc
andlw b'00110000'
xorwf old_wheel, f, acc
bz wheelout
btfsc _OLDENC2
goto ao_b
btfsc _ENC1
goto bo_a
goto bo_b
ao_b btfsc _OLDENC1
goto wheelout ;noise filter
btfsc _ENC1
goto bo_b
bo_a btfsc _ENC2
goto cw
goto ccw
bo_b btfsc _ENC2
goto ccw
cw decf wheel_dat, f, acc
goto wheelout2
ccw incf wheel_dat, f, acc
goto wheelout2
firsty bcf _FIRSTWH
movf PORTA, w, acc
andlw b'00110000'
movwf wheel, acc
wheelout
movf wheel, w, acc
andlw b'00110000'
movwf old_wheel, acc
retlw b'00000000'
wheelout2 ;indicates changed data
movf wheel, w, acc
andlw b'00110000'
movwf old_wheel, acc
retlw b'00000001'
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?