Saturday, October 31, 2015

Project Sous Vide, Part 2

In part 1 of this series we looked at the basic physics of sous-vide cooking: we tested the thermometer and we measured the temperature variations in a pan of water. We concluded that one of the challenges was going to be getting the water sufficiently well mixed to have temperature variations of no more than a few tenths of a degree.

There's no progress to report on that front. We still need a good way to get sufficient mixing. But in the meantime we focused on making the controller work. One of the challenges (at least for me) was to get the low-voltage, low-power electronics to switch a 220V, 2000W heating element. That's 9 amps at 220V - not something to mess around with. To start with that, I decided to use a relay for this - something I never played with before.

This relay does the trick very nicely: it can be turned on and off by 5V, allowing me to run it from the same power source as the Arduino Nano that I'm using, and it can handle 10A at 220V. It's a serious piece of kit - it makes a big 'clunk' sound every time it switches. The transparent housing is a nice detail - it means you can see the movement of the contacts (and the flash every time the load is disconnected :-).

The heating element was very kindly donated by a friend: it was an old deep-fryer with a stench of old-and-dirty-and-rancid-fat that could raise the dead. I cleaned it as best I could with multiple rounds in the dishwasher and lots of further manual cleaning, and now it's at the level that I can stand being in the same room with it. Apart from the stench, however it's a great piece of equipment: the tank has a nice size, it effectively has a double-layered wall, and the heating element covers the whole of the bottom of tank. In addition, the way the heating element latches on to the side of the tank is very nice, keeping the element at just the right distance from the bottom of the tank. Finally, the metal basket (the one that otherwise would hold the french fries) comes in very handy to hold the food - and it appears that it even helps conduct the heat throughout the tank.

