Skip to content

LennyWandeto/ProjectNSZL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BrewOS

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.


Screens

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

Tech Stack

Layer Technology
Language C++ 17
UI framework Qt 6 / QML (Qt Quick)
Serial I/O Qt SerialPort (QSerialPort)
Build system CMake 3.16+

Project Structure

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

Prerequisites

  • macOS with Homebrew

  • Qt 6

    brew install qt
  • CMake

    brew install cmake

Build & Run

# 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/BrewOS

Apple Silicon: Homebrew installs Qt to /opt/homebrew/opt/qt6. The CMakeLists.txt already adds both Intel and ARM prefix paths — no manual flags needed.


Hardware — Adafruit SHT45

  1. Plug the SHT45 into a USB port. On macOS it appears as /dev/cu.usbmodem*.

  2. Flash the Arduino sketch in sensor/sensor_sketch/sensor_sketch.ino.

  3. The sketch outputs newline-terminated CSV at 115 200 baud:

    temperature,humidity
    

    Example: 21.34,62.10

  4. Open Settings inside BrewOS, hit Search Ports, select the correct port, and it connects automatically.


Features

Home Page

  • Four drink cards: Espresso, Cappuccino, Coffee, Americano
  • Live temperature badge in the top-right corner (reads from the SHT45)

Coffee Screen

  • 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

Brewing Screen

  • 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

Summary Screen

  • 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

Settings Page

  • Serial port dropdown with Search Ports refresh
  • Live CONNECTED / DISCONNECTED status
  • Current temperature and humidity readout

Extraction Quality Score

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.


Brew Log

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.


Troubleshooting

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

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors