I have grouped all the circuits used in my UberFridge project in this article. Schematics, a board layout and pictures.
I have encased most of the electronics for UberFridge in a small casing made from an Ikea box lid, see this article. The sensor wires go through the top of the fridge to the light bulb housing in the fridge. The relays are on a separate board. All other electronics are in a plywood casing, see the image below.
The Arduino Board
I have made a small circuit board with headers for the Arduino Nano and headers for the display, buttons, sensors and relays. When I make a circuit on prototype board, I still like to make a board layout in Eagle to plan the tracks. I just set the grid to .1 inch so that the track distance corresponds the holes on prototype board. See the board layout below.
The buttons are debounced with a resistor and capacitor. They connect to analog pins 5-7. Because A6 and A7 are only connected to the A/D converter, the buttons cannot be read digitally, so they are read with AnalogRead().
The OLED display is connected in 4-bit mode.
I use 2 LM35 temperature sensors, one in the fridge and one in the fermenting beer. Both sensors are detachable to make it easier to sanitize them. I use 3.5 mm stereo jack plugs to connect the sensors and I also used some jack plugs as sensor housing. The beer sensor housing is a male jack plug with the pin cut off and is filled with epoxy.
The sensors don’t like a capacitive load, so I have given the outputs an RC-damper as the datasheet suggested. The output over the sensors is 40 mV – 300 mV, which is digitized by the A/D converter of the atmega328.
To prevent power supply disturbances on the sensors, the sensor supply voltage is decoupled from the main power line. The 100 Ohm resistor is also necessary to prevent a short circuit from 5V to ground when the jack plugs are inserted.
To control the temperature in my Fridge I let the Arduino switch the compressor on when the temperature is too high. When the temperature is too low, I just turn on the light that was already in the fridge. It’s a 15W light bulb and it produces enough heat to get the fridge to 30 °C. I have rerouted the door switch that normally controls the light to the Arduino, so that it knows when the door is open. The compressor and light bulb are switched with two relays.
I have interrupted a few connections on the circuit board that was in the fridge and rerouted the signals through the relays. The relay board is powered by a separate adapter, because the relay current caused a 5 mV drop on the 5V line. This caused the sensors to have a 1 bit error, which is unacceptable for the control algorithm.