For the controller I used an Arduino Nano, a three-color LCD similar to this one from Adafruit, and a nifty prototyping board from ebay (I can really recommend these - they're more expensive than the standard ones, but the layout of the traces is very well thought out). I picked up a few nice tricks from the Adafruit Sous-vide tutorial: I like their way of thinking of the user interface as a `state machine', and I had never seen before how to make data persistent by saving it in the EEPROM on the Nano. And Brett Beauregard's PID library is very easy to use.

Here you see the whole setup:


I enclosed the 220V-part in a little box to prevent anyone from accidentally touching it. It's only cardboard, but for the moment it'll do.


Today we tested the setup on eggs. The masters say that eggs come out completely differently when you vary only a little in temperature or duration of the cooking, so that makes for a good test.

So how well did it do? After playing around with the PID coefficients for a while, the system seems to work reasonably well. Of course the thermal mass of the tank with the water is rather big, and as was to be expected, this makes the controller slow in settling on the equilibrium; it takes at least ten or fifteen minutes. After turning the setup on, the temperature overshot the target value by a few degrees, but upon coming back down it settled very nicely at the target value, with some fluctuations in the order of maximally 0.3 degrees Celsius up or down. Not bad for a first try!

We still need to do some tests to find out how constant or variable the temperature is in this tank. To my surprise, the thermometer shows a lower temperature if we hold it against the metal basket than if we let it dangle in the water close to it. The basket itself rests on the heating element, which is why it surprises me that the basket appears to be colder than the surrounding water, even if the thermal conductivity of steel is a hundred times as large as that of water. Maybe the electric contact with the basket is perturbing the temperature measurement? More experiment is needed!

As for the texture of the eggs - we saw some differences, indeed. It was very interesting to see. Maybe I was a little naive, but I was a little disappointed that none of the eggs had nicely consistent egg whites - the whites had different parts to them, with rather different texture. I guess that to get all the white of one consistency, and all the yolk of another, one needs to experiment a bit in order to get the parameters right ...

Labels: , ,

Tuesday, September 15, 2015

Warning: ICT in the classroom may harm pupil performance

Jan van de Craats pointed me to this very interesting study of the OECD on correlation between ICT in the classroom on one hand and performance of the pupils on the other hand. Here's a quote:

But while PISA results suggest that limited use of computers at school may be better than not using computers at all, using them more intensively than the current OECD average tends to be associated with significantly poorer student performance. ICT is linked to better student performance only in certain contexts, such as when computer software and Internet connections help to increase study time and practice.

In other words, a little bit of ICT in the classroom is good, but a lot is bad. This summary says the same, in slightly different words:

 • Resources invested in ICT for education are not linked to improved student achievement in reading, mathematics or science.
 • In countries where it is less common for students to use the Internet at school for schoolwork, students’ performance in reading improved more rapidly than in countries where such use is more common, on average.
 • Overall, the relationship between computer use at school and performance is graphically illustrated by a hill shape, which suggests that limited use of computers at school may be better than no use at all, but levels of computer use above the current OECD average are associated with significantly poorer results (p. 146).

Here's the hill shape that the quote mentions. Note that it's not just a little effect - too much ICT can completely wipe out any benefit you might get from a little ICT, and more:

But what is really interesting are the responses from various people in the British media. For instance,

Mark Chambers, chief executive of Naace, the body supporting the use of computers in schools, said it was unrealistic to think schools should reduce their use of technology. "It is endemic in society now, at home young people will be using technology, there's no way that we should take technology out of schools, schools should be leading not following." 


Head teacher John Morris also strongly rejected the idea. "When people say too much money is being spent on technology in school, my response is 'Nonsense'. What we need is more money, more investment." (both from the BBC)

In other words: we don't care if what we do is harming the pupils - we're going right ahead anyway! 

Labels: , , , ,

Sunday, July 19, 2015

Project Sous Vide, Part 1

Saeed Masroor (LinkedIn, Facebook) told me about a current project of his: sous-vide cooking, in which you slowly cook meat and vegetables, at moderate temperature, by putting them in sealed bags in water. He tells me that the temperature of the water is critical - apparently cooking at 62 degrees Celsius gives a completely different result than at 64 degrees.

This means that one needs decent equipment in order to do this - a good thermometer, for instance. In addition, if you don't want to have to continuously check the temperature and adjust the heat, then you also need a device to keep the temperature constant. These devices exist, but tend to be pricey.

Saeed asked me whether it would be possible to make one of these sous-vide devices DIY-style. The main spec is that the temperature variation in the water should be within 1 degree Celsius of the set temperature. I was looking for a next project to do, after Irene's heartbeat tshirt, and this sounds like a nice challenge. Especially since it has to be done on the cheap ...

My first thought was that measuring the temperature of water would be tricky, given that water and electronics don't go well together. Luckily we're not the first to face this issue, and there are many water-suitable sensors, such this DS18B20-based watertight temperature sensor from iPrototype. It claims 0.5 degree accuracy (absolute error), 12-bit resolution, working range -10 to 85 degrees Celsius, costs 8 euros, and has a clear hookup guide.

It was time for some experimenting. Today Saeed and I tried out the sensor. We wanted to know how accurate it was and whether it was easy to use, but I was also really interested in finding out how big the variation in temperature within a pan. Since the pan is continuously being heated from the bottom (at least on our stove) and cools from the side and top (especially from the top, through evaporation) there should be a gradient in temperature. Of course I could look up some numbers and work out a good guess, but doing the experiment is more fun ...

We first tested the sensor and two mechanical thermometers on the classical calibration points - ice water and boiling water. The sensor and one of the mechanical thermometers agreed that the ice water was between one and two degrees above zero (the other mechanical thermometer didn't go down to zero). I believe that the temperature really was zero, since we measured close to the ice cubes, so my current guess is that both measurement devices were off. Though it is striking that they're off by exactly the same amount ... In boiling water the sensor varied between 99.5 and 102, depending on whether it touched the bottom of the pan or not. The mechanical sensors were more difficult to use here without burning our hands. These two calibration experiments suggests that the accuracy is not too bad.

In fact, the sensor reported numbers with a resolution of 0.06-0.07 degrees, and was remarkably consistent; over time it would typically report many times exactly the same number, and then shift to a new number 0.06 or 0.07 degrees higher or lower, and then stay there for a significant number of measurements. I could see no `flutter' at all in the measurements - it looked all as if the changes in reported numbers were really created by changes in temperature.

Since the really interesting case was a big pan (4 litres) of 60-70 degrees, we moved on to that. After lots of fooling around, here's what we learned:
  • If we left the water undisturbed, then the sensor would register about two degrees more lying on the bottom than held just below the surface. 
  • If we tried to prevent the sensor from being heated by the bottom of the pan, by constantly wiggling it, then the temperature difference was smaller; we now think that that comes simply from the mixing that our wiggling created.
  • Over the course of 5-10 minutes the temperature seemed to fluctuate by one or two degrees, even if we did nothing. We now think that that may come from fluctuations in the gas pressure, leading to fluctuations in the heating of the pan, even though the cooker setting was constant. Maybe if gas was turned on in one of our neighbour's houses, then the pressure would slightly decrease ...
What do we conclude from this? Well, for starters, it seems like the sensor has plenty resolution and  good enough accuracy - that's very good. We also learnt that in an open pan, temperature variations of two degrees happen, which is more than the specs allow for; I expect that that will only get worse if we also put things in the pan, or make the pan deeper. So we need to do something about that. In fact, the professional devices also seem to create significant circulation, as you can see in the picture to the right (they're also called `sous-vide circulators').

So we're in good shape when it comes to measurement, but we still need to find a good way to mix. That's the next step ...

Sunday, September 07, 2014

Trying to measure the speed of light - part 1.

One of my current 'projects' is to measure the speed of light - directly, by timing how fast it goes from A to B. The first to do this were Fizeau and Foucault, with two slightly different methods, around 1850.  The principle of Foucault's experiment is that the beam travels between two mirrors, and that one of the mirrors has rotated a little in the meantime. This animation shows nicely how this works:

Kevin McFarland, University of Rochester
Later Michelson and Morley further refined the method, in the hope of proving the existence of aether for once and for all. Their experiment is one of the most famous failed experiments of all time, indirectly leading to the birth of relativity theory.

Today I made my first steps towards measuring how fast light travels. My first try was to use an oscilloscope to measure time differences. The idea is to split a beam in two, and send both to phototransistors, but one directly and the other over a distance of, say, 100 meters. 100 meters divided by 300.000.000 meters per second equals 0.3 microseconds, which is easily within measuring range of current oscilloscopes.

I also hoped to use, for instance, my trusted Logitech laser pointer, the one that I use for all my presentations, and which the kids use to play with the cats. It has a nice clicky button, and my plan was to use the button to turn on the laser, which then gets split and travels through different paths to the phototransistors. Unfortunately, it turns out that although the laser turns on relatively fast, it's not fast enough:

As you can see, the rise time of the signal is about 40 microseconds. I'm not going to be able to recognize a time lag of 0.3 microseconds in a 40-microsecond-ramp, that will disappear in the noise. Hmm, this is not yet right.

It turns out that the response time of the phototransistor I'm using is 15 microseconds, so the slow increase is probably due to the laser itself. Since lasers can be much faster, maybe I can find a way of hacking a laser pointer to fire up quickly. With a faster phototransistor I might be able to get somewhere. 

Unfortunately, it seems there is another problem: my estimate of 100 meters is somewhat optimistic. The Logitech's beam fans out over 20 meters to a splash of light, about 10 cm wide, with a core of about 3 cm. Over 100 m that will be 15 cm, which makes me worried about being able to detect anything ...

Lots to think about, then ...

Sunday, August 24, 2014

DIY-ing a function generator

It's holiday time! Irene is running with her friends, Elise is making things out of Fimo clay, Gijs is enjoying just pottering around, and me - I'm that old geezer who has found himself a hobby.  Electronics, in my case. This post is about me making a function generator out of a few electronic components and an old sweets box - something I'm insanely proud of despite the fact that (a) any reasonable DIY-er can do it, and (b) I'm sure there are many web pages that will tell you how to do it - and probably much better than I have done.

A function generator is a little device that generates square, triangle, and sinusoid waves, of 'arbitrary' frequency. The heart of this device is the Exar XR2206CP, a 16-pin IC that most sellers consider 'obsolete', but that one can still get on ebay and such. With this IC the actual production of the three different waves is done for you - you 'only' need to connect up the right collection of resistors, capacitors, and switches, as shown by this schematic:

(for some explanation, see below)
Part of the fun is the challenge to get it into a nice little box. Irene gave me a little box of Vermint's Organic Mints, and I decided to try and fit everything into it. In the end all did fit in, but only just. Here's the finished product:

After having worked out the schematic above, I ordered the missing components at farnell. I was a little taken aback that the two potentiometers - the big round things, like volume knobs - were so big that there was very little space left for the rest of the components.

The rest of the components all had to go on a piece of stripboard, which is a flat piece of fiberglass-epoxy with holes predrilled and one side covered with copper strips. I use the 'tripad' variety, with strips three holes long. Because of the little space left by the potentiometers I did my best to optimize for space, leading to the schematic below. You can recognize the 2206 chip in the middle, and the copper strips in groups of three (indicated by ovals). I managed to keep the whole thing no wider than 8 holes, which is the length of the IC. But that did mean that everything got bunched up, nothing like the clean spacious designs one finds on electronics websites :-)

Soldering is not my strong point, but in the end I managed to get everything in place. Then came the issue of assembling everything in the box. I found that one of the hardest parts was actually drilling nice round holes - for some reason, that I don't really understand, I often get asymmetric holes (like the last picture in this page; maybe one day I'll try that suggestion, to drill through some cloth). But finally everything was done, and the whole set fit into the box.

