BradC
09-16-2007, 11:48 PM
G'day all,
While I'm in the posting mood I thought I'd post my first ever prop project (In fact, the reason I got back into electronics/micros in the first place).
It is my first ever propeller code, so be gentle :)
My servers have their own room with their own Window A/C. This has an old mechanical thermostat in it which is not as good as it could be. (actually, it's complete crap)
Turns out the compressor was on about 95% of the time and it was costing me a fortune to run.
Anyway, long story short. The addition of an SSR (Solid State Relay) in the A/C to control the compressor, an Optocoupler to verify the compressor is powered and 3 DS18S20 temp sensors...
One at the discharge point, one on the intake point and one outside to measure the temperature in the light well, and I had a reasonably functional unit.
It only uses the intake temp sensor for the thermostat functions, but the other 2 are for me to monitor what is going on via the PC.
It tracks total compressor on/off time in seconds, duty cycle in %, a 128 sample moving average of the intake temperature and it reports all this to the PC in a comma delimited string any time
the temperature or compressor state changes. All variables are adjustable via the terminal console and a timed compressor override is built in.
The thermostat communicates with the PC using a USB-serial link (this used to be a www.elexol.com USBMOD4 FTDI FIFO (as I wanted to learn how to interface those) but in the interests
of "eating ones own dogfood" it's just been converted to my USB_Serial_003 CDC-ACM uart).
The code is sparsely (read almost not) commented, so the IO is as follows
Pin 18 is the compressor on signal (inverted) from the optocoupler inside the A/C
Pin 19 is the compressor activate signal
Pin 20 is USB D-
Pin 21 is USB Enable 3.3k to D-
Pin 22 is USB D+
Pin 24 is the Discharge air DS18S20 data pin
Pin 25 is the Outside air DS18S20 data pin
Pin 26 is the Intake air DS18S20 data pin
Pins 0-11 were the USBMOD4, now spare
The DS18S20's are wired in 3 pin mode with VDD connected to +5V on the proto-board, the data lines are pulled up to 3.3v by 4.7k resistors
This little thermostat probably cost me about $50 USD by the time I bought the parts and paid the shipping, but it paid for itself in another week or two (it's been running for about 8 weeks now)
Never know.. someone might find it useful.
Brad
While I'm in the posting mood I thought I'd post my first ever prop project (In fact, the reason I got back into electronics/micros in the first place).
It is my first ever propeller code, so be gentle :)
My servers have their own room with their own Window A/C. This has an old mechanical thermostat in it which is not as good as it could be. (actually, it's complete crap)
Turns out the compressor was on about 95% of the time and it was costing me a fortune to run.
Anyway, long story short. The addition of an SSR (Solid State Relay) in the A/C to control the compressor, an Optocoupler to verify the compressor is powered and 3 DS18S20 temp sensors...
One at the discharge point, one on the intake point and one outside to measure the temperature in the light well, and I had a reasonably functional unit.
It only uses the intake temp sensor for the thermostat functions, but the other 2 are for me to monitor what is going on via the PC.
It tracks total compressor on/off time in seconds, duty cycle in %, a 128 sample moving average of the intake temperature and it reports all this to the PC in a comma delimited string any time
the temperature or compressor state changes. All variables are adjustable via the terminal console and a timed compressor override is built in.
The thermostat communicates with the PC using a USB-serial link (this used to be a www.elexol.com USBMOD4 FTDI FIFO (as I wanted to learn how to interface those) but in the interests
of "eating ones own dogfood" it's just been converted to my USB_Serial_003 CDC-ACM uart).
The code is sparsely (read almost not) commented, so the IO is as follows
Pin 18 is the compressor on signal (inverted) from the optocoupler inside the A/C
Pin 19 is the compressor activate signal
Pin 20 is USB D-
Pin 21 is USB Enable 3.3k to D-
Pin 22 is USB D+
Pin 24 is the Discharge air DS18S20 data pin
Pin 25 is the Outside air DS18S20 data pin
Pin 26 is the Intake air DS18S20 data pin
Pins 0-11 were the USBMOD4, now spare
The DS18S20's are wired in 3 pin mode with VDD connected to +5V on the proto-board, the data lines are pulled up to 3.3v by 4.7k resistors
This little thermostat probably cost me about $50 USD by the time I bought the parts and paid the shipping, but it paid for itself in another week or two (it's been running for about 8 weeks now)
Never know.. someone might find it useful.
Brad