Hardware (Electronics)
From the many reactions I received from fellow home-brewers, I acknowledge that, for most of you, it is rather difficult to reconstruct the electronics part. Nevertheless, there are brewers who have an interest in automating their brewing setup. Some of you use ready made components, like a PID controller, a PC IO card or a solid-state-relay.There's nothing wrong with that approach, but I did choose an alternative way. Playing around with electronics is one of the most enjoyable things for me to do. And since I hold a masters degree in electrical engineering (Eindhoven University of Technology), I also should be capable of designing such a system. Therefore I chose to design the hardware and the software as professionally as possible. The hardware design, presented on this page, should be sufficient for anybody who is familiar with electronics, to rebuild (some of the) parts of my brewing electronics.
And even if you are not really into electronics, maybe you pick up some new ideas along the way. If not, you can also skip this page :-)
This page consists of the following paragraphs:
- 1. Overview / Architecture
- 2. PC Interface
- 3. Temperature sensors
- 4. Volume-measurements (pressure transducer)
- 5. Interface for Pump and Heating element 3 kW (triac pcb)
- 6. Interface for Gas valves / Burners
- 7. LED Displays (4-digit)
- 8. Cabinet for the electronics
- 9. Datasheets of components: To read the datasheets, you need Adobe Acrobat Reader!
1. Overview / Architecture
This picture shows the hardware architecture and the various interfaces between the components (click to see an enlargement).The picture looks complicated at first sight, but I will try to explain things:
The first component is the PC itself. It is connected with a Centronics (printer) cable to the PC-Interface printed circuit board. This PC-interface is controlled by the brewing program which runs on the PC.
The PC-Interface generates the necessary signals for the I2C bus. The I2C bus is used a lot to connect ICs to each other and is designed originally by Philips. The advantage of this I2C bus is that there are only two binary signals, a clock line (SCL) and a DATA line (SDA).
Every IC connected to the I2C bus, has its own unique address. An even address means a write action, an odd address means a read action. Example: an IC has 0x90 (hexadecimal or 144 decimal) as base address. If you want to write to this IC, use address 0x90. If you want to read from this IC, you have to use address 0x91.
Most of the electronic components of my brewing setup are connected through this I2C bus, e.g. the two temperature sensors. This means that the two binary I2C wires (SCL and SDA) are also connected to the sensors in the HLT and MLT (together with the +5 Volt and the GND wires).
Furthermore, there is an 8-bit IO IC connected to the I2C bus (the PCF8574). This IC generates several binary signals (Heater_ON, Alive LED, Pump_ON and non_modulating_gas_valve_on). There's another PCF8574 connected, which is used solely for switching of the solenoid valves (these solenoid valves are not present yet, the ones used now are manually controlled ball valves. But in the near future, this should be automated as well).
Another IC is a 12-bit 12-channel AD-converter (Analogue to Digital Converter). This is the MAX1238. This IC converts various analogue signals, such as the measured temperatures and the values of the pressure transducers, to its digital counterpart. The digital signals are then ready to be used by the brewing program.
Another AD converter used is the PCF8591, which is an 8-bit AD-DA converter. But only the DA-converter is used to control a modulating gas-valve.
Despite the complexity of this architecture, the main thought behind all this, is a simple one: read values from sensors (such as temperature and volume) and use this to control the actuators (heating element, gas-valves, solenoid valves). And in order to do all that, you need a bit of electronics!
2. PC-Interface
The schematic shown here contains the design for the PC-Interface. The Centronics connector is also called the parallel port adapter or the
printer port.The most important IC here is the PCF8584 I2C Bus Controller. This IC receives data from the PC though data lines D0..D7. Data (8-bit) from ICs on the I2C-bus are sent back to the PC in two portions of 4 bit each. This is the purpose of IC3 (a multiplexer IC). The construction with 2 * 4 bits is necessary because of the limited number of programmable IO lines on the Centronics connector.
The PCF8584 generates all signals for the I2C bus, including all timing aspects. The SDA and SCL wires can be used by any of the other printed circuit boards.
Back to the Top of the Page
3. Temperature Sensors
My first design with temperature sensors involved a LM35, which increases its output voltage with 10 mV for every °Celsius. That voltage was amplified and then being read by an AD-converter. The disadvantage of this approach was the relatively large number of ICs needed.
My current design uses a 12-bit + sign bit digital temperature sensor, the LM92.
This sensor has all necessary electronics already on-board. The only thing still needed, is a connection to the I2C bus. The 12-bit digital code that is read
from the device, is the digital representation of the actual temperature. The LM92 has an accuracy of 0.33 °C.The biggest problem with this device is to mount it reliably in your kettles. I solved this by placing it on a small printed circuit board, glue that at the bottom of a copper pipe, and then cast it with clear plaster resin (with thanks to Marco Mantel for the brilliant idea!).
The picture shows the LM92 soldered to a small printed circuit board, next to a copper pipe already filled with plaster resin. It takes a couple of weeks before the plaster resin has hardened. But then you do have a waterproof construction, which can be mounted inside the kettles.
The address of the LM92 on the I2C bus is adjustable with 2 pins A0 and A1. You can either ground these pins (a logic 0) or connect to the +5 V (logic 1), which creates a total of 4 possible addresses. For the HLT sensor I use address 0x92/0x93 (A1=0, A0=1) and for the MLT sensor I use address 0x94/0x95 (A1=1, A0=0).
I have been experimenting with temperature sensors for a couple of years, but these LM92 are absolutely perfect. You obtain a digital code directly, there's no need for a separate conversion/calibration (which you do need with a PT100 element), no additional electronics are required, they are very reliable and they always work!
Back to the Top of the Page
4. Volume-measurements (pressure transducer)
Measuring volumes in a kettle can be done in a couple of different ways:- Capacitive: Mount two copper plates to the sight-glass, thereby creating a kind of capacitor. If the water level increases, so does the capacitance between these plates. With some electronics you can convert this into a volume reading.
- Ultrasonic: mount an ultrasonic sender and receiver in the top of the kettle. Send a sonic wave into the pan and measure the time it takes before the sonic wave is received again. This is a measure for the volume in the kettle.
- Pressure measurement: mount a pressure transducer in the top of the kettle. Connect a small plastic hose to this pressure transducer, the plastic hose leads all the way down into the kettle. If the water level increases, the air in the plastic hose is compressed. This is sensed by the pressure transducer and converted into an electrical voltage. After amplifying and AD-conversion, it is ready to be used by the brewing program.
The ultrasonic way is definitely worthwhile considering, but it is also a complex way of doing things. You need a decent amount of signal processing to get this right. I found an interesting do-it-yourself project, so it is something I will definitely dig in (if I have some time left...).
The third way, using a pressure transducer, is what I did choose, because it seemed to be the easiest one. I started
with a simple pressure transducer, the MPX12 from Motorola. This transducer is NOT compensated for temperature changes. Testing
this device showed that the concept does work, but the output voltage did vary way too much for a reliable volume reading.The next pressure transducer was one WITH temperature compensation, the MPX2010. This transducer is capable of withstanding a maximum pressure of 10 kPa (which is equal to 0.1 bar, which is the equivalent of the pressure generated by a water column of 102 cm). The maximum output voltage (at 10 kPa) is 25 mV. This is not enough for an AD-converter. So it is amplified by a special instrumentation amplifier (the AD620).
The amplified voltage is then read by a 12-bit AD-converter (the MAX1238).
This is the schematic of the two pressure transducers with the instrumentation amplifiers (and this is the print-layout of the board). The picture shows the two pressure transducers mounted in a box (the printed circuit board is an experimental one, not the final board). To get a reliable signal, I chose to amplify the output from the sensor as close as possible near the pressure transducer. The output from the pressure transducer is amplified 184 times. This amplified voltage is then sent to the electronics cabinet (via the cable shown on the picture)
Also seen on the picture are the two plastic hoses, one for the HLT and one for the MLT.
The signal that is received by the electronics in the cabinet, is filtered additionally by a software (adjustable) low-pass filter. After this, the signal is reasonably accurate. There is still some variation present, because the weather is also a factor now (e.g. a high pressure area). Therefore, an additional calibration mechanism is needed (in the software) during power-up to compensate for this.
Back to the Top of the Page
5. Interface for Pump and Heating element 3 kW (triac pcb)

