I'd like to present my last project, a coffee PID controller. It has been designed to be used with La Pavoni Domus Bar coffee machine, but it can be attached to any similar hardware. This article describes hardware part, next part will discuss software.
Preliminary design guidelines
- minimal alteration of internal connections in coffee machine,
- safety of use,
- heater control (using embedded triac - external SSD is not required),
- solenoid valve control,
- pump control (for shot duration control, pressure profiling in future release),
- timer and clock,
- parameters shown in realtime on LCD
- interface to change parameters of PID controller,
- design similar to coffee machine.
Majority of home coffee machines use a simple dual-state (on-off) algorithm to keep constant temperature of boiler. As a result temperature varies considerably around a set point (SP). My device was originally equiped with 95°C thermostatic switch, which has a hysteresis of ±5 Celsius deegree. Please refer to circuit diagram. Using a more precise temperature measurement and clever algorithm allows to keep temperature aproximately constant during whole brewing proces.
Controller is based on Atmel ATMega16 microcontroller, which has 16KB flash memory to satisfy memory usage by LCD fonts/graphics. It has enough ports to connect all external I/O peripherals. All ICs are supplied to 3.3V VCC, because LCD and ADC doesn't support higher voltages.
Controller has three fast optoisolated outputs and one optoisolated input. Fast means fast enough to control 50Hz AC using phase-control. BT138 triac used in project can control up to 8A on-state current (I_T_RMS), according to datasheet. Without radiator this current is significantly lower, but continuous control of 2kW heater doesn't make IC hot. Warning! Mounting base of triac is connected to 230V mains supply, so do not touch any part of device when powered.
Process value input section
Temperature is measured by a thermocouple mounted at top of boiler. MAX31855 IC is used to convert temperature to digital value. This IC has included a specialized signal conditioner with 14 bit A/D converter.
IC can also detect open circuit and shortcircuit to ground or VCC. Controller ground must not be galvanicaly connected with thermocouple (what is equivalent to coffee machine ground, unless thermocouple has isolated housing). Controller is galvanicaly isolated from controlled device, but if you connect serial port to grounded computer unit, foregoing condition is not met.
MAX31855 has built-in cold junction compensation and linear converter, so temperature value is available directly. IC is interfaced to MCU using SPI protocol.
User interface section
User interface is provided by LCD display and 4 keys on front panel.
Runtime parameters are displayed on LCD display. LCD is adopted from Nokia 6100/6110. It is based on Epson PCF8833 chipset.
DS1307 is a RTC with I²C interface, but it includes also 56B of battery backed-up RAM memory.
EEPROM memory and battery backed-up RAM allow to keep settings when machine is powered off.
Board has an ISP connector to upload/download firmware. Additionaly, communication is provided using RS-232C UART interface with DB9 connector.
Chassis & front panel
Chassis is made of some stainless steel sheet, bended into box shape. Basis is made of PVC sheet, it holds PCB, rubber feet and steel chassis, and provides additional electrical insulation.
Front panel PCB holds LCD socket and buttons. Front label is laminated into transparent foil. Proper displacement between PCB and foil is realized using spacer cut from 5.25” bay cover.
All parts are placed on double-sided PCB (main unit) and one-sided PCB (front panel).