EcoRenovator  

Go Back   EcoRenovator > Improvements > Geothermal & Heat Pumps
Advanced Search
 


Blog 60+ Home Energy Saving Tips Recent Posts Search Today's Posts Mark Forums Read


Reply
 
Thread Tools Display Modes
Old 10-28-14, 09:41 AM   #271
theoldwizard1
Apprentice EcoRenovator
 
Join Date: Oct 2014
Location: SE MI
Posts: 105
Thanks: 3
Thanked 12 Times in 9 Posts
Default

Quote:
Originally Posted by buffalobillpatrick View Post
Whew! took hours, lots of stuff don't work in a ISR (Interrupt Service Routine)
delay(x) , lcd.print, &
biggest pain was
Compiler was optimizing out various "delay for loops" that I tried, ...
Write a "generic" delay called function. Compile it as a separate file with the optimizer turned off (-O0 on gcc, IIRC). Link it in.

When messing with ISR, make sure you understand any limitation the original author design in, like possible not saving all registers. Also be careful on how many nested function you call so that you don't overflow the stack.



Many years ago, in a "former life ..."

theoldwizard1 is offline   Reply With Quote
The Following User Says Thank You to theoldwizard1 For This Useful Post:
buffalobillpatrick (10-29-14)
Old 11-15-14, 11:07 PM   #272
RB855
Helper EcoRenovator
 
RB855's Avatar
 
Join Date: Jul 2012
Location: Jacksonville, fl
Posts: 48
Thanks: 3
Thanked 14 Times in 10 Posts
Default

Have been following this for a while now (just in case my chinese heatpump waterheater controller ever failed), and while working on a window shaker the other day something occurred to me. The unit I was repairing had a failed relay board. This board contains all in one many of the components mentioned early on in the thread. It has 3x 25amp relays, 4x 3amp relays, 5v filtered regulated power supply (minus off board transformer), relays are opto-isolated, has a little piezo beeper, and 3 removable temp sensors (1x tube sensors, 2x air temp) with onboard filtering. And this whole board as it sits only costs about 22$ Now, as I mentioned this board had failed, but the 6 I have here in front of me, every single one only has a bad filter capacitor on the 5v supply, an easy fix! The boards I have on hand are Amana 30132023 , which lack 1 of the 3amp relays, but the 30132033 has the most relays, and actually costs less... Since these are all warranty change outs and were heading for the trash, if there is interest in toying with one of these, pay the post and its yours!

I should mention, originally the 4 small relays were for reversing valve, low-med-high fan speed. The large relays, 2 were used for the heat as a redundancy and 100% isolation from mains, and one for the compressor (the top pin on this relay supplies L1 to the board through a 3.15a fuse, L2 is on the board itself, that has a pinout for the xfmr and runs the fan/rvalve outputs). One of the air temp sensors was inlet, one was outlet, and depending on the model the tube sensor was mounted to evap or condenser. There is a model board out there with both, but i forgot which one it is.
Also note worthy, Amana 30132030 has a 5th 3amp relay used for vent swing motor, and uses 4 sensors, and uses a different form factor, otherwise the same as above.

Last edited by RB855; 11-15-14 at 11:18 PM..
RB855 is offline   Reply With Quote
Old 11-15-14, 11:34 PM   #273
theoldwizard1
Apprentice EcoRenovator
 
Join Date: Oct 2014
Location: SE MI
Posts: 105
Thanks: 3
Thanked 12 Times in 9 Posts
Default

Good input ! Thanks.

Got a reference for that tube temp sensor ?

Do you know of any pressure sensors used with other controllers ?
theoldwizard1 is offline   Reply With Quote
Old 11-16-14, 08:32 AM   #274
RB855
Helper EcoRenovator
 
RB855's Avatar
 
Join Date: Jul 2012
Location: Jacksonville, fl
Posts: 48
Thanks: 3
Thanked 14 Times in 10 Posts
Default

