Sous-vide Steak (medium-rare?) and it’s a wrap!

Exactly the same process as previous Sous-vide Steak (medium-well) attempt but this time 3 hours at 59°C.  Though I am unable to produce appetising food photos… maybe I should take cooking and/or photography lessons.

A firm, well textured exterior that has a delightfully full flavour, cutting into it reveals the tender and juicy interior.  Unfortunately slightly too rare for my liking, but nonetheless exceptionally prepared medium-rare steak given the minimal effort involved.

Anyway, that concludes USB-controlled temperature regulated Forebrain-powered sous-vide Mini-fridge.  It is time to turn to running a business…

Information about the Forebrain dev board: http://www.universalair.co.uk/forebrain


If anyone’s interested in the code, let me know.


Sous-vide Steak (medium-well)

I’ve decided to pull out all the stops and test the fridge at a higher temperature of 65°C (149°F), which represents almost the highest temperature we would need the fridge to operate at.  I had a little concern with the silicone sealant holding up, and this was the first time that I’ve had the the water line above the sealant.

At this temperature, I would expect beef to be cooked medium-well.

Choice here is rib-eye steak, good quality with reasonable cost.  We season the steak (salt, pepper, a touch of garlic), and water-immersion seal in a sealable bag.

Into the fridge, preheated to 65°C with 2 litres of water.  I’ve increased the proportional gain to 80, and reduced the integral gain to 0.05 (changed from 60 and 0.1, which resulted in a bit of overshoot).

After 3 hours, the steak is an ugly grey colour, along with a myoglobin saturated puddle…

…but Grill Skillet can fix that!

Result!  To create a nice harmony of colours, the steak is served with a (amateurishly prepared) protatoes and mixed greens.

Medium-well done steak is less juicy than medium and rare stakes, and lack the flavour highlights.  Not everyone likes steak that way.  But for those who do, medium-well is quite difficult to achieve without ending up with a piece of leather.  Cooking sous-vide produces medium-well steak with a perfect chewy texture with just the right level of juiciness and with no risk of turning it into a dusty charred lump.  This steak was absolutely perfect for medium-well, and the amount of effort to get it so was minimal; a triumph for sous-vide mini-fridge!

Take 2:  This steak was cooked at around 61°C, intended to achieve a perfect medium steak, but then I may have overfied it afterward, causing the inside to cook further until it was as well done as the last attempt.  Cutting into it revealed a bland grey-coloured interior instead of slightly pink of a medium steak.


Temperature calibration

So I tried a little harder to calibrate the PT100 readings, although I don’t really have the right equipment for that.

Setting the target to 35 degrees.

Wait for the temperature to rise, and watch the PID output change.

Open the lid and quickly check the temperatures with all the thermometers I can find!

Repeat after filling the fridge with ice (sorry no pictures), and then apply linear calibration.


Salmon Sous Vide

Finally, with the hacked mini-fridge turned temperature-regulated sous-vide cooker, it’s time to cook some salmon!

DISCLAIMER: I’m an engineer, not a chef! There are plenty of really good sous-vide recipe sites out there, if you try these, there are no guarantees of edibility whatsoever.

Tools and materials used: 1x hacked mini-fridge, 1x salmon fillet, seasoning for the salmon (in my case, salt, pepper, beer that nobody wanted, light soy sauce, parsley, dill).

Seasoning the salmon.  I am using the same seasoning for the salmon as my microwave salmon recipe:  dash of salt and pepper, and then slather with light soy sauce and beer (normally I would use an asian beer – Tiger or Tsingtao, but here I’ve used a bottle of Becks that has been lying around for a while now that nobody’s been willing to drink), and some herbs (parsley and dill).

Sealing it up:  Normally with sous-vide cooking, the food is vacuum packed (“sous-vide” means “under vacuum”), I didn’t have a vacuum sealer or vacuum bags, so I’m using the next best thing – food bags.  These are Tesco food bags, and I’m specifically using these because they’re microwave safe (I take that to mean it’s not going to leach any nasty chemicals at high temperatures).

To “vacuum” seal these  bags, I can simply immerse it in water.  The water squeezes all the air out of a bag.  The result is almost as good as a vacuum packer, and plenty good enough for sous-vide use.

