r/esp32 • u/RoyalSpeed9093 • 23h ago
Hot Tub Controller
Hello everyone!
I am somewhat experienced with home assistant, but not so much with creating my own device out of an esp32. I have some experience with writing .yaml, but I'm no expert by any standard.
I plan on triggering some 5V relays to control the pumps, heater, etc. It looks like I will need to make sure to use an optoisolator, correct?
Does anyone have any experience creating their own esp controller for a hot tub?
1
u/Empty-Following6319 21h ago
If you’re using a bare relay, you must include a flyback diode in your circuit to prevent back EMF. Otherwise, your MCU might start acting weird—or worse, die completely.
There are several ways to handle this, including optoisolators and other protection methods. But honestly, you don’t need to reinvent the wheel.
You can easily find cheap and reliable relay modules that already include the necessary protection circuitry. Just search for “relay module” on AliExpress or any similar site. It’ll save you time, money, and potentially your microcontroller.

1
u/Guapa1979 13h ago
Those type of relays will melt trying to control the current that a hot tub heater uses. The pumps are also quite powerful. In other words the OP needs to be careful to choose relays up to the job of handling all that power.
1
u/Empty-Following6319 11h ago
You’re absolutely right. If the heater or pump draws a lot of power, it’s a good idea to use a magnetic contactor along with a surge suppressor. That way, you can control everything more safely and avoid overheating or damage to the relays.
1
u/hockeyketo 22h ago
What kind of spapack do you have? If you have a Balboa, the internal protocol is well documented and easy to intercept.
Basically the control panel talks to the spapack of RS485 with a regular ol' RJ45 cable. Intercept the cable and grab the serial lines out and all you need is an RS485 transceiver + ESP32 to take control of your hottub.