Monday, July 22, 2013

Expensive sensor does matter| DS18B20 with arduino


Last Friday's master class at Institute of Making is Science of Cooking with Dr Rachel Edwards-Stuart; sous vide eggs cooking is part of the itinerary of the workshop. My rig was given a SMALL space next to the supposed "sous vide" cooker (a temperature controlled water bath used in chemistry experiments) loaned from the chemistry department.

Dr.Edwards-Stuart class's is very interesting and technically/scientifically inclined, and she spent some time on explaining the 7W1H of the science of cooking throughout the workshop. The taste of ikura (japanese salmon roe as caviar) with white chocolate still lingers in my mind as I am typing this. weird as it sounds, but the taste is..... We also had an academic discussion on using big data methodology to discover, rank and score top 10 best match of a pair of food items based on their chemical compounds.




We made loads of 63degC eggs as an experiment, using both my setup and the device loaned from chemistry department as an A/B test. Knowing the occasional glitch such as temperature fluctuations, and dc offset on my arduino sous vide with K type thermocouple, I needed some extra pre-cautions to ensure everything worked perfectly. I paced back and forth periodically just to check the temperature of the eggs with a pyrometer just to ensure the temperature is within the tolerate limit for a successful experiment (0.5degC). The process is tiring and defeat the purpose of the computer supposed to make my life easier by automatically monitor, control and adjust the temperature.
Nonetheless, egg carnage was fun.


Stable readings with the new thermo probe.

The iteration before the k-type thermocouple using LM35 worked just fine, until the waterproofed LM35 sensor gave way. My last experiment with the k type thermocouple starts to give me problems. The problems are not the usual peculiarities using a non linear amplifier with a non linear thermocouple; nor the DC offset bias that comes with my al-cheapo amplifier. Rather the values read in are fluctuate wildly, and to make the matter worst, it only fluctuates randomly. There can be a myriad of causes on this issue. A dry joint, capacitance effect, signal noise etc....

So, i have decided to solve my problems once and for all by not being a cheapo and spent a good 5quid inclusive of delivery on a DS18B20 waterproofed temperature sensor.  To compare the prices, LM35 is free from www.ti.com; thermocouple is 2quid. Delivery was prompt and programming was easy with helpful documentations from arduino website.

Just add the 2 libraries needed, import to the arduino sketch and start to write some code. Just a slight note: This sensor is a little bit different from the LM35 or the thermocouple.
With LM35, the temperature value is a matter of arithmetic implemented in code, aka software-ish style
Using the thermocouple, the temperature value is a matter of amplitude amplification by the non linear amplifier, aka hardware-ish style. Whereas with the DS18B20 devices running on the onewire protocol, this allows cascading of multiple sensor devices on the same signal line and best of all each device can be addressed individually. The interesting way of using this sensor is through the API calls available to extract the exact values of the temperature read by the DS18B20 sensor. Truly computer engineering-ish type of implementation.
On a side note, it is not truly plug and play type of sensor. A 5k ohm pull up resistor is required to connect between VCC and data. I was scurrying for one of these 5k ohm in my small collection of resistor but can't find an exact one.  Luckily I have one 20k ohm resistor lying around in my bunch of 330ohm resistor and it works just fine with my 1 sensor setup.
No fluctuations, no wild dc offset, PID is working happily (predictable performance) with the stable values. At last, I had a nice perfect pinkish steak for sunday dinner. Damn, i forgot to take a picture of the steak. I am just too desperate to gobble the steak xD~

Now, the fun part begins!


1 comment:

Unknown said...

At US Heat you can easily design custom heaters and thermocouple sensors, see what your design looks like, quote and order at the lowest prices in the industry.