Sunday, October 11, 2009

The controller rises again, in a disappointing way

Remember that Arduino-based controller I was working on back in the summer? Neither do I. Actually, that is not completely true; I remember it all too well, and remember that I'm stymied trying to figure out what to do next.

I think I have settled on moving most of the control decisions out of the Arduino and into Proficy Workflow. (This is clearly not one of the first or second level use cases for Proficy Workflow, but I think it will be fun and educational.) In order to really leverage the power of Workflow, I need at least one of the temperature probes to have enough cord length so I can use it to monitor the boil kettle temperature during a brew session. I alluded to this in an earlier post but it has been a while.

In that earlier post I recounted how my friend, colleague and unindicted co-conspirator Chuck of Triple Mutt Brewery fame wired the Dallas Semiconductor DS18B20 digital thermometers we're using for temperature probes. Dallas Semiconductor created a topology and communication protocol called OneWire which has two operating modes. One is actively powered with a +5VDC source and requires three conductors to be connected. The other one only requires two conductors and has no external supply voltage requirement. This is referred to as "parasite mode," in which the DS18B20 chips actually steal potential from the signal line and store it in an onboard capacitor for use as needed. Chuck and I decided that parasite mode was good enough for our application, and that's how he wired up all the probes, using a 3.5mm (1/8") mono phone plug to terminate them, with the tip connected to the signal lead for the DS18B20 and the shield connected to the other two leads.

What does that have to do with anything? Well, as I started to get back to the hardware basics this week, it occurred to me that I needed an extension cable for the temperature probe I want to use during boils. Luckily I was able to find some 50' 3.5mm stereo extensions at Amazon for a ridiculous price (like, $2.99 each) and I have Amazon Prime so they shipped free.

You may start to detect the beginning of a problem. If Chuck wired the probes with a mono plug shouldn't you use a mono extension? In theory, yes, but in practice the wiring convention is for the "ring" or middle connection of a TRS plug (tip-ring-sleeve, the stereo version of the plug I'm using) to be shorted to the sleeve when a mono plug is connected. It makes sense from a visual perspective: the ring is carved from the real estate that the mono sleeve occupies. So in theory (he says again) a stereo extension should extend mono without alteration.

Well, theory be damned in this case. I plugged it in and nothing worked. I got no temperature reading at all from the probe when it was connected via the extension. After spending most of the afternoon Saturday trying to troubleshoot the connections (in and around watching football and drinking Por Favor), I finally determined that inside the extension cable, the connectors are crossed. The conductor that is attached to the tip at the jack end is on the ring at the plug end. This is not any kind of standard, it's a manufacturing "feature" that is probably an artifact of the low cost of the finished assembly.

No big deal. I cut the cable and respliced the conductors the right way. However, I still didn't get a reading when the probe was plugged into the extension. I ohmed that cable out 20 times and still couldn't figure out what was going wrong.

I thought the issue might have something to do with the length of the cable. The literature I was able to find seems to indicate that a parasite OneWire bus should be able to support an aggregate "weight" of 300M. The "weight" is a representation of the load and is a function of both distance of cabling and the number and types of devices and splices in the bus. With only one device I thought it was reasonable to have my topology with a cable run of 15M or so.

Maybe the problem is the software. After updating my program to the new version of the DallasTemperature library (which is causing me to refactor it, maybe I'll discuss that later) I could reliably read from the probe cable but not when it was connected via the 50' extension.

Back to the length. I created a 3M extension from some hook-up wire and it worked fine, so I decided to cut the 50' cable approximately in half. Yea verily, this worked. I can have a cable of 25' or so as an extension, provided it's wired correctly, but the 50' length is not going to work in this configuration. I'm guessing, but I bet if we had wired them as active busses and not parasites, the length wouldn't have been an issue. Oh well, it's too late to fix that now since the DS18B20's are potted into the stainless probe ends with JB Weld.

No comments:

Post a Comment