An Arduino-based automated brewing control system with touch screen interface for managing mash, sparge, and boil processes.
BrewMatic is a comprehensive brewing automation system built on Arduino Mega 2560 with a large TFT touch display (800x480). The system provides automated temperature control, step management, and real-time monitoring for the entire brewing process.
- Multi-stage Process Control: Automated management of Mash, Sparge, and Boil phases
- Temperature Monitoring: Multiple DS18B20 sensors for precise temperature control
- Touch Screen Interface: Intuitive GUI with tabs, buttons, and real-time data visualization
- Recipe Management: Configurable brewing recipes with multiple mash steps
- Safety Features: Temperature delta monitoring, sensor error detection, hysteresis control
- Fire Control: SSR-based heating element control with safety interlocks
- Audio Feedback: Buzzer alerts for process transitions
- Microcontroller: Arduino Mega 2560
- Display: 800x480 TFT LCD (SSD1963 controller) with resistive touch
- Temperature Sensors: DS18B20 (OneWire) sensors for:
- Mash (upper and lower)
- Sparge
- Environment/backup
- Relays/SSRs: Solid State Relays for heating element control
- Audio: Buzzer for notifications
See mega_pins.h for detailed pin assignments:
- Temperature sensors on various digital pins
- SSR control pins
- Display connection (38, 39, 40, 41)
- Touch screen interface
The workspace contains three main versions:
- BrewMatic: Original implementation
- BrewMaticAlpha01: First alpha release
- BrewMaticAlpha02: Latest alpha version (recommended)
- AWind: Window/GUI framework for Arduino
- ASensor: Sensor management framework
- AFrame: Arduino framework for sensor integration
- UTFT: TFT display driver
- UTouch: Touch screen driver
- OneWire: Temperature sensor communication
MenuWindow.h: Main navigation menuBrewWindow.h: Tab control for brew processesMash.h: Mash process window and controllerSparge.h: Sparge process window and controllerRecipeWindow.h: Recipe configuration interfaceSettingsWindow.h: System settings
Recipe.h: Recipe data structures and configurationPlantParams.h: Plant-specific parametersutilities.h: Helper functions and utilities
SensorManager: Centralized sensor managementDS18B20Sensor: Temperature sensor wrapper
./install_libs.shThis script creates symbolic links from the project's libs folder to your Arduino libraries folder.
-
Copy the following libraries to your Arduino libraries folder:
BrewMaticAlpha02/libs/AFrame→libraries/BrewMaticAlpha02AFrameBrewMaticAlpha02/libs/ASensor→libraries/BrewMaticAlpha02ASensorBrewMaticAlpha02/libs/AWind→libraries/BrewMaticAlpha02AWindBrewMaticAlpha02/libs/UTFT→libraries/BrewMaticAlpha02UTFTBrewMaticAlpha02/libs/UTouch→libraries/BrewMaticAlpha02UTouch
-
Install additional required libraries:
- OneWire (for DS18B20 sensors)
- Arduino Timer libraries
- Connect the TFT display according to UTFT library specifications
- Wire DS18B20 temperature sensors with 4.7kΩ pull-up resistors
- Connect SSRs to the designated control pins
- Wire buzzer for audio feedback
- Ensure proper power supply for all components
Edit Recipe.h to configure your brewing recipe:
mashStep mashSteps[] = {
{50, 10, 1, false, 0}, // 50°C for 10 minutes
{62, 30, 1, false, 0}, // 62°C for 30 minutes
{72, 20, 1, false, 0}, // 72°C for 20 minutes
{78, 5, 1, false, 0} // 78°C for 5 minutes (mash out)
};Adjust PlantParams.h for your specific setup:
#define MAX_DELTA 3.0 // Maximum allowed temperature delta
#define HYSTERESIS 0.5 // Temperature control hysteresis
#define INERTIA 2.0 // System thermal inertia- Power On: The system initializes and displays the main menu
- Recipe Selection: Navigate to the recipe window to select/configure recipe
- Sensor Calibration: Verify all temperature sensors are reading correctly
- Start Mash:
- Navigate to Mash tab
- Press "Start Mash" button
- Add grains when target mash-in temperature is reached
The Mash class manages multi-step mashing:
- Temperature Ramp: Automatically heats to target temperature
- Rest Period: Maintains temperature for specified duration
- Step Progress: Visual indication of current step and time remaining
- Iodine Test: Optional extended rest periods with user control
- Mash Out: Final step with buzzer notification
Key features:
- Real-time temperature display (upper, lower, average)
- Fire status indicator
- Step progress visualization
- Manual step duration adjustment
The Sparge class manages sparge water heating:
- Target temperature: 78°C (configurable)
- Automatic fire control
- Temperature monitoring
- Completion notification
-
Temperature Delta Check:
- Monitors difference between upper and lower mash sensors
- Automatically disables heating if delta exceeds threshold
- Prevents scorching and uneven heating
-
Sensor Error Detection:
- Validates sensor readings
- Disables heating on sensor failures
- Visual and audio warnings
-
Hysteresis Control:
- Prevents rapid on/off cycling
- Extends equipment lifespan
BrewMaticAlpha02/
├── BrewMaticAlpha02.ino # Main Arduino sketch
├── libs/ # Core libraries
│ ├── AFrame/ # Arduino framework
│ ├── ASensor/ # Sensor management
│ ├── AWind/ # GUI framework
│ ├── UTFT/ # Display driver
│ └── UTouch/ # Touch driver
├── Mash.h # Mash process (View + Controller)
├── Sparge.h # Sparge process
├── MenuWindow.h # Main menu
├── BrewWindow.h # Tab control
├── Recipe.h # Recipe configuration
├── PlantParams.h # System parameters
└── utilities.h # Helper functions
Location: Mash.h
Implements both View and Controller for the mash process:
class Mash : public Window,
public ISensorHasDataEventReceiver,
public ISensorMeasuredEventReceiver,
public ITouchEventReceiver
{
// View components
TextBoxString *mash_up_temp_str_;
TextBoxString *mash_down_temp_str_;
TextBoxString *mash_avg_temp_str_;
ImageWindow *flames_img_;
// Controller methods
void HandleStep();
void CheckTemperatures();
void SetFire();
void UpdateScreenStepData();
};Location: libs/AFrame/SensorManager.h
Manages sensor measurements and event notifications:
SensorManager *mash_up_temp_manager = new SensorManager(
mash_up_temp, -10, 110, 1000*10, false, F("MASH_UP")
);- New Sensor: Create sensor in
setup(), register withSensorManager - New Window: Inherit from
Window, implementISensorHasDataEventReceiver - New Recipe Step: Modify
mashStepstructure inRecipe.h
The Arduino Project Examples folder contains isolated examples:
- all_together: Combined hardware test
- buttons: Button handling examples
- Music_Player: DFPlayer integration
- TemperatureSensor: DS18B20 sensor examples
- ScreenDrawingTest: Display graphics tests
- SD_on_LCD_screen: SD card bitmap display
The Case folder contains:
- Front panel design
- Back panel design
- Frame specifications
- CNC machining instructions
The PCBs folder contains circuit board designs for:
- Temperature sensor connections
- Power distribution
- Control interfaces
This project uses multiple open-source libraries with different licenses:
- AWind Library: Apache License 2.0
- BrewMatic Code: BSD 3-Clause License (see file headers)
- UTFT Library: CC BY-NC-SA 3.0
Copyright (c) 2018 Federico Bolelli
When contributing to this project:
- Follow the existing code style
- Test thoroughly with actual hardware
- Update documentation for new features
- Add examples for complex functionality
- Verify pin connections match
BrewMaticAlpha02.inosetup - Check backlight pin (pin 8) is HIGH
- Ensure UTFT library is correctly installed
- Verify 4.7kΩ pull-up resistor on OneWire bus
- Check sensor addresses using OneWire scanner
- Monitor Serial output for sensor readings
- Run touch calibration
- Update calibration values in
UTouchCD.h - Check precision setting:
myTouch.setPrecision(PREC_MEDIUM)
- Arduino Mega has limited SRAM
- Use
F()macro for string literals - Monitor free RAM:
AHelper::LogFreeRam()
- Link Utili PID-SSR: See
Link Utili PID-SSR.txt - Link Utili Speaker: See
Link Utili Speaker.txt
Note: This is an active development project. Always refer to the latest code in BrewMaticAlpha02 for the most current implementation.








