Reading a Fisher & Paykel fridge's own data links with an ESP32

An ESP32 listening to my fridge's main board gives Home Assistant the doors, settings, modes, compressor, defrost and the fridge's own temperatures.

The fridge's control panel on the inside wall: Compartment and Alarm Mute buttons, a display reading 2 °C and −18 °C, and Colder and Warmer buttons
Difficulty
Advanced
Parts cost
About A$35: XIAO ESP32-C3 ~A$15, resistors, capacitors, perfboard, a DS18B20 probe. Logic analyser ~A$10 to check your model
Build time
A weekend, including working out the protocol
Skills
Soldering, ESPHome, Multimeter, Logic analyser

The problem

My fridge is a Fisher & Paykel RF505BRNUX1: a 515 litre bottom-freezer with ice and water. It has no Wi-Fi and no app. I wanted Home Assistant to know when a door is open, what it’s set to, when the compressor and defrost run, and how cold it actually is in there.

The fridge's main control board in its white plastic housing on top of the cabinet, with a transformer and power supply parts at the top and wiring looms plugged in along the bottom
The main board sits on top of the cabinet, under the controller cover.

The main board has a 4-pin header marked WIFI, but on this model it sends one byte at power-up and then nothing, whatever you send it. So I listened to the links between the boards instead. The main board talks to the other boards in the fridge over two serial links, and everything the panel shows travels on them.

How it works

How the fridge bridge listens in The fridge's main board talks to the inside control panel on one serial link, and to the ice and water board and the door display on a second link called BUS. The ESP32 is tapped onto both links through resistor dividers, and onto the fridge and freezer temperature sensors through high-value dividers. It only listens and never sends anything. It runs off its own isolated 5 volt supply and reports to Home Assistant over Wi-Fi. Main board runs the fridge Inside panel settings, modes, doors Door display node 08 Ice & water board node 04 Sensors fridge R-S, freezer F-S ESP32-C3 listens only never sends Home Assistant CN11 BUS thermistors

The main board runs the fridge. It sends the inside control panel a status message several times a second on a link called CN11. It also polls two other boards on a second link labelled BUS: the ice and water board, and the door display with the water dispenser.

The ESP32 is tapped onto both links through resistor dividers that bring the signals down to about 3 V. It has no transmit pins in its config, so it only listens. Nothing is cut and nothing is sent. If it dies, the fridge carries on exactly as before.

The main board sends its own freezer and evaporator temperatures on the BUS. The fridge compartment sensor isn’t on either link, so the ESP32 reads that sensor directly, through a divider high enough that the fridge’s own reading doesn’t move.

This is for my model. The main board is a Haier platform board (Fisher & Paykel is Haier-owned), so other fridges built on it may match. Check yours with a logic analyser first.

Both links run at 9600 baud, 8N1.

Link Where Direction Signal
CN11 D-TX Main board, CN11 Main board → inside panel 5 V logic, inverted (idles at 0 V)
BUS Main board top connector, and CN8 on the ice & water board Main board polls the others Idles at 12 V through a 1.8 kΩ pull-up

Every message looks like:

A5  to  length  from  command  data ...  crc-low crc-high  5A

The length counts the whole message, A5 to 5A. The main board is FF, the inside panel FC, the ice and water board 04, and the door display 08. The 23-, 28- and 34-byte messages carry a standard CRC-16/MODBUS over everything from the “to” byte to the end of the data. The firmware throws away any message that fails it.

Close-up of the black main board's silkscreen: a 6-pin connector labelled RG-S, +5V, D-TX, D-RX, GND, +12V, and a column of sensor pins labelled RH-S, RT-S, R-S, RS-S and GND
CN11 at the bottom (RG-S, +5V, D-TX, D-RX, GND, +12V) and the sensor pins on the left, R-S among them.

Counting from 0 at the A5:

Message Byte Meaning
CN11, 28 bytes 6 Fridge setting, °C
7 Freezer setting + 24 (06 = −18 °C)
9 01 Fast Freeze, 08 door alarm muted
10 01 ice maker on, 02 Ice Boost, 08 Bottle Chill, 20 water filter due
18 04 fridge door open, 08 freezer drawer open
BUS, main → ice & water, 23 bytes 7 08 fan, 10 compressor, 20 water dispenser locked
13–14 Freezer temperature
19 Defrost stage: 0 none, 4 heater, 5 drip, 6 fan delay
BUS, ice & water → main, 34 bytes 6–7 Evaporator temperature
27 08 water valve open

