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).
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…
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.
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..
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: