Programming Language?

Oh yes! Everything you ever wanted to know about equipment or ask about equipment, this is the place to be! Share photos or ideas about equipment here.

Moderator: Post Moderators

dhempy
Posts: 2357
Joined: Mon May 09, 2005 4:10 pm
Location: Santa Rosa Valley, CA

Post by dhempy »

I'd really like to know if this could be used in a remote sense ... i.e. how far away from a computer could one set something like this up.

Dan
User avatar
backyard brewer
Posts: 3774
Joined: Fri Feb 18, 2005 5:38 pm
Location: Orange County, CA
Contact:

Post by backyard brewer »

The digital sensor is supposed to be like 300 feet. The analog one I don't know, it's based on resistance and building a voltage bridge with a matching resistor so I imagine you could calibrate it by just measuring any resistance in the cable you build, if any.

From what I've been reading you can add a decoupling capacitor at the sensor to improve reliability at longer ranges.

Or, depending on what the application, there is a Bluetooth based Arduino and another guy makes an Ethernet Shield for it as well.

I guess if you needed to measure multiple sensors across a large area you'd want to concentrate on cable length to the sensor. If you wanted to measure multiple sensors in close proximity but far away from the PC, then just install the Arduino at the sensor site. It just communicates via USB or there is an RS232 version as well.
User avatar
brahn
Site Admin
Posts: 1799
Joined: Wed May 31, 2006 5:12 pm
Location: Tustin, CA
Contact:

Post by brahn »

You can also use XBee wireless RS232 modules which would be cheaper than bluetooth and still get you wireless. There are some cheaper Arduino options besides the $35 prebuilt one that might work in certain environments.

The wireless monitoring is certainly on my todo list at some point. But for some reason that list only seems to grow...
User avatar
backyard brewer
Posts: 3774
Joined: Fri Feb 18, 2005 5:38 pm
Location: Orange County, CA
Contact:

Post by backyard brewer »

Here's the plot from the thermistor. I collected 908 data points from -13*F to 260*F using my oven, fridge and freezer.

Image
dhempy
Posts: 2357
Joined: Mon May 09, 2005 4:10 pm
Location: Santa Rosa Valley, CA

Post by dhempy »

What I was thinking was on my ferm freezer in the garage and then linking back to a server in the office. I've got ethernet in the garage wired into my office and probably an extra phone line ...

Dan
User avatar
backyard brewer
Posts: 3774
Joined: Fri Feb 18, 2005 5:38 pm
Location: Orange County, CA
Contact:

Post by backyard brewer »

dhempy wrote:What I was thinking was on my ferm freezer in the garage and then linking back to a server in the office. I've got ethernet in the garage wired into my office and probably an extra phone line ...

Dan

Here you go. this site has info on cross-connecting RS232 to RJ45. You could re-purpose the CAT5 cable for the ethernet to the garage to use is as a serial cable. You'd have to make a cable at each end that goes from DB-9 to RJ45. You could just unplug if you needed to use it for Ethernet again.

I don't know the specification on USB cables, but I don't think they can be very long, I think 65' is the max. There are several USB repeaters on the market though as well as USB to Ethernet adapters that allow you to use a USB device as if it were local to your machine. There is also the Xbee wirless RS232 solution.
User avatar
backyard brewer
Posts: 3774
Joined: Fri Feb 18, 2005 5:38 pm
Location: Orange County, CA
Contact:

Post by backyard brewer »

Yikes!!

OK, I figured out how to get Excel to give me the formula for that graph. But I think with the Arduino's limited floating point capabilities, the lookup table may be a better choice!

y = 4E-12x5 - 1E-08x4 + 1E-05x3 - 0.0044x2 + 1.071x - 76.343

Those are supposed to be powers of after the X's, but I couldn't figure out how to get superscript.
User avatar
brahn
Site Admin
Posts: 1799
Joined: Wed May 31, 2006 5:12 pm
Location: Tustin, CA
Contact:

Post by brahn »

Yea, I'd recommend a lookup table. :)

You should also probably try to store it in the 'code' section of memory so that you're not using up the smaller amount of data memory you've got. It's just a keyword that you put in the variable declaration.
User avatar
BrewMasterBrad
Pro Brewer
Posts: 3326
Joined: Thu Feb 09, 2006 12:31 pm
Location: Skyland Ale Works, Corona, CA
Contact:

Post by BrewMasterBrad »

Image
I saw a werewolf drinking a pina colada down at Trader Vic's
User avatar
backyard brewer
Posts: 3774
Joined: Fri Feb 18, 2005 5:38 pm
Location: Orange County, CA
Contact:

Post by backyard brewer »

Hey, where's my hat!!!
User avatar
brahn
Site Admin
Posts: 1799
Joined: Wed May 31, 2006 5:12 pm
Location: Tustin, CA
Contact:

Post by brahn »

I would so wear that at next year's fest if it had a brewcommune logo on it.
User avatar
BrewMasterBrad
Pro Brewer
Posts: 3326
Joined: Thu Feb 09, 2006 12:31 pm
Location: Skyland Ale Works, Corona, CA
Contact:

