Programming Language?
Moderator: Post Moderators
- backyard brewer
- Posts: 3774
- Joined: Fri Feb 18, 2005 5:38 pm
- Location: Orange County, CA
- Contact:
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.
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.
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...
The wireless monitoring is certainly on my todo list at some point. But for some reason that list only seems to grow...
- backyard brewer
- Posts: 3774
- Joined: Fri Feb 18, 2005 5:38 pm
- Location: Orange County, CA
- Contact:
- backyard brewer
- Posts: 3774
- Joined: Fri Feb 18, 2005 5:38 pm
- Location: Orange County, CA
- Contact:
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.
- backyard brewer
- Posts: 3774
- Joined: Fri Feb 18, 2005 5:38 pm
- Location: Orange County, CA
- Contact:
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.
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.
- BrewMasterBrad
- Pro Brewer
- Posts: 3326
- Joined: Thu Feb 09, 2006 12:31 pm
- Location: Skyland Ale Works, Corona, CA
- Contact:
- backyard brewer
- Posts: 3774
- Joined: Fri Feb 18, 2005 5:38 pm
- Location: Orange County, CA
- Contact:
- BrewMasterBrad
- Pro Brewer
- Posts: 3326
- Joined: Thu Feb 09, 2006 12:31 pm
- Location: Skyland Ale Works, Corona, CA
- Contact:
- backyard brewer
- Posts: 3774
- Joined: Fri Feb 18, 2005 5:38 pm
- Location: Orange County, CA
- Contact:
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.
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.
- backyard brewer
- Posts: 3774
- Joined: Fri Feb 18, 2005 5:38 pm
- Location: Orange County, CA
- Contact:
- backyard brewer
- Posts: 3774
- Joined: Fri Feb 18, 2005 5:38 pm
- Location: Orange County, CA
- Contact:
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: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.
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
I'll fix it.
This is fun!