Youll only find pressure sensors on very high end equipment, sometimes top of the line residential, or large commercial chillers, youll never see it in normal everyday stuff. If I can get my butt dressed enough to go to the van today, Ill meter out one of the sensors to see what it is. If you order the board, it comes with all 3. While on the topic of tube sensors, the Amana PTAC use tube sensors with built in stainless clips to hold them to the tube, vs the 1/4" pipe stub brazed to the line to be metered. 0130P00086 for the red shorter sensor or 0130P00093 for the blue sensor that has a longer wire. These only cost us a couple $, not sure what retail is. The PTAC also use a air temp sensor that clips into the front of the coil to catch incoming air temp which could be useful for metering ambient, 0130P00073 and 0130P00074 (for different coil tube sizes).
RB855 is offline   Reply With Quote
Old 11-16-14, 10:17 AM   #275
jeff5may
Supreme EcoRenovator
 
Join Date: Jan 2010
Location: elizabethtown, ky, USA
Posts: 2,428
Thanks: 431
Thanked 619 Times in 517 Posts
Send a message via Yahoo to jeff5may
Default

This is exactly how I'm doing trials on my dirt cheap window shaker. I repurposed the power board out of a portable dehumidifier/ac unit that will end up as some sort of heat pump someday.


The board in its old home

Now it's imprisoned here:


The arduino gets its power from the 5V regulated supply on this board. I cut up a usb cable (blue) and soldered it directly to the 5V rail and its ground. The breadboard has status LED's on it for the compressor, fan, and reversing valve outputs. The yellow and green wires from the breadboard tie directly to the relay buffer IC inputs.



I lifted the power board's mains fuse to separate the relay contacts from the 120 VAC input, since my window unit has contactors and a defrost board in it that run off 24VAC. The 120VAC is run through the onboard power supply and comes out with unregulated 12VDC for the relays and regulated 5VDC for the buffer IC (and no longer attached stock control board) and arduino.



When I originally rigged the window unit, I used a non-heat pump thermostat, so I had to wire it up "weird" to make it work. To interface with the controller, I ran two phone cords since all I have close is single-pair phone cords. The red wire runs 24VAC power to the relays on the power board using one cord. The other carries the normally open relay contacts back to the window unit. Since the unit has a defrost control and it's heating season, I am not running the reversing valve output back to the window unit.

As of today, the controller operates with a 2 degree deadband in heat, cool, and auto-changeover modes. I haven't integrated short-cycle protection, defrost sensing, or serial comms yet.

I hope to release a beta version soon that will function as a wall-mounted thermostat does. It will have lots of "dead" code in it, with variables that do nothing (yet) and extra menu items that can be filled in for future functionality.

This is the first full weekend I have had off since sometime around the fourth of July, and the powers that be say overtime will die down until after the holiday season. If I can complete this task and the other 20 in front of me before Valentine's day, that would be awesome!
jeff5may is offline   Reply With Quote
Old 11-16-14, 07:39 PM   #276
jeff5may
Supreme EcoRenovator
 
Join Date: Jan 2010
Location: elizabethtown, ky, USA
Posts: 2,428
Thanks: 431
Thanked 619 Times in 517 Posts
Send a message via Yahoo to jeff5may
Default

OK, i've posted a rough alpha copy for collaboration and refining and filling out.

The sketch I have started runs off a single 1-wire thermometer sensor that reads indoor air temperature. I am still trying to figure out how to reliably assign multiple 1-wire sensors.

I had lots of trouble getting things to compile until I found this page:

Arduino 1-Wire Tutorial

The miles burton libraries are outdated, and will not compile under the newer versions of the arduino IDE.

Pin assignment is as follows:
A0: Keypad
A1,A2: analog 10k NTC thermistor sensors (not yet coded)
A3,A4,A5: open

D0,D1: serial comms
D2: "W" output (default: aux heat/outdoor fan motor)
D3: "Y" output (default: compressor contactor)
D4-D10: LCD shield
D11:"O" output (default: reversing valve, energized in cooling mode)
D12:"G" output (default: indoor fan motor)
D13: 1-wire bus

Come help me! Believe me, I need it.

https://github.com/jeff5may/LCD_Thermostat

Last edited by jeff5may; 11-16-14 at 09:00 PM..
jeff5may is offline   Reply With Quote
Old 11-17-14, 06:06 PM   #277
AC_Hacker
Supreme EcoRenovator
 
AC_Hacker's Avatar
 
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 723 Times in 534 Posts
Default

