04-06-11, 08:58 AM | #11 |
Administrator
Join Date: Aug 2008
Location: Germantown, WI
Posts: 5,525
Thanks: 1,162
Thanked 374 Times in 305 Posts
|
Still doing a little refining on the circuit. I added a pull down resistor as I had some issues with my SSR activating when it shouldn't. I also added a supression diode in case you're actually using a relay versus SSR. Here is the updated schematic.
__________________
Current project - To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. & To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. |
04-14-11, 01:37 PM | #12 | |
Supreme EcoRenovator
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 724 Times in 534 Posts
|
Source Code?
Quote:
I was looking at your 'attic heat' thread, and it looks like you have the code working. Will you be posting the source code for your differential controller here? I am asking because there is a modified form of the differential controller, such as you have here that incorporates change/time. This type is used for controlling radiant slabs. With this type of controller, indoor temperature is monitored as well as outdoor, and when a change in outdoor temp exceeds a certain rate of change, the heat to the slab is increased or decreased, thus minimizing the 'time-lag' that usually accompanies a thermal mass. So, in a way it is a PID controller. Am I explaining this in a clear way? Regards, -AC_Hacker
__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker... Last edited by AC_Hacker; 04-14-11 at 01:40 PM.. |
|
04-14-11, 03:04 PM | #13 |
Administrator
Join Date: Aug 2008
Location: Germantown, WI
Posts: 5,525
Thanks: 1,162
Thanked 374 Times in 305 Posts
|
Yep, I gotcha. As I mentioned earlier, I was thinking of adding an outdoor sensor.
I will definitely post code once I have everything working.
__________________
Current project - To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. & To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. |
04-17-11, 12:19 PM | #14 |
Administrator
Join Date: Aug 2008
Location: Germantown, WI
Posts: 5,525
Thanks: 1,162
Thanked 374 Times in 305 Posts
|
So, I think its finally ready to go. I made some final tweaks and everything appears to be working perfectly. I had to add a capacitor to the signal line on the kitchen sensor because I was getting noise on the line. I pulled a 10uF capacitor off some circuit board I had laying around and it seems to work great. It wouldn't hurt to put one on the attic temp sensor too, but it didn't jump around much at all, so I just left it. Also, I've removed the 10K pull down resistor on my setup. It seems to be working fine without it.
Anyway, here is the new schematic. Here is the code. I added another check in the program. If the kitchen temperature gets up to 80F/27C, the relay will turn off and stay off. Also, if you uncomment the serial parts of the code, you can very easily log the temperatures. Code:
/* Thermal Differential Controller The program monitors two temperature sensors and activates a relay when one sensor is warmer than the other. */ int SsensorPin = 4; // the pin to input attic temperature int TsensorPin = 5; // the pin to input kitchen temperature int RelayPin = 2; // the pin to operate the relay int ledPin = 13; // led pin (verify fan on condition) int Ssensor = 0; // variable to store the value of the attic temperature int SensorDiff = 0; // variable to store the Ssensor value plus differential (Diff) int Tsensor = 0; // variable to store the value of the kitchen temperature int Diff = 3.0; // temperature difference that must exist between attic and kitchen before relay enables (degrees C) void setup() { pinMode(SsensorPin, INPUT); pinMode(TsensorPin, INPUT); pinMode(RelayPin, OUTPUT); pinMode(ledPin, OUTPUT); // Serial.begin(9600); digitalWrite(RelayPin, LOW); } void loop() { // read sensor inputs and assign to variables Ssensor = analogRead(SsensorPin) / 2; Tsensor = analogRead(TsensorPin) / 2; // add temperature difference to Ssensor value SensorDiff = Ssensor - Diff; // send temperature signals back to computer /* Serial.print(Ssensor); Serial.print(", "); Serial.print(Tsensor); Serial.print(", "); Serial.println(SensorDiff); delay(1000); */ // if attic is warmer than kitchen sensor, enable relay if (SensorDiff > Tsensor && Tsensor < 27) { digitalWrite(RelayPin, HIGH); digitalWrite(ledPin, HIGH); delay(1000); } // if attic sensor is cooler than kitchen sensor, disable relay if (Ssensor < Tsensor || Tsensor > 27 ) { digitalWrite(RelayPin, LOW); digitalWrite(ledPin, LOW); delay(1000); } }
__________________
Current project - To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. & To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. Last edited by Daox; 04-17-11 at 12:21 PM.. |
The Following User Says Thank You to Daox For This Useful Post: | AC_Hacker (04-17-11) |
04-21-11, 08:58 AM | #15 |
Administrator
Join Date: Aug 2008
Location: Germantown, WI
Posts: 5,525
Thanks: 1,162
Thanked 374 Times in 305 Posts
|
I suppose its time to make a parts list in case anyone would like to replicate the controller (easily). I'll work on that soon and post it up.
I just got my break out board that'll allow me to datalog with the RBBB (really bare bones board) arduino since it has no onboard USB converter. The code is already there, its just commented out, so no real changes will be needed except setting up a delay so it only datalogs every 5 minutes or so. I'm also thinking an LCD display would be really nice, add a few buttons and you can cycle through data, manually set the differential temperature, even turn the unit on and off all from a 'control panel'. Unfortunately, I've never used an LCD before. But, it'll be another learning experience.
__________________
Current project - To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. & To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. Last edited by Daox; 04-21-11 at 09:05 AM.. |
04-21-11, 10:46 AM | #16 |
Master EcoRenovator
Join Date: Dec 2008
Location: Vancouver Island BC
Posts: 745
Thanks: 23
Thanked 37 Times in 30 Posts
|
do some research on the LCD's and get one that only uses a few pins. The one that came in my package seems easy enough to use but it takes 10 or 12 pins if I remember correctly. there are others out there that need closer to 4.
I ordered a kit with my ardunio mega with the intention of doing similar. A remote display with a button to cycle through some of the data. It's sitting there waiting for me to have some time. |
04-21-11, 10:58 AM | #17 |
Administrator
Join Date: Aug 2008
Location: Germantown, WI
Posts: 5,525
Thanks: 1,162
Thanked 374 Times in 305 Posts
|
I have the book Practical Arduino which is a collection of arduino projects and it steps through the design and explains everything. In it is a DIY water meter tutorial with a LCD and a couple buttons for resetting the display. I'll have to re-read that, but I'm pretty sure there are 3 ways to wire the LCDs up. One method uses tons of pins, 12 wires sounds about right, the other uses 8 or so, and the last uses 5 or 6 I think. I'll look it up and report back.
Thankfully, this project doesn't require many pins, so if I did need 10 pins it wouldn't be a problem.
__________________
Current project - To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. & To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. |
04-22-11, 12:43 PM | #18 |
Administrator
Join Date: Aug 2008
Location: Germantown, WI
Posts: 5,525
Thanks: 1,162
Thanked 374 Times in 305 Posts
|
Here is a quick parts list of what you'll need. I've linked to a few places where I've bought things from before.
The total for these items comes to ~$40 plus shipping which shouldn't be too bad. It can definitely be done cheaper if you go with a cheaper arduino or find parts to use.
__________________
Current project - To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. & To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. Last edited by Daox; 04-22-11 at 12:46 PM.. |
04-22-11, 04:51 PM | #19 |
Helper EcoRenovator
Join Date: Sep 2010
Posts: 66
Thanks: 3
Thanked 6 Times in 4 Posts
|
Looks good, this system should be usable on any solar heated box of air.
|
02-10-12, 04:29 PM | #20 |
Administrator
Join Date: Aug 2008
Location: Germantown, WI
Posts: 5,525
Thanks: 1,162
Thanked 374 Times in 305 Posts
|
I think its time for an upgrade here. The current version of the thermal differential controller has been working great for over a year in my attic. However, I am planning on putting together a solar hot water setup this spring and I'll need another controller for it. I'd like to enhance the current functionality and add some additional features.
New features: 1) LCD display 2) adjustable on/off temperature differential via the LCD display (instead of having to edit the program) 3) maximum tank temperature adjustment via the LCD 4) control a heat dump load for if the tank and panels get too warm to prevent coolant degredation I've already started programming the LCD display and interface for adjusting the temperature differentials and max temperature. I just need to figure out how I want to deal with the heat dump load.
__________________
Current project - To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. & To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. |
Tags |
arduino, controller, differential, thermal |
Thread Tools | |
Display Modes | |
|
|