DIY Connected Espresso Machine: Relays (Part 2)

The second article continues the Connected Espresso Machine project (part 1) and will cover the question of how to control AC load via the microcontroller programmatically.


There are only two AC components in my espresso machine that can and should be managed with the microcontroller: boiler and pump. Both have two states only: on and off. So when an electric current is going through them they work, otherwise — not.


What I had in my storehouse are TTi TRV-5VDC-SC-CD relays requiring 5V control signal and able to commutate 16A of AC current. That’s quite enough for the boiler and pump I have. The datasheet is available in the GitHub repository:

Connect a Relay
Relay controlled by Arduino
Relay controlled by NodeMCU


The hardest part of this article is done! :) Now to the software part — I will call it firmware as later we will introduce actual software like GUI or any back end components to support planned capabilities.


Let’s do a quick sketch to test the Relay class:

Test Relay

Next Steps

The next step will be to onboard the second relay and thermistors and implement a separate class to control the boiler!

Solution Architect, IoT hobbyist, petrolhead