Monday, February 29, 2016

Hot Tub Controller Details

By popular demand - some more details about my Hot Tub Controller project.

See the post about my Hot Tub Controller.

Controller Source Code
Can be found on github - https://github.com/tedhale/hottub.git
You can pull it from this address using the git command, or just go to this address and click the "Download Zip" button.

[Add web interface source files]


Partial parts list:
I will update this as I dig up the details for more of the parts I used.

Waterproof Case with clear cover - https://www.adafruit.com/products/905

7-Segment LCD (I2C bus) - https://www.adafruit.com/products/761
There are many colors and a couple sizes

Pushbuttons  - https://www.adafruit.com/products/481
Several colors available. They don't call these weatherproof but they seem to be pretty weather tolerant.

30A Relay (5V control) - http://www.mouser.com/Search/ProductDetail.aspx?R=JTN1AS-TMP-F-DC5V

10A Relay (5V control) - http://www.mouser.com/Search/ProductDetail.aspx?R=G5CA-1A-TP-E_DC5

Waterproof Enclosure - http://www.mouser.com/Search/ProductDetail.aspx?R=1554E2GY
for relays inside hot tub

Cable Gland (for running cable into waterproof box) - https://www.adafruit.com/products/761

2n2222 transistors

Terminal Blocks

Perf board

40 pin GPIO connector - https://www.adafruit.com/products/1979

The Raspberry Pi version 3 is now Available

The latest version of the Pi is out and as expected, it has a faster CPU. Version 2 had a 900MHz Cortex-A7 chip. Version 3 has a 1.2GHz Cortex-A53. Still quad core and a little faster, but the big difference is that the A53 is a 64-bit processor where the A7 was 32-bit. We will have to wait for an OS upgrade to take advantage of that, but I doubt having 64-bit will make much difference for most applications.

The really great upgrade is that version 3 has built in wifi (802.11n) and Bluetooth.

I should be receiving one shortly and will let you know what I do with it.

Here is some information provided by RS-Components, a great source for all things Pi.

How to set up your Raspberry Pi 3


Comparison of Raspberry Pi 3 and the Raspberry Pi 2

Fancy another slice of pi? Find out more about the Raspberry Pi 3

Tuesday, February 2, 2016

Improved Hot Tub Controller

Hot Tub Controller Circuit Board
The original version of my hot tub controller starting having some problems which ended up being caused by an animal chewing through the control cables. I never liked having that huge bundle of cables running all the way across the back of the house, so I now have a new controller in a waterproof enclosure mounted right next to the hot tub.

The controller is built to mount on top of a Raspberry Pi and does the following:
   ●  Monitor the water temperature
   ●  Turn a circulation pump and heater on to heat the water as needed
   ●  Respond to buttons that increase/decrease the desired temperature
   ●  Respond to buttons that turn the water jets on and off
   ●  Display the current temperature
   ●  Detect various failure modes and place system in safe mode
   ●  Listen for commands from a smart phone app to control hot tub
   ●  Upload data periodically to an Internet of Things service

Temperature monitoring is performed by a waterproof DS18B20 from Adafruit. It uses a simple 1-wire bus to read the data.

The display, also from Adafruit, is a 7-segment LED display and is controlled using an I2C bus.

The device is powered by a 24V DC power supply since the relays on the hot tub are controlled by a 24V signal. A 5V step down regulator provides power to the Raspberry Pi.

Relay Control with LED Indicator
Transistors are used to control the relays and screw terminals provide the connections for all the wires.

The push buttons are connected to GPIO inputs which drive interrupts. These require "debounce" conditioning and this is explained in this post.


Smart Phone app for Hot Tub


The Internet of Things support is using ThingSpeak and the method is described in this post. You can see the live data at this URL.


The system also listens on a network socket for incoming commands from a smart phone app that allows me to monitor and control the hot tub remotely. It's actually not an app, rather just a web page designed for a mobile screen. This way it can easily be used by my Android, my wife or son's iPhone, or from any web browser.

Here is a video showing the completed controller in action. 










And, yes, I really do keep my hot tub that hot. One advantage of making my own controller is that I am not limited to 104 degrees max.