Next I set the mini-fridge to 50°C via USB with my control app (thos following the build may remember that I neglected to actually install any buttons on the outside of the fridge, and so all the controlling is done over USB).  The PID controller gains are set to P=60, I=0.1, D=0, values that gave us good results when I was doing the PID tuning previously.  Again, if anyone wants my code, contact me!

In it goes.  The salmon is kept off the bottom with a simple plastic construction (made from the mutilated halves of the plastic shelf which came with the fridge).  Next time I’ll add a bit more water.

One thing I had been concerned about was the possibility that the temperature inside the fridge would drop by a large amount when the cold food went in.  The data log does register this drop, but the effect was not too bad.  It’s possible to quite clearly see the rapid drop from 50°C to 48.5°C as the salmon was inserted (the two sharp drops correspond to the heat loss when the fridge door was opened, first to insert the plastic frame, and the second time to insert the fish).

The temperature recovers slowly (since the fridge’s peltier element is only capable of producing about 70W of heat at those temperatures), however because of this slow rise, the integral component of the PID controller has time to wind up, resulting in a large overshoot as the integral unwinds.  I should be able to reduce the effects of this by adjusting the PI gains next time, however the easiest thing for us to do is to raise the temperature to a couple of degrees higher than before putting the food in.

After 40 minutes, the salmon is medium done, the way I like it.  People who like their salmon rare, or well-done, would set the cook temperature higher or lower by a few degrees.

I also like my salmon to have a bit of crispiness, so it goes onto my cast iron grill skillet briefly for some Maillard reactions (I can’t emphasise how awesome this grill-skillet is, it can turn regular bacon into EPICBACON).

Unfortunately the salmon fell apart a little bit on the skillet, and it looked so good that I started eating it before I could take this next photo, but this is truly incredible salmon – underneath the crispy and aromatic outer layer is an incredibly tasty centre with the perfect amount of juiciness and tenderness, a gentle suffusion of seasoning, and a texture far more consistent than can be achieved through other means of cooking.

This photo doesn’t do justice to the tastiness of this salmon, I will have to add some pictures when I next cook some salmon.


Fridge PID tuning

Again, can’t attach zip files to WordPress, if anyone wants source code, contact me. I may put things on GitHub at some point

With the fridge built and tested, it was time to tune the PID controllers. I wrote a little add-on to the old USB temperature probe script to handle sending the PID gains and target temperatures (and also controlling the LCD display mode and backlight). (In the end I settled only PI control because of saturation effects).

After a bit of tuning with just the proportional gain, the results weren’t bad, quite clearly some oscillation going on here, with an error of a bit over half a degree.

So I add in some integral gain via the Ziegler-Nichols method. Again, not bad, but still a bit of steady-state error.

After a bit more tuning, and some substantial optimisation and bug fixing of the code, I start getting closer. A bit of an overshoot, but generally accurate to within maybe 0.3 degrees now after it settles.

This time it turned out that the method I was using to avoid integral windup (limited integral history) was causing the steady-state errors, so I adjusted the PID implementation to use a different method (disable the integral until close to the setpoint):

Perfect! The graph shows that if we tune the PI to get rid of the steady state errors, I can achieve +/-0.05 °C resolution (I believe the resolution after oversampling to 1 minute is accurate)

Note: resolution doesn’t mean it’s ACCURATE, I haven’t spent too much time calibrating it!

I think it is time to cook something…


Fridge thermal testing

Finally, I got around to writing code for the fridge. WordPress doesn’t let me upload zip files, so let me know if anyone’s interested in the code.

I did some thermal testing of the fridge test its insulation (and also do some calculations on thermal loss). I filled the fridge with about 1.6l of water, set its output to maximum, and logged the temperature as it heated up using my tempearature logger code (the data is coming off the USB cable using USB HID).

Plugged the USB cable in. Surprising effect from the USB LED shining through the thin plastic.

Filled about 1.6l from the tap

And heated up. Bubbly!

The water from the tap was some 10 °C below ambient. Also It would seem that opening the lid to take that last photo has quite a noticeable effect on the temperatures.

