# RS-485 bus

The pool controller uses a “RS-485” bus to communicate with devices such as the pump and chlorinator. This is an industry standard two-wire bus with differential signaling. Devices are daisy-chained with 120 Ω termination resistors on both ends to limit reflections.

By snooping the traffic on this bus, we can learn about the status of the controller. We can also observe commands that the controller sends to the devices and the subsequent responses that it receives.

## Inside the controller

The easiest place to access the bus is from the inside of the pool controller.

THIS PROJECT IS OFFERED AS IS. IF YOU USE IT YOU ASSUME ALL RISKS. NO WARRENTIES. PROCEED AT YOUR OWN RISK! Always make sure to at the very least turn off the power while working on your pool equipment. Work carefully, THERE IS ALWAYS A RISK OF BREAKING YOUR POOL EQUIPMENT.

That being said, the RS-485 header can be found on the back of the control board. There are most likely wires already connected that go to devices such as the pump and chlorinator.

To minimize electromagnetic interference, use two twisted pairs from something like a CAT-5e cable to connect the A/B pair and the +15V/GND power pair to the interface as shown in the table below. To minimize the risk of shorting the power, you probably don’t want to connect the power signal just yet.

Controller RS-485 Cat5
Com Port Name Name Idle state Wire Pair
Green -DATA A negative pair 1
Yellow +DATA B positive pair 1
Red +15 V n/a pair 2
Black GND n/a pair 2

## RS-485 connection

With our cable connected, we can examine the signals. The shortest pulse length is about 104 µsec. From this, the data rate follows as 1/0.000104 = 9600 baud. The exact flavor of the data bus is shown below.

Name Value
baud rate 9600
data bits 8
parity none
stop bits 1

Such a low data rate implies that we don’t have to be very concerned about daisy-chaining the devices. In other words, it is OK to just wiretap the signal on the controller.

When we connect the differential signal to a RS-485 transceiver such as the MAX485, we get regular TTL levels.

## TTL to CMOS signals

The microcontrollers that we consider use CMOS voltages (3.3 V). For the prototypes, we used an existing breakout board, but replaced the MAX485 with a MAX3485 chip. While we’re at it, we’ll also remove the 10 kΩ CMOS pullup resistors (R1R4), but leave the RS-485 bias and bus termination resistors.

Knowing about the interface and baud rate, we can move on to building a system that interprets the proprietary message protocol. Continue reading to learn about the hardware design.

## One Reply to “RS-485 bus”

1. Sam says:

Good day,
Just a heads up that for your RS485 interface you really should include a reference connection. Although RS485 uses differential signalling between the “A” and “B” connections, the reference is extremely important to ensure that the voltages as “seen” by the RS485 are suitably electrically referenced. Remember that the “A” and “B” connections do have maximum voltage levels with respect to the RS485 transceiver chip’s own ground pin and without a reference to this pin the A and B absolute voltages could exceed the maximum voltages of the RS485 transceiver resulting is its damage… or worse… or electrically stressed transceiver that has odd or periodic issues. In most cases the RS485’s reference line is tied to the RS485’s ground connection through a higher wattage resistor (100 ohms or so). The resistor is important, as it also can limit excessive ground currents between interconnected RS485 devices. Sadly, a lot of RS485 devices are improperly designed and so communication problems can result when multiple manufacturer RS485 devices are connected. In these applications it is usually best to design an electrically isolated RS485 interface, as this can minimize a lot of issues.