Here are some of the ouput plots, such as a sine wave,

a triangle wave,
and a square wave:
This all works as it should. (A big thanks to Merijn Wijnen for letting me use his oscilloscope!)

The frequency range is supposed to go up to 1MHz; I pushed things slightly further by using a smaller capacitor, and indeed the frequency can go up to 4MHz, but then the square wave does not look very square any more:
The sine wave is not too bad at 4MHz,
but the triangle wave doesn't look right either;

With this sub-spec capacitor it also turns out that the frequency is not exactly constant. Here you can see how the later waves come in at different times: while the lines are clean on the left-hand side, just after the trigger (as they are automatically since the scope triggers on them), towards the right one can see multiple versions of the waves, at slightly different times.
And to make things worse, if I touch the box somewhere, then this frequency shifting becomes much stronger:
I don't yet understand exactly what causes this phenomenon.

Concluding, this was a very nice little project with some good challenges (at least for me) along the way: designing, optimizing, soldering, drilling - and with a nice function generator as a tool at the end!

Comments on the circuit schematic:

The 2206 outputs a square wave on pin 11 (provided one adds a pull-up resistor) and a triangle or sine wave on pin 2; the choice between triangle and sine is made by the switch between pins 13 and 14 (the bottom switch in the box, with the blue body). The frequency is set by the components on pins 5, 6, and 8; the capacitor between 5 and 6 charges and discharges through the resistor at 8, and therefore the frequency of the output is roughly equal to RC. I put in three capacitors, of 100 pF, 10 nF, and 1 uF, which are switched through the top switch (with the red body); the resistor is variable (the right potentiometer). This gives me three ranges swept by the potentiometer, starting somewhere below 1 Hz, and ending at the 4 MHz that I showed above.

