...
Board Layout
Produced Board
2022:
- Moved flow check to GPIO-3 (RX).
- Installed board in original Watkins Case
- Revised Firmware
Problems
- Having the flow check on GPIO-0 can cause reboot failures if the flow is stuck closed.Moving flow check to RX.
Version 2
Changes
- Move Flow sensor to ADC on CH7 in order to free up GPIO-0 or RX/TX.
- Add light control
Schematic
Board Layout
...
- Revised in 2020.
2023:
- Went to add the pump button and discovered a design error. The pump ADC input is floating and should have a pull-down to ground. Removing the 10K from the 3V supply.
New Control Panel
Since I have a custom controller, I decided to add a control panel to the hot tub. The plate was 3D printed with light grey PLA filament. It was then sanded smooth. The center switch controls the lights and the small switch to the left controls the pump. All other controls are set using HomeKit.
Software
Arduino Web User Interface
Homekit/Homebridge Integration
AUTO = Powersave Mode
Temperature
Code Block |
---|
... { "accessory": "mqttthing", "type": "thermostat", "name": "spa", "url": "http://192.168.1.50:1883", "username": "homebridge", "password": "pass", "topics": { "getCurrentTemperature": { "topic": "spa/status", "apply": "return JSON.parse(message).temperature_f;" }, "getTargetTemperature":{ "topic": "spa/status", "apply": "return JSON.parse(message).tarTemperature_f;" }, "getTemperatureDisplayUnits":{ "topic": "spa/status", "apply": "return 0;" }, "getCurrentHeatingCoolingState":{ "topic": "spa/status", "apply": "return JSON.parse(message).state;" }, "getTargetHeatingCoolingState":{ "topic": "spa/status", "apply": "return JSON.parse(message).mode;" }, "setTargetTemperature": { "topic": "spa/command", "apply": "return 'setTemp ' + message;" }, "setTargetHeatingCoolingState": { "topic": "spa/command", "apply": "return 'mode ' + message;" }, "setTemperatureDisplayUnits": { "topic": "spa/command", "apply": "return 'tempUnits ' + message;" } }, "heatingCoolingStateValues": ["0","1","2","3"], "temperatureDisplayUnitsValues": [0,1], "minTemperature": 50, "maxTemperature": 110 }, ... |
...
Code Block |
---|
...
{
"accessory": "mqttthing",
"type": "fan",
"name": "hottub",
"url": "http://192.168.1.50:1883",
"username": "homebridge",
"password": "pass",
"topics": {
"getOn": {
"topic": "spa/status",
"apply": "return JSON.parse(message).pump > 0 ? true : false;"
},
"setOn": {
"topic": "spa/command",
"apply": "if(message) return 'pumpOnOff 1'; if(message==false) return 'pumpOnOff 0';"
},
"getRotationSpeed": {
"topic": "spa/status",
"apply": "return JSON.parse(message).pump;"
},
"setRotationSpeed": {
"topic": "spa/command",
"apply": "console.log('MESSAGE: ' + message); if(message >50) return 'pumpState 2'; if(message==0) return 'pumpState 0'; return 'pumpState 1';"
}
}
},
... |
Future
Hardware Changes
Changes
- Move Flow sensor to ADC on CH7 in order to free up GPIO-0 or RX/TX.
- Add light control
Appendix
Pump
Specifications
...