jeanl
Posts: 13
Joined: Wed Feb 22, 2017 10:48 pm

Hot tub / spa / jacuzzi controller

Thu Feb 23, 2017 11:12 pm

Just wanted to post a report on a hot tub project I just finished in case other would be interested.
Contrary to what most people are attempting to do on similar hot tub projects, I wasn't trying to replace the main controller in my hot tub (an old Caldera Alpine, 1998). Everything works just fine. I wanted to be able to remote control the hot tub from the house, and have it run on a schedule (i.e. change the temp depending on the time of the day).
The top controller only has 2 buttons, and 3 7-segment digits for the temperature (and one small LED to indicate that the heater is on):
Image

I needed to:
- Be able to continue using the current main board, including the top display where you can see the temp and push buttons for jets and temp
- Be able to read the temp from the main board
- Be able to read and adjust the "set temp" (the hot tub target temperature)
- Have remote access to the info, remote control it, and have a schedule, accessible via a small web page.

Of course, my hot tub was too old to allow that, and since I didn't want to break anything, I had to find a way to get the info out of the main board, and into a raspberry pi (which I chose because it had everything I thought I needed for this, GPIOs, wifi support, python, and linux for ssh'ing in, and hosting a small web site).

The connection between the main board (that has all the relays and all the electronics) and the top controller (with the temp display and the buttons) is done via a RJ12 connection with only 6 wires. An RJ12 connector looks like a phone connector, but has 6 wires instead of 4 for regular telephone.
Image
I reverse engineered the "protocol" the tub uses to talk to the display, thanks to a friend's scope that allowed me to look at the signals on each of the 6 lines.
Wh: Clock line. +5.5V roughly 40kHz
Bk: Data line. +5.5V
Re: Ground
Ye: Temp button when connected to +5V with 500 Ohm resistor
Gr: Jets button when connected to +5V with 500 Ohm resistor
Bl: DC 5V.
Here's an image of the clock signal
Image
And here's an image of the data signal
Image
The protocol used by the tub is very ad hoc, it's not using SPI or I2C or anything like that. In fact, it's a lot simpler:
30 times per second the clock line becomes active, at approximately 40kHz.
Each clock signals a data bit, and there are 21 data bits sent, after which the clock and data lines become inactive for about 1/30th of a second.
I quickly determined that each bit corresponds to each segment of the 3 7-segment digits (the fact that there was 21 values was a big hint!). A 1 if the segment was lit, and 0 if not. The first digit can only display "1" or be blank (the temp can't go beyond 104) so they used one of the unused segments to indicate the heater status).
So it seemed like the project would be easy! All I needed to do was read the data line, parse out which segments were lit, go from that to a temp value. To control the temperature, I could use a GPIO to take the level of the Yellow line to +5V (in fact, the +3.3V of the PI was enough).

So here's what I did:
CONNECTIONS:
I simply made a Y connection on the RJ12 line (you can buy Y connectors online) so it was easy to keep the system functional while adding the pi to it. I connected the clock, data, ground and temp lines to a small proto board I made. The ground goes to the PI ground (on the GPIO connector) and the others go to GPIOs, see below.
GPIOS:
  • I used 4 identical resistors to create two voltage dividers to take the 5V of the data and clock line down to 2.5V which was enough for the PI to read and connected that to two GPIOs configured as inputs.
  • I configured a GPIO as output and connected it to the yellow line via a 500 Ohm resistor and a diode (just to be safe)
  • For kicks a added another output GPIO to drive a white LED to indicate a heart beat (to show that the PI was alive, reading the temp etc)
READING THE TEMP
Reading the temp was a bit tricky because the clock is at 40kHz which if you use python is getting close to how fast you can read a GPIO (with a PI3) using RPi.GPIO. At first I tried to use wait_for_edge(), event_detected() to synchronize reading the data with the clock. But these calls are far too slow to keep up with a 40kHz clock. Instead, I found that I could reliably read the clock and the data by repeated calls to input() and simply monitor the edge on the clock to save the data. You still have to be very careful to do as little as possible in your python loop if you don't want to miss clock edges.
Later on, I discovered that things would have been far easier with pigpio using a callback function, as described in http://abyz.co.uk/rpi/pigpio/examples.h ... SPI_mon_py.

The rest was just a matter of coding:
  • Create a python module to read the temperature at regular intervals, with the ability to set the temperature by faking a temp button press.
  • Write a tiny "scheduler" to set the temp according to a schedule saved in a text file
I spent a bit of time on creating the web server for the project as I was completely new to that. I wanted a tiny web page that would show me the current temp, the current set temp, and have a couple buttons to raise or lower the temp. Simple.
I found this page http://electronicsbyexamples.blogspot.c ... evice.html that got me almost 100% of the way.
A very simple solution is to use Flask as a framework for running a web page with python code running in the background. You need a tiny bit of javascript and JQuery (I was completely unfamiliar with that but it's not very hard to get) but it's amazingly little work to get a small server to run on your PI.
If you want the server to be more robust (for example, if you plan on accessing it from multiple devices) then you can use gunicorn to turn your small flask server into a very robust one.
Here's an image of the board on top of the PI:
Image
And of the main control unit with the pi sitting on top of it:
Image
And a picture of the web page:
Image

Of course, I went over the top with much more info I had intended to put on the page! I keep a log of the heater activity to see how much electricity the hot tub uses etc etc ....

All in all this has been a totally fun project! I hope this report is useful to someone who's contemplating the same idea. I'll be more than happy to share my code if that's useful to anyone.
Jean

mccpie01
Posts: 4
Joined: Sat Jul 22, 2017 7:21 pm

Re: Hot tub / spa / jacuzzi controller

Sat Jul 22, 2017 7:25 pm

Hello,
I like to get some more détail on your Project For a Hot Tub Monitor.
ON your last post, on this subject the images did not show up properly.
Can you please post them again?

I have a Jacuzzi j385, I hope to adapt your work to my Model.

Thanks
Pierre

jeanl
Posts: 13
Joined: Wed Feb 22, 2017 10:48 pm

Re: Hot tub / spa / jacuzzi controller

Sun Jul 23, 2017 12:25 am

Dropbox decided to change the way public folders work so this means my photos are no longer public. I'll repost them...


mccpie01
Posts: 4
Joined: Sat Jul 22, 2017 7:21 pm

Re: Hot tub / spa / jacuzzi controller

Sun Jul 23, 2017 4:19 pm

Thanks for the Images!!

tayfun
Posts: 3
Joined: Wed Jul 26, 2017 1:29 am

Re: Hot tub / spa / jacuzzi controller

Fri Jul 28, 2017 4:26 am

Hello Jean,

This is very nice work and timely too. I do have Jacuzzi J-LXL that I'd like to control remotely. Primarily to set the temperature so that the heater only goes on at night when the electricity prices are the lowest.

Based your posts I tried to figure out the pin out of the RJ12 you were referencing.

Assuming the cable you've used was wired as the standard says the colors and pins here is my guesses for what the pinout would look like:

Code: Select all

1 BLUE   -- 5V
2 YELLOW -- Temp
3 GREEN  -- Jets
4 RED    -- Ground
5 BLACK  -- Data
6 WHITE  -- Clock
Would you mind correcting or confirming it for us?

Have you figured out how to change the set temperature with PI ? You said temperature can be changed by connecting Yellow wire to 5V with 500 Ohm resistor.
Any more info on how to increase as well as decrease the temp setting?

Pierre,

As far as I can tell, J-385 and J-LXL have the same Circuit Board. Mine has a RJ45 (i.e 8 pin) jack which would make sense based on what Jean figured out.

Balboa was an OEM control board manufacturer in the past so, there is a good chance what Jean did would work as is with Jacuzzi models.

Expanding on what Jean listed, I am speculating that we might have something like

Code: Select all

R R
J J
1 4
2 8
- 1 Jet 2 ??
1 2 5V
2 3 Temp
3 4 Jet 1
4 5 Ground
5 6 Data
6 7 Clock
- 8 Lights ??
RJ12 would plug into an RJ45 jack but it would not have connection to the pins 1 and 8 of RJ45.

It is possible that they did change the pinout completely and we need to figure the signal assignments for ourselves.

-Tayfun

jeanl
Posts: 13
Joined: Wed Feb 22, 2017 10:48 pm

Re: Hot tub / spa / jacuzzi controller

Fri Jul 28, 2017 3:49 pm

@Tayfun, yes, the pinout you describe is correct for my jacuzzi.
As for your question about setting the temp: my jacuzzi has a weird temp control mechanism: there's only 1 button which you use both for increasing or decreasing the temperature. So, if you press the button, the temp display blinks, if you press again, the temp goes in the same direction it was going the last time you adjusted it. If you wait 3-4 seconds until the display no longer blinks, then press again, the next time you press the temp goes in the other direction. It's klunky and annoying but that's the way my controller board works so I had to deal with that. So in my case, there's only 1 pin that's used to control the temp.
If you have an 8-pin connector, things will no doubt be a bit different. How many different controls do you have on the top control surface? Do you have different buttons for temp up and down (luxury!!! :D ) ?
If I were you, I would just try it, making sure I use a 500 Ohm resistor, and trying to make contact from +5V (which you should be able to identify on the connector with a voltmeter) to each of the other pins. I don't think anything bad can happen when you do that given the resistor (DON'T use just a wire, that could be really bad).

Jean

tayfun
Posts: 3
Joined: Wed Jul 26, 2017 1:29 am

Re: Hot tub / spa / jacuzzi controller

Sat Jul 29, 2017 6:45 pm

Jean,

Thanks for the reply.

I have :
- Minus and Plus for temp. change
- Jets 1 - Two speeds : Low -> High -> Off
- Jets 2 - One speed : On -> Off
- Light on/off - High -> Medium -> Low -> Off
- Light mode - 4 modes

Here is the picture of the control panel. https://www.spapartsdepot.com/jacuzzi-s ... -lx-j-lxl/

Given that there are two cables coming out of the control panel and there is a seperate circuit board for the lights, I am beginning to think the RJ45 is just for the temp and jet controls and does not include the light controls. Without the light control buttons in the picture, 8 pins would be enough control the main functions.

Ground
5V
Clock
Data
Temp+
Temp-
Jets 1
Jets 2

It is time to open it up and start poking around. This might be the excuse I needed to get a Logic Analyzer :-)

