A touchscreen-style coffee machine UI built with Qt 6 / QML and C++. Select a drink, dial in your beans and water levels, watch a live brew progress, then get a quality score based on real-time ambient readings from an Adafruit SHT45 temperature & humidity sensor.
| Screen | Description |
|---|---|
| Home | Pick from Espresso, Cappuccino, Coffee, or Americano |
| Coffee | Adjust beans level, water level, and number of cups |
| Brewing | Live progress bar with sensor-sampled data during extraction |
| Summary | Quality score arc, temperature & humidity readings, saved to log |
| Settings | Connect to the SHT45 sensor over USB serial |
| Layer | Technology |
|---|---|
| Language | C++ 17 |
| UI framework | Qt 6 / QML (Qt Quick) |
| Serial I/O | Qt SerialPort (QSerialPort) |
| Build system | CMake 3.16+ |
ProjectNSZL/
├── CMakeLists.txt
├── brew_log.txt — auto-created on first brew
└── src/
├── main.cpp
├── SensorExtractor.h/.cpp — serial read, parse, and brew log writer
├── ASSETS/ — images and meter graphics
└── qml/
├── main.qml — ApplicationWindow + StackView root
├── HomePage.qml — drink picker
├── CoffeeScreen.qml — beans/water sliders + cup count
├── BrewingScreen.qml — animated progress bar + sensor sampling
├── BrewSummaryScreen.qml — quality score, stats, log confirmation
└── SettingsPage.qml — serial port selector
-
macOS with Homebrew
-
Qt 6
brew install qt
-
CMake
brew install cmake
# 1. Enter the repo
cd ProjectNSZL
# 2. Configure
cmake -S . -B build
# 3. Compile
cmake --build build -j$(sysctl -n hw.ncpu)
# 4. Run
./build/bin/BrewOSApple Silicon: Homebrew installs Qt to
/opt/homebrew/opt/qt6. TheCMakeLists.txtalready adds both Intel and ARM prefix paths — no manual flags needed.
-
Plug the SHT45 into a USB port. On macOS it appears as
/dev/cu.usbmodem*. -
Flash the Arduino sketch in
sensor/sensor_sketch/sensor_sketch.ino. -
The sketch outputs newline-terminated CSV at 115 200 baud:
temperature,humidityExample:
21.34,62.10 -
Open Settings inside BrewOS, hit Search Ports, select the correct port, and it connects automatically.
- Four drink cards: Espresso, Cappuccino, Coffee, Americano
- Live temperature badge in the top-right corner (reads from the SHT45)
- Beans slider — 0–10, click the ▲/▼ arrows or tap the track directly
- Water slider — same controls
- Cup count — toggle between 1× and 2×
- Hit CONTINUE to start the brew
- Progress bar fills linearly over 10 seconds
- Shimmer animation overlaid on the fill
- SHT45 is sampled every 2 seconds; readings are averaged for the quality score
- Auto-navigates to the Summary screen when complete
- Animated arc gauge showing the Extraction Quality Score (0–100)
- Temperature and humidity stat cards showing averaged brew readings
- Quality rating: Exceptional / Excellent / Good / Fair / Poor
- Brew automatically saved to
brew_log.txt
- Serial port dropdown with Search Ports refresh
- Live CONNECTED / DISCONNECTED status
- Current temperature and humidity readout
Computed in BrewSummaryScreen.qml from the average temperature and humidity sampled during the brew.
idealTemp = 21.0 °C
idealHum = 62.0 % RH
tempScore = max(0, 100 − |temp − 21.0| × 15)
humScore = max(0, 100 − |hum − 62.0| × 4)
score = round(tempScore × 0.55 + humScore × 0.45)
Because the SHT45 is accurate to ±0.1 °C and ±1.5 % RH, the scoring window is intentionally tight:
| Deviation | Point deduction |
|---|---|
| 1 °C off 21 °C | −15 pts |
| 1 % RH off 62 % | −4 pts |
| Score | Rating |
|---|---|
| 90 – 100 | Exceptional |
| 75 – 89 | Excellent |
| 60 – 74 | Good |
| 45 – 59 | Fair |
| 0 – 44 | Poor |
To adjust the ideal values, penalty rates, or rating thresholds, edit the qualityScore and rating properties at the top of src/qml/BrewSummaryScreen.qml.
Every completed brew is appended to brew_log.txt in the working directory:
[2025-03-29 14:22:01] coffee=ESPRESSO cups=1 temp=21.30C humidity=62.10% quality=98/100 rating=Exceptional
The file is created automatically on first brew. Each line is one brew entry.
| Problem | Fix |
|---|---|
| Qt not found by CMake | Run brew install qt and ensure /opt/homebrew/bin is in PATH |
| No serial ports listed | Check device is plugged in; try ls /dev/cu.* in Terminal |
| Sensor data not updating | Verify the sketch is flashed and outputting temp,hum\n at 115 200 baud |
| App crashes on launch | Rebuild with cmake --build build --clean-first |
brew_log.txt not created |
Check write permissions in the directory you ran the app from |