Quote:
Originally Posted by jeff5may View Post
I am still trying to figure out how to reliably assign multiple 1-wire sensors.
THIS_SITE sells open source Arduino data-loggers that handle multiple 1-wire devices.

The source code to the device CAN_BE_FOUND_HERE.


-AC
__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker...
AC_Hacker is offline   Reply With Quote
Old 11-17-14, 07:15 PM   #278
jeff5may
Supreme EcoRenovator
 
Join Date: Jan 2010
Location: elizabethtown, ky, USA
Posts: 2,428
Thanks: 431
Thanked 619 Times in 517 Posts
Send a message via Yahoo to jeff5may
Default

The problem I am having is dealing with the situations a fellow ecorenovator brought up:

How will the unit know what sensor is what? Initially, sensors will need to be assigned. How painless can this process be? Maybe the unit can run a "test mode" and find its own sensors. But what happens if a sensor or three goes bad in a few years? How will the plumber hook them back up when the (mystery part) is replaced? Will the unit glitch or hang? What if we want to swap the controller quickly between separate devices? Then what?

Finding sensor addresses and data values is not the problem. Recording, logging, manipulating, spitting out, etc. data is not the problem. Making something that runs reliably and is easy to program is the problem.

I believe for the critical sensors (defrost, ambient) I will use 10k thermistors in the first real version. There are 3 more analog pins left open, so that should be enough for the old-school type of hookup. If they were multiplexed, you could hook up over a dozen sensors with 4 pins. That's gotta be enough sensors.

The rough alpha version I put up on github will read all the sensors on pin D13 and throw them into an index. With that version, I played around with dallas sensors and as long as they were connected correctly, it read them all.

I goofed around with the serial monitor, and they assign to the same place in the index every time the unit is reset. The problem with the index approach lies in the way the onewire or dallas libraries interpret and assign the sensors. They work in reverse polish mode, reading and sorting the sensors least significant bit first. So you can't easily predict by address where each sensor will end up in the index, instead, major bit-banging and translating would be necessary to figure this out.

I believe the controller will need to use the EEPROM to store addresses and assignments so it will know what to do when it is reset and restarted. I have found some resources where people have done one thing or the other, but putting all these pieces together will be a challenge.

Multiple (dynamic #) DallasTemperature sensors

DS1822: How does the program assign the sensor's index?

Please help, I am not a software engineer by trade. I got my fill of pascal and c in college a long time ago. I can make this work eventually, but a veteran code warrior could snap this stuff together in five minutes.
jeff5may is offline   Reply With Quote
Old 11-17-14, 09:24 PM   #279
theoldwizard1
Apprentice EcoRenovator
 
Join Date: Oct 2014
Location: SE MI
Posts: 105
Thanks: 3
Thanked 12 Times in 9 Posts
Default

Quote:
Originally Posted by jeff5may View Post
How will the unit know what sensor is what? Initially, sensors will need to be assigned. How painless can this process be? Maybe the unit can run a "test mode" and find its own sensors.
Highly unlikely !

In order to "find" an input/output "device" means that device must have some intelligence to answer the question "Who/what are you ?" with "I am a ...". Temperature sensor are about as dumb/stupid as they come.

All of this must be "hard coded" in the controller software. Even once you have coded that fact that low pressure compressor input temperature sensor is on analog channel 3, you are only half way home. An A-to-D converter only returns a number of counts. Those "counts" can be converted to a voltage, but we humans understand is degrees F or C. Doing this is actually pretty easy assuming you have the spec sheet that the resistance versus temperature chart for the thermistor (I have never used any of the "electronic" temperature sensors, so I am unfamiliar with them).

Quote:
But what happens if a sensor or three goes bad in a few years?
Without re-writing the software (changing the resistance versus temperature curve) you had better have an identical spec thermistor.

Quote:
How will the plumber hook them back up when the (mystery part) is replaced? Will the unit glitch or hang?
Like all electronics, service should be performed the the power off.

Quote:
What if we want to swap the controller quickly between separate devices? Then what?
You can only do that on identical systems. Do you think Ford or GM uses an identical PCM/ECU on a 4 cylinder and 8 cylinder engine ? Admittedly, a heat pump is likely to have similar sensors and outputs, regardless of its size (within reason).

Quote:
Finding sensor addresses and data values is not the problem. Recording, logging, manipulating, spitting out, etc. data is not the problem. Making something that runs reliably and is easy to program is the problem.
What is "easy" for me, may be difficult for you !

Quote:
I believe for the critical sensors (defrost, ambient) I will use 10k thermistors in the first real version. There are 3 more analog pins left open, so that should be enough for the old-school type of hookup. If they were multiplexed, you could hook up over a dozen sensors with 4 pins. That's gotta be enough sensors.
You are getting to wrapped up in the "details" ! You have to see/comprehend the "forest" before looking at the "bark on the trees" (or looking at "the poop on the butt of the ant on the bark of the trees" !)

Designing a "universal" controller that can be [I]re-programmed in the field /I] for different sensors/actuators should be a long term goal. A lot can be done with circuit board switches/jumpers.


