flowchart TD
A[Power On / Setup] --> B[Initialize LCD & Bluetooth]
B --> C[Loop: Check Bluetooth Serial Command]
C -->|Command Received| D{Command Type?}
D -->|START| E[Set startProcess = True]
D -->|STOP| F[Set startProcess = False & Safety Shutoff]
D -->|TEMP/TIME/AIR| G[Update Operating Parameters]
C --> H{Is Process Started?}
H -->|No| C
H -->|Yes| I[Read DS18B20 Temp Sensors T1 & T2]
I --> J[Display Data on LCD & Transmit via Bluetooth]
J --> K{Thermal Control Check}
K -->|T1 < Target| L[Activate Upper Heater]
K -->|T2 < Target| M[Activate Bottom Heater]
L & M --> N[Update Countdown Timer]
N --> O{Timer Elapsed?}
O -->|Yes| F
O -->|No| C
This view shows how data moves between the mobile app, the wireless link, the controller, and the physical sensors/actuators — matching the hardware described in HARDWARE.md.
flowchart LR
subgraph UI["User Interface"]
APP["Android App\n(Bluetooth Terminal)"]
end
subgraph COMM["Wireless Link"]
HC05["HC-05 Bluetooth Module\n(Serial1, 9600 baud)"]
end
subgraph MCU["Arduino Mega 2560"]
PARSE["Command Parser"]
CTRL["Control Logic"]
LCD["I2C LCD (0x27)"]
end
subgraph SENSE["Sensors"]
DS1["DS18B20 #1 — T1 (Upper)"]
DS2["DS18B20 #2 — T2 (Lower)"]
end
subgraph ACT["Actuators"]
H1["Upper Heater (Pin 44)"]
H2["Bottom Heater (Pin 45)"]
A1["Air Pump 1 (Pin 42)"]
A2["Air Pump 2 (Pin 43)"]
end
APP <-->|Bluetooth SPP| HC05
HC05 <-->|UART| PARSE
PARSE --> CTRL
DS1 --> CTRL
DS2 --> CTRL
CTRL --> H1
CTRL --> H2
CTRL --> A1
CTRL --> A2
CTRL --> LCD
CTRL -->|T1 / T2 stream| PARSE
stateDiagram-v2
[*] --> Idle: Boot / STOP received
Idle --> Running: START received
Running --> Idle: STOP received\n(all outputs forced OFF)
Running --> Idle: Countdown reaches 0\n(auto safety shutoff)
state Running {
[*] --> CheckZones
CheckZones --> UpperHeaterON: T1 < desiredTemp
CheckZones --> UpperHeaterOFF: T1 >= desiredTemp
CheckZones --> LowerHeaterON: T2 < desiredTemp
CheckZones --> LowerHeaterOFF: T2 >= desiredTemp
CheckZones --> CheckZones: repeat every ~1s
}
Each zone is controlled independently against the same desiredTemp setpoint — there is currently no hysteresis band, so a heater switches off as soon as its zone reaches the setpoint and back on as soon as it drops below it again. See the Current Status & Roadmap section of the README for planned refinements (hysteresis, non-blocking timing, setpoint persistence).