Switching parts that work with 220 Volts is done by a separate printed circuit board in the electronics cabinet. This board receives two binary signals (Heater_ON and Pump_ON). The triac pcb requires only a 3.3 V or 5 V signal, which makes it suitable for a direct connection to a port-pin of a microcontroller. With this, the heating element and the pump are switched on or off.
The most common used method by home brewers is to use a ready-made Solid-State Relay (SSR). It is not too difficult to create your own SSR, because there are special power electronic components available, which can do the job. A good example is the Triac. In the first design of this board I used the TIC263M Triac. This triac is able to switch up to 25 A at 600 V. This is more than adequate for our purposes. The disadvantage of this triac is that it is not isolated! If you mount the triac to a heatsink, you have to electrically isolate the triac from the heatsink. To avoid this, I now use an isolated triac, the TMG25CQ60F (although the schematic still shows the TIC263M).

The triac for the heating element has its own cooling plate, to which I glued a LM35 temperature sensor. The triac temperature is controlled continuously by the brewing program. If the temperature increases above a predefined level, the triac is switched off. NOTE: the picture above shows the pcb with a small heatsink (and no LM35). This is sufficient to switch a pump, but it is inadequate for switching a 3 kW heating element! For that, you need a larger heatsink!
Most of the intelligence w.r.t. switching is done using a special IC, the MOC3043. This IC contains a zero-crossing circuit. It means that the triac is switched on, when the AC voltage crosses 0 Volts. This assures a smooth switching behaviour, leading to almost no disturbances. Furthermore, the IC also contains a galvanic isolation: if there's a problem in the power electronics, then this does not result in additional damage in the electronics and/or the PC.
The last picture shows the lay-out of the printed circuit board:
Back to the Top of the Page
6. Interface for Gas-valves / Burners
One of my neighbours is a plumber and for every new central heating boiler he installs, and old one is removed. These old central heating boilers are then given to me. Such a central heating boiler contains, next to a decent burner, a gas-valve. Since early 2005 I switched over entirely to these gas-burners, since they have far more power than the ones I used.These gas-valves come in two flavours:
- Non modulating: the gas-valve is either ON or OFF, a position in between is not possible. These burners are controlled (in general) with a 24 V AC voltage. Voltage present means that gas-valve is open, no voltage present means gas-valve is closed.
- Modulating: these gas-valves are controlled by a pulse width modulated (PWM) signal. For this, we need a bit more electronics than with a non-modulating gas-valve. The gas-valve can be set to any value between 0% and 100%. This is ideal for our brewing setup, because the PID-controller provides an output signal that is a percentage between 0% and 100%).
6.1 Non-modulating gas-valve
A non-modulating gas valve only needs to have a 24 V AC voltage.The schematic shows how this is realised. Connector 24V_INT receives a 24V AC voltage, the connector TO_BURNER is connected to the gas-valve.
Control of such a non-modulating gas-valve is done with a relay. To energize the coil of the relay, a transistor is used. The transistor in its turn is controlled by an IO-pin of the PCF8574 I2C IO-chip.
The output of the PID-controller in the brewing program is a percentage (between 0% and 100%). The is the amount of power needed. This signal can not be used directly to control the relay. If more power is needed than a predefined threshold value (e.g. 40%), the relay is switched on. The relay is switched off when the PID controller output is lower than another predefined value (e.g. 35%). This hysteresis prevents that the burner is switch on and off again within a short time period.
6.2 Modulating gas-valve
A modulating gas-valve is controlled by means of a PWM signal, as stated before.The picture shows a PWM signal. Striking for a PWM signal is that the frequency of the signal is fixed. Most gas-valves expect a PWM signal with a frequency f of about 20 kHz (the period time T is then 50 microseconds). The amplitude (height of the signal) is often a value between 24 and 28 Volt.
For a pulse width of 50 %, the duty-cycle of the signal is the same (on-time is the same as off-time), for a pulse width of 20 %, the signal is high for 20% of the period time and low for 80% of the period-time.
A PWM signal of 100% always high, whereas a PWM signal of 0% remains low all the time.
To control a modulating gas-valve, we need the following:
- A power supply that delivers 24..28 V DC (besides the power supply for the electronics)
- An oscillator circuit that produces a 20 kHz square wave signal
- A circuit that generates a PWM signal
This schematic contains all the required circuits. It creates a 28 Vdc supply voltage, it contains a 20 kHz signal generator, which produces both a
square wave and a triangle waveform. The triangle waveform is the input for IC3C, which compares this signal with a DC voltage from the DA-converter (which
in its turn is controlled by the brewing program). A small DC voltage generates a PWM signal with a large pulse width, whereas a large DC voltage generates
a PWM signal with a small pulse width.By using the open collector output of the LM339, the output can be connected directly to the 28 Vdc supply voltage. The transistor BC640 switches the coil of the modulating gas-valve
The print layout of the entire printed circuit board is given here.
Back to the Top of the Page
7. LED-Displays (4-digit)
The LED-displays are mounted on the front-side of the electronics box. There are a total of four LED-displays. Each LED-display consists of four
7-segment displays. Each LED-display is capable of showing a number of four decimals. The decimal point can be shown behind every digit.
The LED-displays can be used to display the various measurements (temperatures, volumes).The heart of every LED-display is the SAA1064. This is a 4-digit LED-driver with I2C-interface. The schematic itself is from Elektuur / Elektor, which I used without modifications.
Back to the Top of the Page
8. Cabinet for the electronics

