logo elektroda
logo elektroda
X
logo elektroda

Repurposing Tuya TH01 Temp/Humidity IoT Device with Sensylink CHT8310 Sensor

divadiow 1125 2
ADVERTISEMENT
  • #1 21232617
    divadiow
    Level 34  
    I have a few TH01 generic Tuya battery-powered temperature/hygrometer sensors lying in a box and although they were fun to analyse and flash to OBK, I don't have a real use for them.
    Two of them have CHT8310 temperature/humidity sensors, as opposed to the AHT20 and AHT30s in some of the others. I thought it'd be much more useful to have a CHT8310 sensor on its own for testing with other OpenBeken platforms - OpenBL, OpenESP, OpenW800, OpenLN etc. I have separate AHTs, but all the CHT8310s are in Beken devices.

    This TH01 is the same as this thread with CBU module https://www.elektroda.com/rtvforum/topic4019974.html. No TuyaMCU in the way.
    I started by removing the CBU (to be kept of course) with a load of flux and my 858D hot air gun.

    Now that the RX, TX and CEN test pads are of no use, could I use them for SDA, SCL and the Alert pins of the sensor? The test holes would also give me something solid to solder wires into.

    PCB board with electronic components in a vise.

    There was continuity from the SCL and SDA pins of the sensor straight through to the CBU pads. Only the alert pin was indirect via resistor R7, which was going to stay in place. It seemed like I could link pads directly as follows:

    SCL P20 -> CEN
    SDA P22 -> RX1
    ALERT P7 -> TX1

    Diagram of CBU module pins with capacitors C1 and C2.

    To illustrate, I made this:

    Modified TH01 board with marked SCL, SDA, and ALERT connections.

    Then realised that with solder and wires:
    Circuit board of a sensor with soldered wires.
    I don't know why I made the grey so long.

    There was continuity right through from the legs of the CHT, and R7 for alert pin, to the ends of the jumper wires.
    PCB board with soldered wires and a button.

    The moment of truth with a test on a CB3S/BK7231N

    Wired connections of sensors on a prototype board.
    P7-> SDA
    P8 -> SCL


    Screenshot displaying data from the OpenBeken platform regarding the CHT8310 sensor.

    😁

    And with SoftSCL/SoftSDA assigned P7/P8 and these commands

    Code: Text
    Log in, to see the code


    we get the i2c address for this Sensylink sensor
    Code: Text
    Log in, to see the code


    Time to make some wonky holes in the casing and clean up the flux with IPA.
    Temperature and humidity sensor with connected wires on a blue mat background. Interior of a TH01 sensor case with connected wires. Modified TH01 sensor with exposed wires White plastic battery holder for AAA batteries for a sensor. Plastic device casing with holes and soldered wires.

    and some ugly pen markings because I don't have a fine-point permanent marker or a label printer
    Modified temperature sensor with pin labels on the casing.

    Maybe I could have made use of the LED and button, but I'm OK with it being what it is right now.

    To do:
    -tidy grey wire and soldering
    -test alert pin function
    -test CHT driver on other platforms
  • ADVERTISEMENT
  • #2 21233522
    divadiow
    Level 34  
    @insmod thanks for enabling CHT83XX on ESP32-IDF.
    1344_merge_ba7820a59a2f


    Display showing data from ESP32, indicating temperature and humidity from CHT8310 sensor.
    Code: Text
    Log in, to see the code


    ESP32C3 configuration with temperature and humidity measurements.
    Code: Text
    Log in, to see the code


    User interface displaying information for OpenESP32C2 device.
    Code: Text
    Log in, to see the code


    Screenshot of OpenESP32C6 information with temperature and humidity data.
    Code: Text
    Log in, to see the code



    S3 not tested because of boot loop (unrelated to CHT driver)

    Added after 42 [minutes]:

    OpenBL602 device screen displaying temperature and humidity readings.
    Code: Text
    Log in, to see the code
  • #3 21233912
    divadiow
    Level 34  
    I've performed the same operation on a white PCB TH01 with CBU and Sensirion SHT30 temperature/humidity sensor. Bonus LED functional on this one.

    Image of a white PCB TH01 with electronic components and a micro USB port. Diagram and photo of white PCB TH01 with ESP32-S3 showing connections and pin descriptions. White PCB with electronic components and wires soldered on top of the board. White PCB TH01 with connected wires and an LED on a blue mat.

    Temperature and humidity chart with ESP32-S3, red LED active.

    White PCB TH01 with Sensirion SHT30 sensor, glowing red LED.

    Added after 44 [minutes]:

    Plastic casing with SHT30 sensor and colored wires.

    Added after 3 [hours] 2 [minutes]:

    divadiow wrote:
    S3 not tested because of boot loop (unrelated to CHT driver)


    ESP32-S3
    Screenshot showing the OpenESP32S3 control panel with temperature and humidity information.
    Code: Text
    Log in, to see the code
ADVERTISEMENT