This https://www.saleae.com looks very interesting.

-Tayfun

jeanl
Posts: 13
Joined: Wed Feb 22, 2017 10:48 pm

Re: Hot tub / spa / jacuzzi controller

Sat Jul 29, 2017 7:04 pm

Yep, it looks like you're going to have to poke around to find out what's what. And yes, nothing's better than a signal analyzer, the one you showed looks really interesting. Just make sure you can go high enough in frequency so you can look at the clock signal. It was 40kHz in my case, but it might be higher in your case.
It's going to be an interesting project!!!
BTW: I'm using my little setup exactly as you intend to use yours: I time the heater when power is cheaper. I don't know that it makes a huge difference, but that's what I do. As it turns out, we also use the remote control a lot to turn the temp up before we go in, without have to brave the elements (california! ah ah ah) outside!
Jean

eoinfkavanagh
Posts: 5
Joined: Fri Mar 30, 2018 4:24 pm

Re: Hot tub / spa / jacuzzi controller

Fri Mar 30, 2018 4:27 pm

I am wondering if i can tackle the same project. I am curious how Jayfun got on doing this project? Have we any examples on how to read signals using the PI. I have an RJ45 connection, so i will try drive them high with the PI and a resistor when i get a chance, but the main goal will be to have my current iPhone APP show the temp of the hottub while turning it up and down.

