08-10-14, 01:00 PM | #171 |
Master EcoRenovator
Join Date: Mar 2014
Location: Florissant, Colorado
Posts: 599
Thanks: 814
Thanked 59 Times in 55 Posts
|
A/C what pins does that Button/LCD Display use?
On the seperate LCD I'm using, only A4 & A5 are used. #define SDA A4 //RESERVE I2C for LCD #define SCL A5 Last edited by buffalobillpatrick; 08-10-14 at 01:04 PM.. |
08-10-14, 02:03 PM | #172 | |
Supreme EcoRenovator
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 724 Times in 534 Posts
|
Quote:
It may be possible to adapt I2C... Best, -AC
__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker... |
|
The Following User Says Thank You to AC_Hacker For This Useful Post: | buffalobillpatrick (08-12-14) |
08-10-14, 02:36 PM | #173 |
Supreme EcoRenovator
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 724 Times in 534 Posts
|
BBP,
You may already have come across these, but just in case... LCD keypad menu help - Arduino Forum LCD Menu library - Arduino Forum Arduino LCD Keypad Shield – Basic Menu System | The hack shed Best, -AC
__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker... |
The Following User Says Thank You to AC_Hacker For This Useful Post: | buffalobillpatrick (08-12-14) |
08-11-14, 11:57 AM | #174 |
Master EcoRenovator
Join Date: Mar 2014
Location: Florissant, Colorado
Posts: 599
Thanks: 814
Thanked 59 Times in 55 Posts
|
10K NTC sensor wiring:
see: https://learn.adafruit.com/thermistor?view=all A voltage divider circuit is built for each sensor. A 10K 1% resistor is soldered in series with the 10K NTC thermistor & wired across +5 & Gnd. The sensor wire is soldered to the middle of voltage divider. Every brand of 10K NTC Thermistor possibly has a different Beta which "YOU" would specify in the Read_10K_NTC function. The ones I'm using are: // The beta coefficient of the thermistor (usually 3000-4000) #define BCOEFFICIENT 3892 I have wired up 12 of them & they all read within 1*F of each other. If they didn't you could program an offset for offender. I have ordered a bunch of the cheap Ebay ones, shall see how close the range is for them. Last edited by buffalobillpatrick; 08-11-14 at 12:03 PM.. |
08-11-14, 10:06 PM | #175 |
Supreme EcoRenovator
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 724 Times in 534 Posts
|
BBP,
I was wondering what you thought about the LCD KeyPad Shield, and the pins it uses, etc? I am wondering if, given the restricted platform, if the resources it consumes (pins) is balanced by the utility it provides? Also, I did some more skulking about and I did find evidence of I2C work that had been done on the LCD KeyPad Shield. 3_PINS_CHECK_THIS_OUT ALSO, I found a DIY I2C controller HERE And one from Adafruit HERE (DATASHEET) What kind of display or indicators or other output are you looking at for your heat pump controller?
__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker... Last edited by AC_Hacker; 08-11-14 at 10:58 PM.. |
The Following User Says Thank You to AC_Hacker For This Useful Post: | buffalobillpatrick (08-12-14) |
08-12-14, 12:44 AM | #176 |
Master EcoRenovator
Join Date: Mar 2014
Location: Florissant, Colorado
Posts: 599
Thanks: 814
Thanked 59 Times in 55 Posts
|
A/C So far, in my code, I don't see enough need for the buttons to justify all the pins used.
I'm really a NOOB on Arduino, so I have alot to learn. I suppose my use of switches in my "Heat System Master" could be done in a menu with buttons, but I can't spare the pins there, & don't see a use in my "Slave" code. Thanks for those links, I could spare 1 extra on using a NANO as it has 2 exrta Analog pins vs. Uno. I look forward to how the group will use the buttons. I have bought 2 of the Sainsmart versions. Last edited by buffalobillpatrick; 08-12-14 at 12:52 AM.. |
08-12-14, 12:13 PM | #177 | |
Supreme EcoRenovator
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 724 Times in 534 Posts
|
Quote:
The Adafruit model looks good to me, even though it's a bit expensive.. They are a small outfit with a good reputation. A remaining burden would be developing the menu system. I have been searching for prior work regarding menu systems. Although there has been a good bit of work, at this point, I have not verified a candidate I could recommend... but I'm still looking. * * * BBP, I am very enthusiastic about the work you are doing, please keep it up. I am asking for ideas about the rest of this post: * * * Right now, the basic General Purpose Controller thread seems to be stalled, in my opinion because of the resource (pins) consumption of the LDC Keypad Shield. The baby is being smothered in its crib by features. So, I am re-assessing the need for any kind of menu system for a very basic controller (level 1) GPC for absolute beginners, which is what I'd like to see developed. For all the people who have already tried to just turn an air-conditioner around in their window for heat, or who have attempted and succeeded in making a heat pump water heater... there are many other people who would have taken the step if some kind of easy controller was available. That's what we don't have, and that's what I want to see happen. In this thread, we have seen some brilliant examples of heat pumps and controllers, and heard descriptions of others, but a simple basic controller is as out of reach now, as it was when we started. So unless there are other ideas, I'd like to return to Ko_deZ's heat pump controller as a starting place. He admits that is is just a hasty attempt, and that he wrote it an hour, so obviously he expected it to be improved. He got around the LCDKeypad problem by simply using the LED that is already on the Arduino board, and assigning it different ON time-durations (which can be improved) to indicate different conditions. His June 2011 post of the controller is HERE. ...and below is his code: Code:
/* First some legal mumbo jumbo: This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. * This is a crude implementation for a state for controlling a * ground souce heat pump machine. * * Written by Morgan Tørvolt <morgan@torvolt.com>. * * Analog inputs: * * T1 - indoor temperature, connects to A1 * T2 - outdoor temperature, connects to A2 * T3 - accumulator tank temperature, connects to A3 * T4 - ground loop temperature out, connects to A4 * * Digital outputs: * * D3 - Relay for ground loop water pump * D4 - Relay for warm side water loop to accumulator tank * D5 - Relay for starting the heat pump * * Defined settings for temperatures and such. Set those below this comment section * * TEMP_TYPE : CELCIUS or FARENHEIT * TEMP_START : T3 temperature for when the HP should start * TEMP_STOP : T3 temperature for when the HP should stop * TEMP_SHUTOFF : T4 temperature that is critically * cold (freezing) and the HP should stop * DELAY_BOOT : Time to wait when powering up in seconds * DELAY_START : How long to run the water pumps before turning * on the HP in seconds * * State 0: All off * Wait 2 minutes before doing anything. Blink diode 1 second on and 1 second off * Go to state 1 after two minutes * State 1: * If T3 < TEMP_START, go to state 2 * Blink diode on 2 sek, off 1 sek * State 2: * Turn on D3 and D4 (start water pumps), leave D5 off (HP) * Wait for 2 minutes, then go to state 3 * State 3: * If T4 > TEMP_SHUTOFF and T3 < TEMP_STOP, leave HP and water pumps running using D3, D4 and D5 * If T4 < TEMP_SHUTOFF or T3 > TEMP_STOP, jump to state 1 * */ enum { CELCIUS, FARENHEIT }; #define TEMP_TYPE CELCIUS #define TEMP_START 40 #define TEMP_STOP 50 #define TEMP_SHUTOFF 1 #define DELAY_BOOT 120 #define DELAY_START 120 // General program code. Go further down // if you don't want to know what is going on // in the background void blinkDiode( int on, int period ) { if( ( ( millis() / 1000 ) % period ) < on ) { digitalWrite( 13, HIGH ); } else { digitalWrite( 13, LOW ); } } float getTemperature( int input ) { int raw = static_cast< int >( analogRead( input ) ) - static_cast< int >( analogRead( A0 ) ); switch( TEMP_TYPE ) { case CELCIUS: // 1024 states across 5V gives 4.8828 mV per step. For celcius, 10 mV = 1C, so we multiply by 0.48828 to get celcius return raw * 0.48828; case FARENHEIT: // °F = (°C × 9/5) + 32 return ( raw * 0.8789 ) + 32; } // This should never happen return 0; } void setOutputs( int output_3, int output_4, int output_5 ) { digitalWrite( 3, output_3 ); digitalWrite( 4, output_4 ); digitalWrite( 5, output_5 ); } void setup() { // declare all digital pins as output pins: for( int i = 2; i <= 13; ++i ) { pinMode( i, OUTPUT ); digitalWrite( i, LOW ); } Serial.begin( 9600 ); } int state = 0; // We start in state 0 unsigned long waitUntil = 0; bool diodeState = 0; void loop() { delay( 50 ); // No need to rush things, and also make sure we don't overflow the serial interface Serial.print( "State: " ); Serial.print( state ); Serial.print( " Temps: " ); Serial.print( getTemperature( A1 ) ); Serial.print( " " ); Serial.print( getTemperature( A2 ) ); Serial.print( " " ); Serial.print( getTemperature( A3 ) ); Serial.print( " " ); Serial.println( getTemperature( A4 ) ); switch( state ) { case 0: setOutputs( LOW, LOW, LOW ); if( millis() > DELAY_BOOT*1000 ) { state = 1; } blinkDiode( 1, 5 ); // on 1 of 5 seconds break; case 1: setOutputs( LOW, LOW, LOW ); if( getTemperature( A3 ) < TEMP_START ) { waitUntil = millis() + DELAY_START * 1000; state = 2; } blinkDiode( 2, 5 ); // on 2 of 5 seconds break; case 2: setOutputs( HIGH, HIGH, LOW ); if( millis() > waitUntil && millis() - waitUntil < 20000 ) // Just making sure that things does not get screwed up when the unsigned long overflows. { state = 3; } blinkDiode( 3, 5 ); // on 3 of 5 seconds break; case 3: setOutputs( HIGH, HIGH, HIGH ); if( getTemperature( A3 ) > TEMP_STOP || getTemperature( A4 ) < TEMP_SHUTOFF ) { state = 1; } blinkDiode( 4, 5 ); // on 4 of 5 seconds break; } } Best, -AC
__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker... Last edited by AC_Hacker; 08-12-14 at 01:57 PM.. |
|
08-12-14, 01:21 PM | #178 |
Master EcoRenovator
Join Date: Mar 2014
Location: Florissant, Colorado
Posts: 599
Thanks: 814
Thanked 59 Times in 55 Posts
|
The interrupt method looks better than the polling. Easy to use.
Arduino - AttachInterrupt "Most Arduino boards have two external interrupts: numbers 0 (on digital pin 2) and 1 (on digital pin 3)" PCF8574P pdf, PCF8574P description, PCF8574P datasheets, PCF8574P view ::: ALLDATASHEET ::: http://ecee.colorado.edu/~mcclurel/T...ts_scpa032.pdf PCF8574 Adwr PCF8574ADW TI I O Expander I2C 8B 16SOIC 1pc Lot | eBay Last edited by buffalobillpatrick; 08-12-14 at 01:45 PM.. |
08-13-14, 04:16 PM | #179 |
Master EcoRenovator
Join Date: Mar 2014
Location: Florissant, Colorado
Posts: 599
Thanks: 814
Thanked 59 Times in 55 Posts
|
Ko_deZ's code stays in state 0 for me.
|
08-13-14, 05:13 PM | #180 |
Supreme EcoRenovator
Join Date: Mar 2009
Location: Portland, OR
Posts: 4,004
Thanks: 303
Thanked 724 Times in 534 Posts
|
OK BBP, you're ahead of me... the spray paint on my breadboard isn't even dry yet!
Do you have the Uno communicating to you through the USB port? -AC
__________________
I'm not an HVAC technician. In fact, I'm barely even a hacker... |
|
|