All electronics are located in the same box. At the front, the following items are seen:
- On/Off switch. To switch the electronics box on and off.
- Green LED: the ALIVE indicator, blinks once per second. It is an indicator to see whether or not the software / hardware is still working and has not crashed (of course that can never happen, or Windows should crash :-)
- Upper red LED: this LED is on if the heating-element is switched on.
- Lower red LED: this LED is on if the pump is switched on.
- LED displays: a total of four different signals can be presented here. The picture shows the HLT temperature, the MLT temperature, temperature of the power electronics and the volume of the MLT.

At the back of the cabinet, the following connections are made:
- Three RJ45 outlets (upper left) for the two temperature sensors and the MPX2010 pressure transducers. The cable for the pressure transducer should be connected to the right most outlet.
- Two power outlets: the left one is for the heating element, the right one is for the pump.
- Interface for the parallel port (Centronics connector).
- 220 Volt power outlet.
- Connection (red) for a non-modulating gas-valve.
- Connection (white) for a modulating gas-valve.
Back to the Top of the Page
9. Datasheets of components
The various ICs used in the electronics brewing setup are listed here with their datasheets:- AD620, Instrumentation amplifier (opamp)
- LM339, Opamp / Comparator with open-collector
- LM35, Analogue temperature sensor (10 mV/°C)
- LM92, Digital temperature sensor (12-bit + sign bit, 0.33 °C accuracy, I2C)
- MAX1238, AD-Converter 12-bit, 12 analog inputs, I2C
- MOC3043, Triac driver with galvanic isolation and zero-crossing detection
- MPX12, Pressure transducer, not temperature compensated, max. pressure = 10 kPa, 55 mV max. output
- MPX2010, Pressure transducer, not temperature compensated, max. pressure = 10 kPa, 25 mV max. output
- PCF8574, 8-bit IO for I2C-bus
- PCF8584, I2C bus controller
- PCF8591, 8-bit AD-converter (4 x) and 8-bit DA-converter (1 x) for I2C-bus
- SAA1064, 4-digit LED-driver for I2C-bus
- TIC263, Triac (600 V, 25 A)
- TMG25CQ60F, Triac (600 V, 25 A) wel geïsoleerd