I2C inlet temp hum sensor - revk/xESP32-Faikout GitHub Wiki

Warning

Messing about in your air-con unit can be dangerous with live power, and could damage the unit. Take all precautions necessary and you mess with your air-con unit at your own risk!

Some Daikin models use a temperature and humidity sensor connected using I2C bus. By connecting this sensor to the Faikout board (using I2C master on ESP32), and connecting the Faikout board to the Daikin motherboard (using I2C slave on ESP32) it is possible to provide either inlet sensors values or remote sensor values. Inlet sensor is mandatory to have a backup / fallback solution in case the remote sensor is considered as unavailable.

Hardware

ESP32 compatibility

AS we need two I2C bus to manage both the sensor and the Daikin board, only ESP32 with at least two I2C bus provide this feature:

  • ESP32 S1/S3/C5/C6 are supported
  • ESP32 C3 is not supported

Note: C5 and C6 have one standard I2C (HP) I2C bus that can be used as master and slave, and one "LP" I2C that can be used only as master and using specific pins. For that reason, the GPIO pins on these targets can be chosen freely for slave I2C only (communication with Daikin board) but are not configurable for master I2C (communication with the sensor).

Inlet sensor

Inlet sensor is known as HSHCAL101B. It uses a 4 pins connector and supports both 5v and 3.3v high state. HSHCAL101B_pinout The connector is a JST S4B-PH-K-S (JST PH 4 pins)

Wiring with sensor

Sensor Pin Meaning Faikout Pin
1 VDD Connected to 3.3v
2 SCL Connected to I2C Master - Serial Clock
3 SDA Connected to I2C Master - Serial Data
4 VSS Connected to GND

Wiring with Daikin motherboard

Sensor Pin Meaning Faikout Pin
1 VDD Not connected, or connected to 5v/3.3v converter as 5v reference voltage
2 SCL Connected to I2C Slave - Serial Clock, requires 5v/3.3v converter
3 SDA Connected to I2C Slave - Serial Data, requires 5v/3.3v converter
4 VSS Connected to GND

Configuration parameters

Following parameters are added to manage the feature:

Parameter name Default value Meaning
i2cen False (disabled) I2C feature activation
i2chtemp 4.0 Offset to add to remote sensor temp value when providing temp to Daikin board (heating mode)
i2cctemp -1.5 Offset to add to remote sensor temp value when providing temp to Daikin board (other modes)
i2cslsda 2 on C6 target
9 on other targets
GPIO to use for SDA on I2C slave
i2cslscl 3 on C6 target
10 on other targets
GPIO to use for SCL on I2C slave
i2cmasda 2 on C5 target (can't be modified)
6 on C6 target (can't be modified)
11 on other targets
GPIO to use for SDA on I2C master
i2cmascl 3 on C5 target (can't be modified)
7 on C6 target (can't be modified)
12 on other targets
GPIO to use for SCL on I2C master

Software development

I2C values

The inlet sensor uses:

  • SCL speed at 20kHz
  • Peripheral address = 0x18
  • Register addresses:
  • 0x10 = humidity value (low byte)
  • 0x11 = humidity value (high byte)
  • 0x12 = temp value (low byte)
  • 0x13 = temp value (high byte) We have to reproduce these conditions to communicate with sensor and Daikin boards on the I2C links.

Temperature and Humidity conversion

RH = ( HUMI - 1280 ) / 64 T = ( TEMP - 2096 ) / 50

Debugging / testing

Following examples from ESP-IDF can be used to debug / test the feature:

i2c_tools

Useful tool to request temp and hum values to Faikout board acting like a Daikin motherboard. Once loaded to an ESP32 and connected to Faikout (SDA/SCL/GND), use UART console (idf.py monitor) to send commands:

  • i2cconfig --freq=20000 --sda=5 --scl=4
  • i2cget -c 0x18 -r 0x10 -l 4

i2c_slave_network_sensor

This example can be easily modified to send a 4 bytes buffer when register 0x10 to 0x13 are requested by an I2C master.

⚠️ **GitHub.com Fallback** ⚠️