The temperatures are 16-bit numbers in tenths of a degree, offset by 40: °C = value ÷ 10 − 40. On mine the freezer cycles between about 182 and 211 (−21.8 to −18.9 °C, set to −18), and the evaporator ends a defrost at about 475 (+7.5 °C).

The full byte map, including the ice-maker timers and the door display’s message, is in the GitHub repo.

What you need

  • Seeed XIAO ESP32-C3 (about A$15).
  • Resistors: 2 × 100k, 1 × 220k, 1 × 33k, 4 × 1M.
  • 2 × 100 nF capacitors.
  • A small perfboard, female header strip, hookup wire and heatshrink.
  • An isolated 5 V supply. A USB phone charger is the simplest.
  • A DS18B20 temperature module (I used a Jaycar XC3700, which has its pull-up resistor on board) to calibrate the fridge compartment sensor.
  • A multimeter.
  • To check your model: a logic analyser. Mine is a cheap 24 MHz 8-channel one, about A$10.

Opening the fridge’s controller and soldering to its wiring will very likely void the warranty. Make that call before you start.

Wiring

The green ice and water board with a 5-pin connector labelled 12V, GND, 5V, BUS, W_SW, and tapped wires running from it
CN8 on the ice & water board: 12V, GND, 5V, BUS, W_SW.
CN11 D-TX ──[100k]──┬── D10 (GPIO10)        BUS ──[100k]──┬── D5 (GPIO7)
                  [220k]                                [33k]
GND ────────────────┴── GND                 GND ──────────┴── GND

R-S ──[1M]──┬── D1 (GPIO3)                  F-S ──[1M]──┬── D2 (GPIO4)
          [1M] ‖ 100 nF                               [1M] ‖ 100 nF
GND ────────┴── GND                         GND ────────┴── GND

Fridge GND (CN11 pin 5) ── XIAO GND
DS18B20 module:  S ── D3 (GPIO5),  V ── 3V3,  G ── GND
  • The 100k/220k divider brings CN11’s 5 V down to 3.4 V. The 100k/33k divider brings the BUS’s 12 V down to 3.0 V.
  • The 1M/1M dividers on the sensors are high on purpose, so the fridge still reads its own sensor correctly. The 100 nF capacitor gives the ESP32’s ADC something stiff to sample from.
  • Use the D-labels printed on the XIAO. They aren’t the GPIO numbers.
  • The fridge’s GND has to go to the XIAO’s GND, or neither link can be read.
A Coreva 101S-UCC perfboard part-way through the build, held in helping hands, with a header row soldered in and the first links in place
The board part-way through. The full hole-by-hole layout is in the repo.

I built it on a Coreva 101S-UCC perfboard, with the XIAO in header sockets, and spliced the fridge wires on with heatshrink. The hole-by-hole layout is in the repo’s board-layout.md.

Firmware and config

The ESPHome config is fridge-bridge.yaml in the repo. The important parts:

uart:
  - id: door_uart          # CN11, main board -> inside panel
    rx_pin:
      number: GPIO10
      inverted: true
    baud_rate: 9600
    rx_buffer_size: 1024
  - id: bus_uart           # BUS, main board <-> ice & water board and door display
    rx_pin: GPIO7
    baud_rate: 9600
    rx_buffer_size: 1024

Neither UART has a tx_pin, so nothing can be sent. A 10 ms interval reads both UARTs, cuts the stream into A5 … 5A messages, checks the CRC and publishes the bits from the table above:

if (&c == &ch[0] && n == 28 && fr[1] == 0xFC && fr[4] == 0x03) {
  id(fridge_door).publish_state((fr[18] & 0x04) != 0);
  id(freezer_door).publish_state((fr[18] & 0x08) != 0);
  if (id(fridge_setpoint).state != fr[6]) id(fridge_setpoint).publish_state(fr[6]);
  if (id(freezer_setpoint).state != (int) fr[7] - 24) id(freezer_setpoint).publish_state((int) fr[7] - 24);
}
if (&c == &ch[1] && n == 23 && fr[1] == 0x04 && fr[3] == 0xFF && fr[4] == 0x03) {
  id(compressor).publish_state((fr[7] & 0x10) != 0);
  id(defrost).publish_state(fr[19] != 0);
  id(freezer_temp).publish_state(((fr[13] << 8) | fr[14]) / 10.0f - 40.0f);
}

The fridge and freezer sensor voltages come in through two adc sensors with attenuation: 12db and a multiply: 2.0 filter for the divider, and the DS18B20 through one_wire and dallas_temp.

The fridge compartment temperature

