Home

Awesome

Licence MIT Language C/C++ Release tag Open issue PlatformIO CI

Oregon THN128 433MHz temperature transmit/receive library for Arduino

This is a 433MHz wireless 3-channel Oregon THN128 temperature transmit/receive Arduino library for ATMega328, ESP8266 and ESP32 using the (reverse-engineered) Oregon THN128 v1 protocol:

Oregon THN128

Transmit / receive hardware

This Arduino library can be used with low-power ATMega328 microcontroller (AVR architectures like Arduino UNO and Pro Mini 3.3V 8MHz boards).

Transmit and receive hardware

Temperature transmitter on the left breadboard:

Receiver on the right breadboard:

Supported microcontrollers

Arduino Examples

ESP32 with MQTT and Homeassistant

The Erriez_Oregon_THN128_ESP32_MQTT_Homeassistant.ino sketch can be used with Homeassistant integration.

Example screenshot Homeassistant dasboard:

Oregon THN128 ESP32 MQTT Homeassistant screenshot

Follow the steps below:

  1. Configure Homeassistant MQTT in configuration.yaml:
mqtt:
  discovery_prefix: ha
  # Enable when using SSL:
  # certificate: /ssl/ca.crt
  # client_cert: /ssl/client.crt
  # client_key: /ssl/client.key
  1. MQTT broker hostname, username and password should be configured in Homeassistant | Settings | Devices | MQTT.

  2. Configure the listed macro's in the example, build and run from the Arduino IDE. The following Oregon THN128 entities are automatically registered after a succesful MQTT connection:

  1. Configure Homeassistant dashboard configuration file:

Hardware Design Notes

Supported hardware:

Oregon Protocol

A packet is sent twice:

Oregon THN128 Protocol

Data (see header file ErriezOregonTHN128Receive.h):

Oregon THN128 Temperature 16.6

Library Changes

v1.1.0

The callback function void delay100ms() has been removed as this was not compatible with ESP32. The application should change the code to:

    // Send temperature twice with 100ms delay between packets
    OregonTHN128_Transmit(&data);
    delay(100);
    OregonTHN128_Transmit(&data);

AVR targets can replace delay(100) with LowPower usage:

    LowPower.powerDown(SLEEP_15MS, ADC_OFF, BOD_OFF);
    LowPower.powerDown(SLEEP_60MS, ADC_OFF, BOD_OFF);
    LowPower.powerDown(SLEEP_15MS, ADC_OFF, BOD_OFF);

Saleae Logic Analyzer

capture

capture from the Oregon THN128 can be opened with https://www.saleae.com/downloads/.

Generated Arduino Library Doxygen Documentation

MIT License

This project is published under MIT license with an additional end user agreement (next section).

End User Agreement :ukraine:

End users shall accept the End User Agreement holding export restrictions to Russia to stop the WAR before using this project.