Hopefully, this thread hasn't gone dead! :D
Cheers!

jeanl
Posts: 13
Joined: Wed Feb 22, 2017 10:48 pm

Re: Hot tub / spa / jacuzzi controller

Fri Mar 30, 2018 5:07 pm

eoinfkavanagh wrote:
Fri Mar 30, 2018 4:27 pm
I am wondering if i can tackle the same project. I am curious how Jayfun got on doing this project? Have we any examples on how to read signals using the PI. I have an RJ45 connection, so i will try drive them high with the PI and a resistor when i get a chance, but the main goal will be to have my current iPhone APP show the temp of the hottub while turning it up and down.

Hopefully, this thread hasn't gone dead! :D
Can you say more about your hot tub? You say you have a RJ45 connection, but what is it between? I'm pretty sure there is no standard as to how hot tub manufacturers use these types of connections for displaying temp etc, so you have to reverse engineer it on a case-by-case basis.
There's a lot of good stuff for reading signals with the PI. In my experience, pigpio is by far the best. Super fast, super complete. It even has an scope so you can monitor GPIOs in real time, it's pretty cool.

tayfun
Posts: 3
Joined: Wed Jul 26, 2017 1:29 am

Re: Hot tub / spa / jacuzzi controller

Fri Mar 30, 2018 6:46 pm

