Raspberry PI fridge

The Homebrew Forum

Help Support The Homebrew Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

PaulCa

Regular.
Joined
Feb 28, 2012
Messages
311
Reaction score
6
So my fridges warmest setting is about 8C, no good for fermenting a lager.

I already had a Raspberry PI, breadboard, temp probe and relay lying around, just not put together and so I put together a small prototype.

I really do have to tidy up the mains hack! It's properly soldered and insulated, it's just not tidied up to "look" safe. Since these were taken the main voltage and live relay has been taped up in the pink box and electrical tape around the "plug hack".

P1070431.JPG

P1070436.JPG

P1070434.JPG


Well, it works.

Temp < 12C Relay OFF
Temp > 13C Relay ON
I used a C program which reads and decodes the I2C temperature chip once a second, if it gets a bad read it ignores it. I used wiringPI libraries for the handy GPIO functions to turn the relay on and off.

The problem is the TMP102 sensor, it doesn't like being on the end of a wire. If I connect it directly to the breadboard I get a good read everytime. If I connect it to the end of even 6 inch bit of wire I get at least 50% failed reads. Sometimes it goes unreadable for several minutes and then gives a ridiculously high or low reading. However I am able to put the whole bread board into the fridge with the ribbon (and relay connector) crossing the door seal.

Phase 2 will be to encapsulate the relay in a C++ class so that it had a minimum cycle time, ie, 1 minute between state changes. That and tidy things up.
 
Cyclops said:
Have you tried adding a capacitor to the temp sensor to try and help the temp faults?

Not sure how that would work, it's not an analogue sensor it's an I2C/SMBus thing. I think the data from it is digital. Not sure though.

The other possibility is that I am using cheap chinese servo wire which probably only has a few strands of actual conductor, although, they do work with 2Amp power to a servo fairly well without heating. Maybe a bit of shielded USB cable would work better.
 
I think I would write a separate program just to test the sensor.
It really shouldn't give errors at only 6" from the i/p.

With just the sensor connected does it still give the error, increase the length of the sensor wire and keep testing, if you don't get errors when it is connected on its own then it is interference from something else.
 
I've been using the sensor for ages on the breadboard and the only time it errors is when you touch it with your finger. I had it logging temp in my house every 5 minutes for a month without fault previously. Helped me optimize the heating timer settings :)

As soon as I put it onto the end of a bit of wire, I have tried both a ribbon style servo wire (3 conductor and handy breadboard compatible connectors) which is 12 inches long and a shorter twisted style servo wire and both produce a greater than 50% error rate. To be honest it was getting enough data to operate the fridge, but the anomolous highs and lows would incorrectly switch the relay on or off occasionally.and my worry would be it flipping out completely and cycling the relay on and off every second. The ultimate temp in the fridge is protected by the fridges own thermostat which will take it down to about 8C.

I'll take a look for a different temp sensor maybe (Any soldering free recommendations?), but ultimately the fridge is working, if only with a breadboard hanging inside it. The temp reading from an independent digital thermometer inside the fridge is about 1*C cooler than the sensor is reading, but they are in different locations and the beer is still producing a few millimeters of krausen so all is good.
 
TBH the sensor shouldn't give errors like that, that was why I said test it on its own. IF it is still erroring then maybe your psu isn't up to the load? Are you feeding it from the 3.3v or the 5v line?
You should be able to have it on the end of a 10M line and it should still give the correct reading, it is a digital signal that is returned (bit like a ping) rather than a resistance. So if it errors then there is something wrong somewhere.
 
Back
Top