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".
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.
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".
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.