eoinfkavanagh wrote:
Fri Mar 30, 2018 4:27 pm
I am wondering if i can tackle the same project. I am curious how Jayfun got on doing this project? Have we any examples on how to read signals using the PI. I have an RJ45 connection, so i will try drive them high with the PI and a resistor when i get a chance, but the main goal will be to have my current iPhone APP show the temp of the hottub while turning it up and down.

Hopefully, this thread hasn't gone dead! :D
What model of jacuzzi do you have ?

I'd be careful connecting PI directly to the hottub without knowing more about the signals on the RJ45 connector.

It might be safer to figure out which pin is 5V and which is GND and perhaps connect other pins to 5V thru an appropriately sized resistor one at a time and observe the control panel.

I am not too comfortable trying this w/o careful considerations myself. Damaging the control panel or the control board could be costly.

That's why I got a logic analyzer so that I can observe the pins as I press the various buttons on the control panel.

I haven't had time to play with the Jacuzzi controller itself yet.

I use SmartThings smart home hub to control lights etc. so I wanted to be able to control my Jacuzzi temperature with it too.
This way, I can take advantage of the ST app to schedule and/or change temperature settings anywhere in the world.

I am on a Time of Use electrical rate plan with the utility company PG&E so, running the heater between 11:00 PM and 7:00 AM means I only pay 13 cents per Kwh instead of up to 47 cents in summer at "Peak" times.

I did make progress with SmartThings "device handler". I can set the temperature with the ST app which notifies my PI of the temperature change but of course at this point I can't yet set the actual temperature on the Jacuzzi :-)
PI will be able to read the current temperature and pass it on so that, I can see the current temperature on ST app anytime.

ST.jpg
SmartThing Jacuzzi device handler
ST.jpg (51.4 KiB) Viewed 6641 times

I did use this project as an excuse to buy myself a nice Saleae Logic Analyzer :-)

I did test the RJ45 pins with an Ohmmeter to figure out which pin is 5V (1) and which is Ground (2).

There is no guarantee other models have the same pinout.

I haven't connected my PI to the Jacuzzi yet.

I am planning on using the Logic Analyzer to figure out what is going on with the signals as I change temperature with the control panel.

I am hoping I can use the LA traces to tell me which pin is doing what. There should one DATA pin and one CLOCK pin that tells the controller what to display etc.

Final step is to be able to change the set temperature.

For now, I can read and write PI's GPIO pins using the wiringPI library no problem.

I also purchased some optocouplers so that I can isolate the Jacuzzi signals from PI ones as additional safety measure.

Still need to find and test an appropriate circuit for this ...

Here is a simple test code to read a couple of GPIO pins. I used two push button switches to test the functionality.

I have one GPIO pin that normally reads 1 and another that reads 0. With two push button switches I can toggle them.

The idea is to emulate output signals (such as DATA and CLOCK) from the hottub.

Code: Select all


#include <stdio.h>
#include <unistd.h>
#include <wiringPi.h>

#define PULLUP          28      /* Normally 1 BCM_20 J8_38 */
#define PULLDOWN        29      /* Normally 0 BCM_21 J8_40 */

void intrPullUp(void);
void intrPullDown(void);

int
main (void)
{
        wiringPiSetup();
        pinMode(PULLDOWN, INPUT);
        pinMode(PULLUP, INPUT);

        wiringPiISR(PULLDOWN, INT_EDGE_BOTH, intrPullDown);
        wiringPiISR(PULLUP, INT_EDGE_BOTH, intrPullUp);

        printf("PullDown Pin is %d\n", digitalRead(PULLDOWN));
        printf("PullUp   Pin is %d\n", digitalRead(PULLUP));

        while (1) {
                sleep(1);
        }

        return (0);
}