The "world" I came from had extremely complex (well, not asteroid landing complex) control algorithms that were constantly being "improved"/modified. The sensor data was obfuscated by input routines that handle converting from counts to an "engineering unit" and then storing the value in a variable (RAM location) that had a meaningful name (i.e. Compressor_Low_Side_Pressure). An algorithm that controlled one "subsystem" (say, condenser fan speed) could be ported from one system with one set off inputs and outputs to a different system with different inputs and outs by changing a few #defines in the source code and then re-compiling.

This is probably not what you want to hear, but this is reasonable.


KISS !
theoldwizard1 is offline   Reply With Quote
The Following 2 Users Say Thank You to theoldwizard1 For This Useful Post:
buffalobillpatrick (11-18-14), jeff5may (11-26-14)
Old 11-17-14, 09:53 PM   #280
theoldwizard1
Apprentice EcoRenovator
 
Join Date: Oct 2014
Location: SE MI
Posts: 105
Thanks: 3
Thanked 12 Times in 9 Posts
Default

SIDEBAR on thermistors, wiring and A-to-D inputs

A thermistor is a devices whose resistance changes with temperature. The problem with them is that they loose "accuracy" at the ends of their range. If you need "accurate" temperature readings over a range of say -20F to 250F, you will need 2 or 3 different models of sensors. One to cover the low end and one to cover the high end.

But then again, you have to ask yourself, do I really need to know that it is -20F or is less tan 0F enough for what I am trying to control.

Thermistors are a good choice for embedded control because they are cheap and you can find one that will cover the most important part of your data range.

Another big benefit of thermistors (or any variable resistance device) is they can be wired as a ratiometric signal. Think of a potentiometer. The "high side is wired to the reference volatge, the wiper is the "signal" and the low side is wired to Ssignal Return" (notice I did not say ground). For a thermistor input, one side of the thermistor is wired to Vref. The other side is wired to the the A-to-D pin AND a fixed resistor mounted on the controller board.

Why all of this ? Well, do believe that 5V is 5.000V all of the time and at every location in the entire system ? Sorry, it is not. Ratiometeric systems return a value that is the ratio between Vref and Signal Return, so if Vref AT THE THERMISTOR is actually 4.95V, who cares !


Sensors that "generate" their own voltage, don't enjoy this benefit, so use ratiometric analog inputs when you can.

Additionally, if accuracy is important, a "calibration" channel should be setup on the controller board. 2 equal value 0.10% accuracy resistors in series between Vref and signal return with the center connected to a dedicated A-to-D channel off the input. In theory. this should always read 1/2 the counts of the ADC range (512 for a 10 bit ADC). If not, you can use this information to "correct" the other channels.

Then again, how accurate is accurate enough ?

Also remember, when you lower your reference voltage, electrical "noise" starts looking more and more like data ! Not good. Most scientific data acquisition systems use 10V or even +/- 10V Vref.


(Yeah, I did this stuff for awhile !)


Last edited by theoldwizard1; 11-17-14 at 09:55 PM..
theoldwizard1 is offline   Reply With Quote
The Following 2 Users Say Thank You to theoldwizard1 For This Useful Post:
buffalobillpatrick (11-18-14), jeff5may (11-19-14)
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 07:26 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Ad Management by RedTyger
Inactive Reminders By Icora Web Design