The funny arrangement at pin 3 determines the amplitude of the wave; when pin 3 is at exactly one-half Vcc the amplitude is zero; the variable resistor modifies the voltage at pin 3. 

There are two trimmer resistors (at pins 15-16 and 13-14) which can be used to slightly modify the form of the sine wave. I chose an intermediate frequency and twiddled them until the FFT of the sine wave had the least overtones. 

Finally there are a number of 1 uF capacitors sprinkled around to prevent cross-talk between different bits of the circuit.

Wednesday, August 06, 2014

Hoe plakt bandenplak het best?

Net als de meeste Nederlanders heb ik de kunst van het bandenplakken via-via opgedaan - van mijn vader, van vrienden, en van toevallige bijstaanders met commentaar op mijn techniek. De laatste paar keren wringt het een beetje: ik heb niet het gevoel dat ik echt goed snap wat ik aan het doen ben.

Om maar iets te noemen: hoe lang laat je de lijm drogen voordat je de plakker erop doet? Moet het nog nat zijn, of juist niet? Ik heb 'tien minuten' gelezen op, maar ook 'zeker drie minuten' of zelfs niets. Wat gebeurt er precies tussen band, lijm, en plakkertje? Ik heb het gevoel dat het oranje materiaal aan de plakkant van het plakkertje belangrijk is, maar ik weet niet precies hoe. De lijm wordt vaak solutie genoemd, wat een vorm van oplossen suggereert, maar wat gebeurt er precies? Ik weet het niet, en werd van het internet ook niet wijzer.

Dus werd het tijd voor experimenten. Irene heeft op mijn verzoek een fietsenmaker lief aangekeken en een oude binnenband geregeld: genoeg materiaal dus. Vandaag: wat voor lijmprotocol zorgt voor de beste hechting?

