Ethernet Shield with SPI Slave - Hot-Tub Automation

I am trying to connect my hot-tub to my local network using an Arduino.
I'm trying to avoid a multi-device solution, but in summary I have the following:

  1. The Hot-tub's integrated controller has 5V IO, and communicated to the control panel as an 'SPI master' to update the display
  2. The hot-tub receives commands from the control panel using an analog voltage (8 values between 0 and 5v)
  3. Arduino Mega 2560 + Ethernet Shield - I'd like to use this to replace the control panel on the tub.

I would now like to connect this as a basic webserver on my local network.

The frequency of the data coming from the hot-tub is quite high, but I've managed to use the Arduino SPI in slave mode to successfully receive the data. Soft SPI does not work due to the frequency of the data.

The Ethernet shield works by using the Arduino SPI in master mode. It seems the single hardware SPI on the Arduino would not allow master and slave modes to co-exist.

So what are my options:

  1. Use softSPI for the Ethernet shield - has this been done?
    I'm guessing with an SPI master this should be do-able, but may require a lot of driver hacking...
  2. Go to a 2 board solution - one with SPI slave, UART comms and a 2nd as the Ethernet interface?
  3. Something else?

I don't think its possible to receive the data from the hot tub using a soft-SPI slave, I tried sampling the data in a tight loop and it dropped bits, etc. I don't have an oscilloscope to see the frequency of the signal.

Any and all ideas are appreciated!

Why?

The ethernet shield is so I can connect my Arduino to my local network, and used SPI to control the tub.

Basically:
Hot tub <-> SPI <-> Mega 2560 <-> Ethernet

Now the coin fell down.

Then the need for SPI would not be needed.

The You need to produce 0 - 5 voltages with the Mega. That calls for additional circuitry.

Can You draw a logic block diagram for "the new" design of the system? Control panel and its display is gone..... Some things are unclear.

SPI is needed as that is what the hot tub controller uses. The hot tub has a physical control panel that drives the control unit for the tub, and the protocol between these is SPI.

I'm basically replacing the physical control panel on the hot tub with a network based controller (Arduino plus ethernet)

So SPI is needed to interface between the Arduino and the hot tub control unit, and then ethernet for the network.

Again, please respond to reply #4, the last lines. For the moment, not clear what will be replaced. Please don't spend time repeating old words.

The control panel and display are gone. Those are to be directly replaced but the Arduino running a simple webpage interface.

Old:
Hot tub controller <-> SPI <-> display/panel

Desired:
Hot tub controller <-> SPI <-> Arduino <-> ethernet

The hot tub controller is what runs the pumps, fans, heaters etc and it uses SPI for comms.

You wrote that the hot tub controller uses 0 - 5 volt communication. Then You wriye is uses SPI.
Sorry but the communication doesn't go forward.

Once again, please draw a logic block diagram showing what the communication looks like, what signals it use.
So far time has been spent, for both of us, for no good.

Technical documentation is requested for the remaining parts of the old system.

The logic is as follows:

  1. From hot tub to display: SPI (master)
  2. From buttons (panel) to hot tub: 5V analog voltage.

Driving the 5V analog signal is trivial, i'm using a PWM output from the Arduino with an RC filter (basically a DAC), so that's solved. I regret mentioning this part now as it's just caused confusion, and is not an issue.

However interfacing with the SPI is the issue and the reason for this post, because it means the Arduino must be configured as an SPI slave, but it cannot be as the Ethernet shield already uses the hardware SPI.

So the question (at the bottom of post #1) is what are my options to make this work. I'm thinking I'll need a 2 device solution unfortunately, but am open to suggestions

You have told that the display is gone.

You have told: Panel is gone.

Sorry but my patience has come to an end. Whish some other helper will take on Your post. I'm done.

I'm describing the "old" case, as you explicitly requested, in that case the display and panel are of course there. The new case is where I'm trying to replace these with the Arduino.

I wish you well.

To be absolutely as clear as I can, here it is for anyone else who can help:

Old:

  1. From hot tub -> SPI -> display
  2. To hot tub <- 5V analog <- buttons

Desired:

  1. From hot tub -> SPI (master) -> Arduino (slave)
  2. To hot tub <- 5V analog <- PWM Out of Arduino

The Arduino also is desired to connect to an ethernet shield, which consumes the hardware SPI, hence the issue.

No good repeating Yourself. I'm out.

Flags to mods noted, now, please keep it friendly.

Thank you.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.