The main board doesn’t send the fridge compartment temperature on either link, so the ESP32 converts the R-S sensor voltage itself with the standard formula for a thermistor in a divider:

°C = 1 / (1/298.15 − ln((5.236 / V − 1) / k) / 3591) − 273.15
  • 5.236 and 3591 came from the freezer sensor. Its voltage and the main board’s own freezer reading on the BUS line up almost perfectly (correlation 0.998), so fitting one against the other gives the supply and the thermistor’s curve.
  • k is the only number that differs for the fridge sensor. I fitted it against a thermometer in the middle of the fridge overnight. On mine k = 2.275, which matched to within 0.2 °C on half-hour averages.
  • On mine, 2.80 V is 3.0 °C and 2.70 V is 4.6 °C. Check k on your own fridge.
A Keyestudio DS18B20 temperature module held between two fingers, with S, V and G pins on a yellow header
A DS18B20 module like this one, plugged into the board's probe socket, is the easiest reference thermometer.

In ESPHome it’s a template sensor:

- platform: template
  name: "Fridge temperature"
  unit_of_measurement: "°C"
  device_class: temperature
  update_interval: 10s
  lambda: |-
    float v = id(rs_volts).state;
    if (isnan(v) || v < 0.5f || v > 5.0f) return NAN;
    return 1.0f / (1.0f / 298.15f - logf((5.236f / v - 1.0f) / 2.275f) / 3591.0f) - 273.15f;

Step by step

  1. Unplug the fridge and take the controller cover off the top of the cabinet.
  2. Find CN11, the BUS and the sensor pins by their silkscreen labels. On mine the BUS is also on CN8 of the ice & water board.
  3. Build the board and check every divider with a multimeter before anything is connected.
  4. Flash the ESP32 over USB on the bench. With a DS18B20 plugged in, it should read room temperature.
  5. Wire it in with the fridge unplugged: fridge GND first, then BUS, F-S, R-S and CN11 D-TX.
  6. Power it from its own isolated 5 V supply, plug the fridge back in, and add the device in Home Assistant when it’s discovered.
  7. Put a thermometer in the middle of the fridge (the DS18B20 in a zip-lock bag, or any sensor already in Home Assistant) and leave it overnight. Fit k from the R-S voltage against it.

Testing it

The ESPHome log prints a line every minute with a message count for each link:

DOOR frames 6479 bad 0 crc 0 bytes 119856 | BUS frames 21854 bad 0 crc 0 bytes 230596

Both bad and crc should stay at 0 or very close to it. Then open the fridge door and the freezer drawer and watch them change in Home Assistant, change the settings on the panel, and watch the compressor and the freezer temperature through a cycle.

The Fridge Bridge device in Home Assistant listing its sensors: Compressor running, Freezer temperature −19.8 °C, Fridge temperature 3.7 °C, Fridge setting 2 °C, Freezer setting −18 °C, Evaporator temperature −27.8 °C, doors closed, Fast Freeze, Bottle Chill, Ice Boost and ice maker off, water dispenser locked
Everything the fridge knows, in Home Assistant.
Home Assistant history from 11 pm to 8 am: the compressor and fan cycling on and off about every 25 minutes, defrost running at about 1:30 am and 7 am, the doors closed, and the freezer sensor voltage rising and falling with each compressor cycle and dropping sharply during each defrost
One night: the compressor cycles, two defrosts about six hours apart, and the freezer sensor voltage (it drops as the sensor warms).

Lessons learnt

Read the silkscreen first. Every connector on this board is labelled: CN11, BUS, R-S, F-S. That told me where to put the logic analyser before I’d decoded a single byte.

Skip the WIFI header on this model. It sends one byte at power-up and nothing after. The links between the boards carry everything the panel shows.

Change one thing at a time while decoding. Open one door, press one button or change one setting, and watch which byte moves. Each row in the byte table came from doing exactly that.

Size each divider for its own signal. CN11 is 5 V and inverted, and the BUS idles at 12 V. With 100k/220k and 100k/33k, both links have run with zero CRC failures.

Keep the sensor taps high-impedance. The 1M/1M dividers take so little current that the fridge still reads its own sensors correctly.

Let the fridge calibrate its own sensors. The main board already sends its freezer reading, so fitting the F-S voltage against it gave the thermistor curve. The fridge compartment then needed only one number from a thermometer.

Questions and comments

Loading comments…

    Your name and comment show publicly. To stop spam, a scrambled code made from your internet address is kept, never the address itself. Comments with links wait for a quick check before they show. Be decent: I'll remove anything that isn't.