Experiment 1: vijf verschillende droogtijden, van 0 tot 180 seconden (toen had ik de 'tien minuten' nog niet gelezen). Verdere details: ik heb de plekken opgeschuurd en met keukenpapier schoongeveegd; geen verdere ontvetting. De lijm (Simson, nieuw gekocht) heb ik met de spuitmond van de tube zo goed mogelijk dun uitgesmeerd. De plakkers waren ronde stukken geknipt uit Simsonvellen. Dit zijn de bevindingen:  
  • Ik heb gekeken of de oranje laag goed is uitgelopen en aan de band bleef hangen, wanneer je aan de plakker trekt. Dit lijkt goed te werken zolang de lijm er droog uitziet wanneer je het plakkertje erop doet; dat was het geval bij 60 seconden of meer wachttijd.
  • Ik heb na tien minuten gekeken hoe makkelijk de plakkers eraf te trekken waren. Dat viel me tegen - alle vijf waren zonder probleem eraf te halen, en ik merkte geen verschil tussen de vijf. 
Ik was verbaasd dat alle plakkers er zo makkelijk vanaf kwamen. Dat leek me niet goed (maar zie hieronder). Experiment 2 was daarom om vier verschillende schoonmaakmethoden te vergelijken: alleen schuren, schuren en afvegen (hetzelfde als Experiment 1), schuren en met spiritus afvegen, en schuren en met terpentine afvegen (ik realiseer me nu dat ik ook 'niets doen' als protocol had moeten proberen - wijsheid achteraf). Verder 60 seconden droogtijd.
  • De band ziet er verschillend uit na de vier behandelingen: afvegen na schuren geeft uiteraard een gladder oppervlak, maar terpentine lijkt de band enigszins op te lossen - er blijft een zwart residu achter op het keukenpapiertje, en de band blijft donker zwart achter. 
  • De vraag was of er verschil in hechting was tussen de schoonmaakvormen. Dat was er zeker: bij spiritus en terpentine moest ik meer kracht gebruiken om de plakker eraf te trekken, en bleef er meer plakresidu (en zelfs wat oranje materiaal) achter op de band. 
Zelfs bij terpentine en spiritus vond ik de hechting nog onder de maat, maar ik begon me nu wel afte vragen of mijn inschatting van hechtingskwaliteit wel goed was. (Antwoord: ik weet het nog steeds niet). De verdere experimenten hadden allemaal als doel om andere variabelen te proberen.

Experiment 3: Variabele droogtijd, van nul tot 120 minuten; schuren, terpentine, 60 seconden droogtijd. Resultaat: geen enkel verschil.

Experiment 4: De lijmvrije pleisters 'BBB Leakfix': deze plak je direct op de geschuurde band, zonder lijm. Resultaat: er is een vergelijkbare laag als de oranje laag van Simson (maar zwart), die ook zacht wordt en hecht; maar de plakker is er net zo makkelijk vanaf te trekken.

Experiment 5: De voorverpakte plakkers van Simson, met een aflopende oranje laag. Verder terpentine, 60 seconden. Resultaat: geen verschil, al moest ik de band plus plakker doorknippen om goed aan de plakker te kunnen trekken: de gladde aansluiting zorgt wel voor verminderde 'pulk'-mogelijkheden, wat waarschijnlijk goed is.

Experiment 6: Iemand suggereerde om honderd hamerslagen op de plakker te geven (het argument is dat vulcanisatie een fysico-chemico-mechanisch proces is, dat het beter doet bij mechanische manipulatie en hogere temperatuur, en hamerslagen helpen bij beide). Daarom: twee plakkers, één met honderd hamerslagen, de ander zonder, verder hetzelfde protocol. Resultaat: geen verschil.

Experiment 7: Is temperatuur dan belangrijk? Meteen na plakken 20 minuten op 160 graden Celcius. Resultaat: dit was de best vastzittende plakker van allemaal. Nog steeds was het eraf te halen, maar het koste deze keer echt moeite.

Conclusie: Wat hebben we hiervan geleerd?
  • Misschien is het niet zo erg dat je een plakkertje er makkelijk af kunt trekken wanneer hij net geplakt is; misschien verandert dat namelijk over de dagen en weken erna, mogelijk ook vanwege de mechanische belasting in het wiel.
  • De volgende keer dat ik een bestaande binnenband met plakkers buiten de velg heb, zal ik kijken of die (oude) plakkers er niet zo makkelijk vanaf komen. 
  • Hoe zouden we de theorie van het langzaam verder 'garen' kunnen testen? Sommige van onze fietsen hebben een erg makkelijk demonteerbaar voorwiel. Misschien een keer een serie plakkers op plakken, en ze dan één voor één over de weken eraf trekken ... ?