int pd_prev;
void
intrPullUp(void)
{
        static int prev = 1;
        int new;

        new = digitalRead(PULLUP);

        if (prev != new) {
                printf("PullUp Pin %d -> %d\n", prev, new);
                prev = new;
        }
}

void
intrPullDown(void)
{
        static int prev = 0;
        int new;

        new = digitalRead(PULLDOWN);

        if (prev != new) {
                printf("PullDown Pin %d -> %d\n", prev, new);
                prev = new;
        }
}


I've used the two circuits below along with this code to try things out.
Pull Up Small.jpg
When the switch is closed, there is a lower resistance path to ground and so it will read low.
Pull Up Small.jpg (12.11 KiB) Viewed 6641 times
Pull Down Small.jpg
When the switch is closed, there is a lower resistance path to the 3.3V supply and it will then read high.
Pull Down Small.jpg (13.34 KiB) Viewed 6641 times

eoinfkavanagh
Posts: 5
Joined: Fri Mar 30, 2018 4:24 pm

Re: Hot tub / spa / jacuzzi controller

Tue Apr 03, 2018 5:00 pm

Thanks Guys, I have a good understanding of writing and reading the GPIO,s.

My main problem is that i don't have anything to read the signals, so i was thinking trial and error based on what i found on this forum. I agree with all the comments, I will be sure to figure out the signals (voltages) for each RJ45 connection with a multimeter first before connecting to a PI.

I am hoping its as simple as driving them high when i push the buttons for up and down. I don't really care about turning on Jets, but i assume that is the same also.

To answer another question: My control panel connects into the main PCB with all the relay's for someone who asked. When i plug out the RJ45 the power goes from the display. When i plug it back in, it turns on and shows the temp and starts the circulation cycle.

So really what i am trying to do is read the temperature and the current temp it is trying to get too. I also read people are using a MCP3008 to read the signals and display the values, but can i get around this without a signal analyzer or scope??

Thanks for all the replies.
Cheers!

jeanl
Posts: 13
Joined: Wed Feb 22, 2017 10:48 pm

Re: Hot tub / spa / jacuzzi controller

Tue Apr 03, 2018 5:14 pm

It shouldn't be hard, once you know which lines hold +V, ground. pigpio has a signal analyzer called piscope. Once you install that on your pi, and connect the GPIOs to the lines from your connector (and the ground), piscope will show you in real time the values it sees on each of the GPIOS. This should allow you to reverse engineer how the temperature value is transmitted from the main board to the display.