Heating is almost painfully slow, taking some three hours to reach its peak. There’s a noticeable dip at the top there where I opened the lid to take the photo. This dip is very noticeable in later graphs.

The power flow diagram for the system looks something like this:

The peltier acts as a solid-state heat pump, putting electrical energy in results in a transfer of thermal energy from one side to the other. As a result, one side gets cold, while the other gets hot. However, the resulting balance is not symmetrical, since the input electrical power ALSO results in a heating effect.

The net result is that the peltier creates much more heating than it does cooling. This is good news for us because I WANT to use that extra heat, it means I get more heat than it has expended energy for (i.e. maybe 60W of heat from only 30W of electrical energy, a coefficient of performance of 200%, compared to 100% for regular resistive heaters). This is however bad news for fridge mode, and also people trying to use peltiers to cool their CPUs, as they have to dissipate much more heat than the would otherwise.

Because I know the volume of water, and its temperature rise over time, I can easily calculate the thermal energy entering the water over time, i.e. I can calculate the power gained by the water:

E = m c ?T

P = E / t

Plotting the power gained by the water over time reveals that this value starts at about 65W, and drops over time (as the water temperature increases) to about 20W.

I can later graph this power gain against temperature, which is a more useful graph. However, I first turn off the heater and let the water cool by itself, and use the same equation to work out the power lost by the water through the insulation as a function of temperature gradient (the difference in temperature between the inside of the fridge, and the outside). This is the red arrow in the power flow diagram above.

The data is a little patchy here, and incidentally it also exhibits a little jump where I opened the lid a second time to check the calibration of our PT100 probe with a meat thermometer. I must remember to stop screwing with the results like this…

I assume that the power lost is linear with temperature gradient (a valid assumption based on the physics of thermal energy flow), and so I find the power loss to be approximately 0.44W/°C.

I can add this value onto our results for Power Gained, to find the total power entering the fridge from the peltier as a function of the temperature gradient:

The results are very interesting, as it shows that the thermal power produced by the peltier at zero temperature gradient (inside of fridge at same temperature as outside of fridge) is around 60W, which is quite a bit higher than the maximum electrical power consumption of 40W (according to the sticker on the back of the fridge). This is good: it is heating the water with more energy than the amount of electrical energy put in.

I highly suspect that the fridge is using a 12706-type 60W peltier element, since such elements are extremely common and cheap (you can get them at about £3 a piece).

Digging up the datasheet for the 60W 12706 peltier elements, I can see that the specs match those of the fridge. The fridge claims a maximum electrical power consumption of 40W, which is consistent with running the peltier at 12V (it is only 60W when running at around 15V).

I can also make use of the graph of thermal power transferred against temperature difference:

I can take the 3.0A line (for this is about where we are operating), this is the green arrow on our schematic, and subtract it from the total power (the pink arrow on our schematic, and the pink data points on our graph), to find the approximate electrical energy consumed. (There is a minor flaw in this: by taking the straight 3.0A line, I’ve assumed that the electrical energy consumed is constant, which is not the case, but it is a reasonbly close estimate).

The green line is this data (above), and the purple points are the calculated electrical power consumed. Showing an actual electrical power consumption of about 30W, consistent with what I expected. (Although I would normally expect the electrical power consumed to drop as temperature gradient increases owing to the thermoelectric effect).

So I’ve proved that I’m getting somewhere between 120% and 200% of the electrical power going in for heating. The mini-fridge temperature controlled system is therefore extremely energy efficient, more-so than regular resistive heaters used in other slow cookers and sous-vide cookers. The bonus is (in the summer anyway) that my room also gets colder as the heat is pumped into the water (although probably not a noticeable amount).


Mini fridge build part 3

With most of the components installed in previous steps, it’s a case of bringing in al the parts and connecting them to Forebrain.