Post by BrewMasterBrad »

Backyard Brewer wrote:Hey, where's my hat!!!
I couldn't find a good pic of you to use. Besides, don't you already own one of those hats?!? :lol:
I saw a werewolf drinking a pina colada down at Trader Vic's
User avatar
backyard brewer
Posts: 3774
Joined: Fri Feb 18, 2005 5:38 pm
Location: Orange County, CA
Contact:

Post by backyard brewer »

OK, I'm kind of stumped here a little. I have the basic control and read code done, but I want to add a timer that'll prvent the burner from re-lighting when the temp crosses the threshold after it was just on. When the temp climbs or drops, it's not uncommon for the sensor to bounce a degree around the temp. So for example, if the burner is on and the setpoint is 152* and the sensor reads 153* and shuts off the burner, but then reads 152* again on the next cycle, I don't want the burner to fire back up. (The same would be true for refrigeration control) I want to build in a 30 second delay before it will re-light a burner, BUT I don't want to stop the whole program using delay(30000);

Any ideas?

I tried using millis(); but the results are too random and I don't understand the roll-over. The reference says it's at 9 hours 32 minutes but it seems to roll over much faster. I tried to store millis (); in a variable when the burner relay was switched low and then compare current millis(); to the variable before turning the burner high again. THe results were all over the board.
User avatar
backyard brewer
Posts: 3774
Joined: Fri Feb 18, 2005 5:38 pm
Location: Orange County, CA
Contact:

Post by backyard brewer »

Oh and by the way, the LM34's are the way to go. Works as simple as a thermistor, but with a linear outpout. Very smooth although I notice of the 4 I have breadboarded right now, only 2 report the same temp. The other two are about 1* high or low.
User avatar
backyard brewer
Posts: 3774
Joined: Fri Feb 18, 2005 5:38 pm
Location: Orange County, CA
Contact:

Post by backyard brewer »

Backyard Brewer wrote:OK, I'm kind of stumped here a little. I have the basic control and read code done, but I want to add a timer that'll prvent the burner from re-lighting when the temp crosses the threshold after it was just on. When the temp climbs or drops, it's not uncommon for the sensor to bounce a degree around the temp. So for example, if the burner is on and the setpoint is 152* and the sensor reads 153* and shuts off the burner, but then reads 152* again on the next cycle, I don't want the burner to fire back up. (The same would be true for refrigeration control) I want to build in a 30 second delay before it will re-light a burner, BUT I don't want to stop the whole program using delay(30000);

Any ideas?

I tried using millis(); but the results are too random and I don't understand the roll-over. The reference says it's at 9 hours 32 minutes but it seems to roll over much faster. I tried to store millis (); in a variable when the burner relay was switched low and then compare current millis(); to the variable before turning the burner high again. THe results were all over the board.
Nevermind. I figured it out. I wasn't using the correct vaiables with millis() and then doing math the wrong way. A couple beers and i'm thinking more clearly. Here's the code snippet that solved it:

Code: Select all

//  HLT Control
if (SwitchStatus [0] > 0)                            // Check status of override switch If switch is on override:
{   
    digitalWrite( RelayPin [0], LOW);                // Turn burner relay off to prevent unwanted start
    RelayStatus [0] = true;                          // Set HLT Burner Status as on since switch is on
}
else                                                 // Override switch is off, allowing Arduino control of burner.
       {   
           Serial.print ("Switch is off: checking Setpoint");
           Serial.println ();
           Time = millis() / 1000;                          // Sets Time to the current total program runtime in seconds.  
           if (TempReading [0] >= Setpoint [0] )            // Compare HLT: Temperature is at or above setpoint
               {
                digitalWrite( RelayPin [0], LOW);           // Turn HLT Burner Off.
                RelayStatus [0] = false;                    // Set HLT Burner Status
                OffTime [0] = Time;                         // Time stamps the off time for Burner.
                Serial.print ("Burner is off OffTime = ");
                Serial.print (OffTime [0]);
                Serial.println ();
                }
         
           else           
              { 
                Serial.print ("Temp below setpoint. ");
                Serial.println();
                if ( Time - OffTime [0] < 30)              // Check to confirm burner has been off at least 30 seconds
                    {
                     Serial.print (" Timer has not elapsed. Burner off. Timer = ");
                     Serial.println (Time - OffTime [0]);
                    }
          
                else
                    {
                     digitalWrite( RelayPin [0], HIGH);      // Turn HLT Burner On.
                     RelayStatus [0] = true;                 // Set HLT Burner Status as on
                     Serial.print ("burner on. ");
                     Serial.println();
                    } 
              }
       }
// End HLT Control
The only thing it's doing is waiting 30 more seconds than I want to start the burner if the burner had already been off. If the burner is off for < 30 seconds and then flutters, it suppresses the flutter, which was the goal.

I'll fix it.

This is fun!
Post Reply