In other words, piscope is a replacement for a signal analyzer (but far less fancy).
Of course, be careful and connect the GPIOs with a 500Ohm resistor, for safety. I'm pretty sure nothing bad can happen if you do that.
If you're just trying to find which lines control the temp/jet etc, you can try connecting each line to +V (with the 500Ohm resistor) and see what happens. This is what I did with my hot tub. It's better if you can do that while the display is still plugged in (so you can see what's happening when you poke around), so it would be good to have a Y connector for your RJ

J.

eoinfkavanagh
Posts: 5
Joined: Fri Mar 30, 2018 4:24 pm

Re: Hot tub / spa / jacuzzi controller

Tue Apr 03, 2018 9:59 pm

Thanks JeanL. I ordered a cheap signal analyzer from amazon. So has anyone got some code samples of what they are doing once they understand the clock signal rate and signal pattern? It’s been a long time since I done this, but was hoping to see come code. It’s raining now, so I won’t be messing with the tub. I also am programming all in C# using Windows 10 so I opted not to use picscope but now I’m curious. Looks all Linux based.
Cheers!

jeanl
Posts: 13
Joined: Wed Feb 22, 2017 10:48 pm

Re: Hot tub / spa / jacuzzi controller

Tue Apr 03, 2018 10:11 pm

eoinfkavanagh wrote:
Tue Apr 03, 2018 9:59 pm
Thanks JeanL. I ordered a cheap signal analyzer from amazon. So has anyone got some code samples of what they are doing once they understand the clock signal rate and signal pattern? It’s been a long time since I done this, but was hoping to see come code. It’s raining now, so I won’t be messing with the tub. I also am programming all in C# using Windows 10 so I opted not to use picscope but now I’m curious. Looks all Linux based.
Can't help you with C#. All my code uses python, but it's really easy to get up to speed in python, especially if you have code to work from. Once you get the traces of the signals you're trying to interpret using your signal analyzer, post them here (the pics if possible), we should be able to point you in the right direction.
Essentially, the way you can do it with pigpio (python or C++), there's a deamon running in the background once the pi starts, and you connect to it. Once that's done, you'd setup a trigger on a rising edge for example, on the GPIO where the data line is coming in. Pigpio has very simple example of how to do that. If you're able to detect rising and falling edges and their timing, you essentially have a trace of your data signal. Now you have to reverse engineer it.
In short, get familiar with pigpio http://abyz.me.uk/rpi/pigpio/pdif2.html and the example the library provides.

eoinfkavanagh
Posts: 5
Joined: Fri Mar 30, 2018 4:24 pm

Re: Hot tub / spa / jacuzzi controller

Wed Apr 04, 2018 1:39 am

It has been awhile since i looked at the functions available in the .NET classes, but in C# IOT, there is event for detecting rising and falling edge, i have tested these a few moments ago with a simple circuit and push button. Here is my code. So i can definitely tell when an GPIO (Input) is going high and low. The big question will be can this method detect all the inputs from the data signal.

Code: Select all

 private void Pin_ValueChanged(GpioPin sender, GpioPinValueChangedEventArgs args)
        {
            switch (args.Edge)
            {
                case GpioPinEdge.FallingEdge:
                    fallingEdgeCount++;
                    System.Diagnostics.Debug.WriteLine(string.Format("FallingEdge: {0}",fallingEdgeCount));                    
                    break;

                case GpioPinEdge.RisingEdge:
                    risingEdgeCount++;
                    System.Diagnostics.Debug.WriteLine(string.Format("RisingEdge: {0}",risingEdgeCount));
                    break;
                        
            }
        }
Cheers!

jeanl
Posts: 13
Joined: Wed Feb 22, 2017 10:48 pm

Re: Hot tub / spa / jacuzzi controller

Wed Apr 04, 2018 2:25 am

eoinfkavanagh wrote:
Wed Apr 04, 2018 1:39 am
It has been awhile since i looked at the functions available in the .NET classes, but in C# IOT, there is event for detecting rising and falling edge, i have tested these a few moments ago with a simple circuit and push button. Here is my code. So i can definitely tell when an GPIO (Input) is going high and low. The big question will be can this method detect all the inputs from the data signal.

Code: Select all

 private void Pin_ValueChanged(GpioPin sender, GpioPinValueChangedEventArgs args)
        {
            switch (args.Edge)
            {
                case GpioPinEdge.FallingEdge:
                    fallingEdgeCount++;
                    System.Diagnostics.Debug.WriteLine(string.Format("FallingEdge: {0}",fallingEdgeCount));                    
                    break;

                case GpioPinEdge.RisingEdge:
                    risingEdgeCount++;
                    System.Diagnostics.Debug.WriteLine(string.Format("RisingEdge: {0}",risingEdgeCount));
                    break;
                        
            }
        }
I don't see why not. If your program is fast enough (and it's in C so most likely yes) it will be able to get the signal out of the data line. You need to detect the rising and falling edges and their timing so you can properly reconstruct what the signal looks like. And you'll need to do that both on the data line, and the clock line so you can view them in a synchronized view. Should be pretty fun :) ...

eoinfkavanagh
Posts: 5
Joined: Fri Mar 30, 2018 4:24 pm

Re: Hot tub / spa / jacuzzi controller

Wed Apr 04, 2018 2:53 am

Ok, well let’s see what I can find out. Any pointers on how you did this would be great. I’m not the best when it comes to signals but I learn fast. Maybe an example of your code based on your findings and how you got the times etc.

Thanks again.
Cheers!

jeanl
Posts: 13
Joined: Wed Feb 22, 2017 10:48 pm

Re: Hot tub / spa / jacuzzi controller

Wed Apr 04, 2018 2:58 am

eoinfkavanagh wrote:
Wed Apr 04, 2018 2:53 am
Ok, well let’s see what I can find out. Any pointers on how you did this would be great. I’m not the best when it comes to signals but I learn fast. Maybe an example of your code based on your findings and how you got the times etc.