Pictured above is actually one of my MK5 Forebrain prototype units (http://www.universalair.co.uk/), hence the colour, lack of silkscreen, and the fact that all the components were lovingly soldered by hand. The bit of stripboard on the left holds the potentiometer for the LCD’s contrast input, however it turns out that the best setting for this is all the way down, so it would have been sufficient to tie the LCD’s contrast pin to GND.

Connecting the PT100 temperature probe:

I’ll supply the code at some point if anyone requests it.

A hole is drilled through from the back electronics compartment all the way through to the inside of the fridge for the PT100 probe. All the gaps are sealed up with RTV sealant.

Finally, the whole shebang is perched on top of the fan at the rear, with a hole in the side cut for the USB port. Since I neglected to install any buttons (and the buttons on Forebrain being unavailable), the only way I am going to control this fridge is via USB. This will perhaps become the world’s first USB mini-fridge.

Oh, one last thing – because I am going to fill the inside of the fridge in water, I need to have the fridge stand on it’s back. Because the air intake is at the back, I need to stand it off with something. This turned out to be as simple as transplanting its rubber feat from the bottom to the rear.

Ready for action…as soon as I get around to programming the code for it…


Mini fridge build part 2

Because no project is complete without some sort of optoelectronic display, I’ve decided to attach an LCD to the fridge for the nerd-cred.

It appears the the mini-fridge is constructed with two shells, with the internal space filled with expanded polystyrene. The mini-fridge’s door is of similar construction, providing us with ample space in which to mount the LCD display. The LCD display itself is an inexpensive STN display with a paralel data interface consisting of 8-bit wide bus plus 3 control wires, courtesy of the HD44780 chip.

Accessing the inside of the fridge door is possible by finding the super-secret hidden screws behind the black foam seal (I can’t work out exactly why they need a whole 10 screws to keep on the front of the door).

Like candy, the fridge door combines a hard sugar-coated shell with a cruncy interior.

With the door panel off, I can mark out and cut the viewport. With that done, I next start cutting conduits for the cable. Because of the fridge’s two shell construction, there should be room for us to run a cable between the layers. I start by cutting a hole in the back end where the electronics are, and a corresponding hole at the top side.

Because the intervening space is filled quite tightly with styrofoam, it’s not a simple case of pushing the ribbon cable through, I need to pull it through with something. The only thing I had on hand at the time was my trusty metal ruler, which has a hole on one end. So I decided to shove this metal ruler up the inside of the fridge, and then try to attach some nylon cord to the hole and pull that through. The nylon cord can then be used to pull the ribbon cable through (there was no way of easily attaching the ribbon cable directly to the ruler.)

At this point, I feel that my time watching all those TV medical dramas have paid off – I have fashioned a paperclip into some hook, threaded a loop of nylon, and via an incision in the top of the fridge, I hooked the paperclip onto the hole of the metal ruler, laparoscopy style.

With the loop of nylon pulled through, I then used that to pull the ribbon cable through, which is actually a loop of flat CAT6 ethernet cable.

The cable is stripped, and soldered to a socket, plugged into the LCD, and duct-taped into position. I’ve made a bit of a dog’s ear of the polystyrene. No doubt I could have carefully cut the polystyrene to shape instead of ripping it apart with my bare hands. raaaar.

Finally, the cable is thread through another hold, and there is enough play in the cable to avoid stretching it as the door opens and shuts.


Mini fridge build part 1

Following the schematics I posted previously, I made up a little board containing all the external components, including the resistors, optoisolators, and isolated DC/DC converter.

The DC/DC converter in question is the XP Power IE1205S, costing £4, which is by far the most expensive component on this board. This little black square in the bottom left of the board in the image above, converts the 12V DC of the fridge’s power supply to 5V, which feeds Forebrain. In addition, there is isolation between the two sides.

The isolation is probably not strictly necessary since the fridge’s mains transformer board should also isolate its 12V supply from the mains too, but better be safe, particularly when I intend to plug Forebrain into my computer via USB. The isolation will prevent any unhappy “incidents” involving computers and mains electricity.

Beside this, there is also the rather fetching ivory-white chip, which is the optoisolator, a Vishay Semiconductor K824P, this chip allows the transistor on the fridge’s 12V side to be controlled, in an isolated fashion, by forebrain.

And there is also the TO-92 packaged BC237 transistor that drives the LCD’s backlight.

The three wires coming off this board are: orange (12V), black (PGND), and green (control signal). You will see these wires in later images.

The green control signal wire is attached to the base of this here TO-220 packaged BDX53B NPN darlington transistor, which in hindsight was probably a very poor choice (it has quite a large collector-emitter saturation voltage). I should have used a MOSFET instead.

However, by a quirk of thermodynamics, the large collector-emitter saturation voltage of the transistor doesn’t bite us in the ass half as hard as it should have; the high saturation voltage means that a lot of the power that was supposed to go to the peltier is instead lost as heat in the transistor. But because the peltier is a thermoelectric device, I can use it to pump the lost heat of the transistor back into the inside of the fridge! All I have to do is clip the transistor to the peltier’s heatsink, which will get cold as the peltier siphons the heat out of it and dumps it in the fridge like some kind of thermodynamic vampire.

But first, wiring the rest of the circuit:

This is the junction between the fridge’s mains supply board and the switch board, as per the schematics I posted previously, I have to wire our transsitor in the black wire there, to control the power flow from the mains supply board to the switch board (and therefore controlling the power supply to the peltier and fan). I also need to access the 12V supply as well to power Forebrain, the LCD, and the temperature probe.

Snip snip snip (somehow it seems wrong that I’m making sound effects to accompany my blog pictures)

CUT THE RED WIRE…THE RED WIRE!!! NO WAIT…THE BLACK WIRE…THE BLACK WIRE!!! AAAARGH…CUT THEM BOTH!!!

I cut the red 12V supply wire to solder our orange wire into it, reconnecting the severed ends.

Next, I strip and solder some leads to the bifurcated black PGND wire (I’m calling this black wire Power-GrouND to distinguish it from the isolated 5V GND that Forebrain uses). These are the brown and a blue wire in the image (no doubt previously scrounged from some mains lead in the forgotten past). The ends of these wires are connected to the collector and emitter pins of the transistor (importantly the collector comes FROM the switch board, the emitter TO the supply board).

As previously mentioned, I will attach this transistor, and it’s 7W heat loss to the peltier’s heatsink. If I had used a MOSFET or a BJT with less VCESAT, then this whole heat-sink attachment operaion wouldn’t have been necessary.

Heatsink paste must be applied as the side of the heatsink fin that the transistor is to be attached to is ribbed and doesn’t have a smooth surface. Unfortunately that nice wide flat area of the heatsink wasn’t quite wide enough to accept the TO-220 transistor.

I should mention at this point that the tab of the TO-220 transistor is connected to the collector pin. Since I’m not using any insulation between the tab and the heatsink, the heatsink is likely to be connected to the collector via the TO-220 tab, and therefore can be anywhere up to 12V relative to PGND. While I did check that the heatsink itself was not connected to any of the other wires, and therefore no chance of electrical short, I did find out after construction that the inside of the fridge itself is enameled metal. Given that the heatsink is bolted to the peltier, which in turn appears to be bolted to the metal interior of the fridge, there is a good chance that there could be an electrical connection between the heatsink and the metal interior via the bolts.. It would therefore be a good idea not to touch the inside of the fridge while the mains is plugged in in case I was wrong about the fridge’s supply being isolated.

I simply clip the transistor to the heatsink with this 100 year old invention, a baby-blue binder clip (I wonder if babies are really this blue colour). The great thing about the binder clip is that the handles are designed to be removable, leaving a semi-permanent atachment..


Schematics

The two main elements to this build are: 1. control of the mini-fridge’s peltier element and 2. measurement of the temperature.

Having investigated the mini-fridges internal workings previously, I’ve established that the fridge’s internals is fairly simple, consisting of a large mains to 12V DC supply board, which supplies 12V DC to a switch board. The switch board contains a switche that allow the direction of voltage supplying the peltier to be switched (this allows the fridge to change from heating to cooling modes).

The simplest option in controlling the peltier is to attach a transistor between the mains board and the switch board, this allows the fan to be also switched. I can also splice into the 12V DC rail to power the Forebrain microcontroller board too. Isolating devices are used here (the isolating 12V to 5V DC/DC converter, and an optoisolator fo controlling the transistor.

Oh yeah, I had this LCD lying around too, I’d better throw that in as well: