Node Red application to control coffee machine
Requirement:
The client wanted to evaluate the feasibility and flexibility of Node-RED as a low-code automation platform by implementing a sample project that could simulate the control of a coffee machine. The coffee machine setup involved temperature and pressure sensors, relay-controlled valves, and user-operated switches. The goal was to allow control and automation of the machine’s processes — like heating water or opening valves — based on real-time sensor inputs and configurable user-defined conditions. An intuitive user interface was also needed to visualize the current status of the machine, monitor historical data such as water level trends, and adjust operational parameters like delay timings and cutoff thresholds.
Solution
We developed a Node-RED-based control flow that handled real-time data from the coffee machine’s components. For sensors like the STS21 High Accuracy Temperature Sensor, which had existing support, we integrated them using built-in Node-RED nodes. For others lacking direct support, we created custom nodes using JavaScript and the Node-RED Node API. Relay controls were set up to trigger based on conditions evaluated through Node-RED’s function and logic nodes, and the valve actuation was precisely managed through delay and threshold parameters. A custom dashboard was built using Node-RED UI nodes to display live machine state, graphical representations of past sensor readings, and provide input controls for setting user-defined cutoffs, time delays, and switching modes.