Thanks again.
My code won't be of any help for you, because I didn't do it "the right way". I didn't know of pigpio for python at the time, if I had known, it would have been much simpler.
But in your case, it should be fairly easy, since you already have the code to detect edges. You need to add a time-stamp at each edge that you record (for example given by the system clock, must be fairly accurate, to a few microseconds, I'm sure there's a function for that in C#). You would record simultaneously your data and clock signals using 2 different GPIOs, and end up with a series of edges up/down with their time stamps. At that point it would be best to draw them as a signal so you can detect a pattern (looking at numbers is just impossible) for example, a data pattern that repeats every so many microseconds etc....

User avatar
TerryMulhern
Posts: 3
Joined: Fri May 31, 2019 4:54 pm

Re: Hot tub / spa / jacuzzi controller

Tue Jul 30, 2019 4:51 am

jeanl wrote:
Can't help you with C#. All my code uses python, but it's really easy to get up to speed in python, especially if you have code to work from. Once you get the traces of the signals you're trying to interpret using your signal analyzer, post them here (the pics if possible), we should be able to point you in the right direction.
Essentially, the way you can do it with pigpio (python or C++), there's a deamon running in the background once the pi starts, and you connect to it. Once that's done, you'd setup a trigger on a rising edge for example, on the GPIO where the data line is coming in. Pigpio has very simple example of how to do that. If you're able to detect rising and falling edges and their timing, you essentially have a trace of your data signal. Now you have to reverse engineer it.
In short, get familiar with pigpio http://abyz.me.uk/rpi/pigpio/hirewriters/pdif2.html and the example the library provides.
Hi JeanL,

Thanks for sharing the source for the pigpio C library. I've tried to use it for my project (I was trying to synchronize the camera frame taking and strobe pulse generation). Can I use gpioSetAlertFunc() function? Do you have any experience with it? Thanks.

Terry

jeanl
Posts: 13
Joined: Wed Feb 22, 2017 10:48 pm

Re: Hot tub / spa / jacuzzi controller

Tue Jul 30, 2019 3:59 pm

TerryMulhern wrote:
Tue Jul 30, 2019 4:51 am

Hi JeanL,

Thanks for sharing the source for the pigpio C library. I've tried to use it for my project (I was trying to synchronize the camera frame taking and strobe pulse generation). Can I use gpioSetAlertFunc() function? Do you have any experience with it? Thanks.

Terry
I don't have any direct experience with this function but I've used the python equivalent on countless occasions. I works great.
In general the pigpio library is very powerful and reliable (free of bugs).

Jean

smithl100
Posts: 2
Joined: Wed Dec 19, 2018 3:51 am

Re: Hot tub / spa / jacuzzi controller

Thu Aug 01, 2019 2:37 am

Hi, I know this thread is a little old, but I am attempting a very similar project. I hooked the oscilloscope up to the 10 pin panel, but need some help interpreting the data. I am going to get pigpio set up tomorrow and see if I can get more data. I will report back if that's alright with you?

jeanl
Posts: 13
Joined: Wed Feb 22, 2017 10:48 pm

Re: Hot tub / spa / jacuzzi controller

Thu Aug 01, 2019 3:48 am

smithl100 wrote:
Thu Aug 01, 2019 2:37 am
Hi, I know this thread is a little old, but I am attempting a very similar project. I hooked the oscilloscope up to the 10 pin panel, but need some help interpreting the data. I am going to get pigpio set up tomorrow and see if I can get more data. I will report back if that's alright with you?
Sounds great!

mudley
Posts: 1
Joined: Sun Sep 22, 2019 6:12 pm

Re: Hot tub / spa / jacuzzi controller

Sun Sep 22, 2019 6:20 pm

Hi Jean,

I have a new hottub and want to add it to my home automation system.
I've got a similar spa (also Balboa, https://www.tubs.fr/balboa-gs510dz-cont ... -2306.html).

The control system has 2 free rj45 ports (probably for extra touch panels).

So I want to do the same as you did, but still investigating about the what and how.
I do have enough it knowledge, but a huge lack of electrotechnical background.

Do you know how I can find out if my control system also needs to have the 500 ohm resistors (or more, or less ohm resistors).

I want to hook it up to a RPi, but for that to work, I have to add an 5v relay to it right?
Kind regards!

Mudley

Return to “Automation, sensing and robotics”