Last modified: 17.5.2020
Started: 8.5.2020
Modifying my hot tub project to allow programmatic temperature control via VoffCon.
My goal is to enhance the hot-tub project by allowing programmatic control of the water temperature, eliminating the need for manual adjustments before use. In the future, I aim to integrate outdoor temperature data to dynamically adjust the water temperature based on weather conditions. I will continue using VoffCon to manage commands over the internet. Additionally, I plan to integrate Google Home and IFTTT for hands-free voice control while in the hot tub.
A key next step is implementing a PID control library to optimize temperature regulation.
Below are some experiments and tests conducted during development, along with images and videos documenting the progress.
Setup for testing software communication with components. An ESP32 is connected to valves, temperature sensors, and pressure sensors. The date is 3. august 2021
Valves, pressure sensors, temperature sensor connected to my pluming system and the test setup connected to them showing a successful test. The date is 7. august 2021
Every thing is working. The date is 15. october 2021
I got help from friends on the Arduino - Íslands facebook group to 3D print protective housing for watermixer. The date is 27. october 2021
During development, I explored using a BC547-based circuit, suggested by Brjánn Guðjónsson, adjusting R4 and C1 to achieve a stable voltage output. Alternatively, I considered using an MCP4725 for better control.
Arduino Nano D5 pin connected directly to the valve green wire. V5 GND and 12V ground connected together. 12V+ connected to valve red wire. and 12V- connected to valve black wire.
I consider this test as a fail because the valve was very jittery. That is, the valve did change position, but never completely stopped. Alway continues little irritating corrections.
Using the RC filter (see image "RF filter") connected to D5 on a Arduino Nano. The test code makes the Arduino Nano read a value from the serial and writes that value to the D5 pin. Then nano will read a A1 pin which is connected to a feedback wire on the Valve.
This experiment failed. The voltage on the output Green wire went from low: 1.2V to high: 3.2V, but needs to go from 0V to 5V. The valve was little bit open and then just opened just a little more. Never completely open nor completely closed.
Using the BC547 (see image Schematic with BC547) and the RC filter (see image RC filter) connected to the Esp32. Then nano will read a A1 pin which is connected to a feedback wire on the Valve.
I tested powering the Esp32 with 12V via til VIN pin. This resulted in the on board voltage regulator heating up to 56° while just blinking one led, no wifi operations where even running. After little googling I found out this is a issue with the Esp32, it's probably best to be in the 5-7V range. The valve will run on 9V. So may be I'll try that. I would like to have only one power source powering the Esp32 and the valve. Maybe I can step down the voltage from 12V before connecting it to the VIN.
The experiment was a Fail. Because there are issues, like little jittering and out max output to the green wire is just over 4 volts, but should be max 5 volts.
If you want to see the experiment in action click here to see it's YouTube video.
Using the PWM to Voltage Converter module (see product PWM to Voltage Converter on aliexpress)
GND +12V │ │ │ │ ╔═══════════╗ ╔═════════════╗ │ │ ║ -ESP32- ║ ║ PWM to ║ │ │ ╔══════════════╗ ║ ║ ║ voltage ║ │ │ ║ Valve ║ ╔══════════╗ ║ ║ ║ converter ║ │ │ ║ ║ ║-HLK-PM01-║ ║ ║ ║ ║ │ │ ║ PWM Out-╟─(WT)─ ║ ║ ║ ║ ║ GND -╟──┘ │ ║ ERR -╟─(YW)─ ║+Vo (+5V)-╟───╢ VIN ║ ║ VCC -╟──────┴─(RD)─╢- VCC ║ ║ -Vo -╟───╢-GND GND -╟──────╢- GND GND -╟────────(BW)─╢- GND ║ ╚══════════╝ ║ D26 -╟──────╢- PWM VOUT -╟────────(GW)─╢- LIN ║ ╚═══════════╝ ╚═════════════╝ ╚══════════════╝
Ps. Instead of using 12V power supply you could any source ranging from 12v to 24V.
The experiment was a total Success. No jittering problems and the voltage range is from 0 - 5V volts.
Reading values from DS18B20 (see product DS18B20)
╔═══════════╗ ╔═══════════╗ ║ ESP32 ║ ║ DS18B20 ║ ║ ║ ║ Sensor ║ ║ ║ ║ ║ ║ GND -╟────────────────────────╢- GND -║ ║ 3V3 -╟──┬─────────────────────╢- VCC -║ ║ ║ │ ╔═══════════╗ ║ ║ ║ ║ │ ║-Resistor -║ ║ ║ ║ ║ └──╢- 4.7kΩ -╟──┬───╢- Signal -║ ║ ║ ╚═══════════╝ │ ╚═══════════╝ ║ G12 -╟────────────────────┘ ╚═══════════╝
The experiment was a Success. The sensor I used did not react quickly to temperature change but I think that will be ok if i use the PID library.
Create a program which can be used to mix the heat of the water flowing to the hot tub. Best would be to use a the PID library to do mix the water.
todo:
Get the temperature and wind outside so you can deside if the water flowing to the hot tub needs to be a little warmer or colder
todo: