Tim Mikkelsen's Arduino Projects
2017/03 Hot Tub sensor remote
Description:
This is my third attempt at a remote control for warming up our cabin hot tub - a Jacuzzi J370. The original design was not good because it required getting into the sealed top-side control panel. The second showed problems in the SparkFun Thing Dev IoT (which I still like). The second and third approach both do a 'fake out' the hot tub controller by temporarily switching the real sensor with a resistor that will indicated a low temperature. The other major change in the third design is to use a single 4PDT relay instead of 2 DPDT relays.
This is based on the previous Hot Tub button remote project -- but using a NodeMCU development board.
Again, the NodeMCU provided all the needed infrastructure. The only additional hardware needed were sensors and the relay to interrupt the temperature sensor.
The web page that gets served up has:
- title
- a button to refresh the information
- a button to cancel warm up
- a button to warm up
- the outside temperature in Farhenheit
- if in warm up, tub temperature and time elapsed
- the last warm up event (timeout, sensor, cancel)
Hardware:
- 1x HiLetgo New Version NodeMCU LUA WiFi Internet ESP8266
- 1x TMP102 I2C temperature sensor - Sparkfun SEN-11931
- 1x P2N2222A NPN transistors (BC337) - Sparkfun COM-13689
- 1x 1N4001 1A/50V small signal diode - Sparkfun COM-08589
- 4x 330 ohm resistors - Sparkfun COM-08377
- 1x DS4E-S-DC5V-H125 4PDT relay
- 1x 100k ohm resistor
- 1x 47k ohm resistor
- various connectors for sensors and power
- 3x LEDs (red, yellow, blue)
Total parts cost: Approximately $80
A few comments:
1. The NodeMCU only has one analog input and it measures 0-3.3 volt (versus the SparkFun Thing Dev of 0-1 volt and the regular Arduino's 0-5 volt).
2. The WiFi, networking, and embedded HTML was a bit convoluted and took me a bit to get it figured out (on the previous design).
3. I've left the serial debug code in the project, because if you are using this, you will really need to turn on the debug output to the serial monitor to see what's happening... :-)
4. Note that the code uses 2 different tests for achieving warmup - a) hot tub temperature sensor and b) a timeout. This is trying to be fault tolerant of any errors or component failures. Also, if this add-on controller fails, the relays will go into the 'normal' position as if the controller were not there.
5. I used information from the hot tub trouble shooting guide to read the built-in hot tub sensor and to determine the value for the 'fake' sensor. I also used Excel to determine what formula to use to calculate temperature.
6. I had various issues with the Arduino IDE and libraries and versions... The biggest issue I ran into was that reading the analog (A0) input more than a couple of times a second causes the WiFi to fail/crash. I solved this with a delayso that the code only reads the analog data once every half second - more than fast enough for the temperature change speed.
8. For the outside temperature I2C sensor, I discovered the sample TMP102 code I had gotten online did a bad job on the 2's complement data (i.e. negative numbers) so it would fail below 32 F (0 C).