{"id":15145376,"url":"https://github.com/erriez/erriezoregonthn128","last_synced_at":"2026-01-04T21:10:11.277Z","repository":{"id":45741871,"uuid":"215863236","full_name":"Erriez/ErriezOregonTHN128","owner":"Erriez","description":"Oregon THN128 transmit and receive C library for Arduino","archived":false,"fork":false,"pushed_at":"2023-01-01T00:56:48.000Z","size":3591,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T20:36:12.027Z","etag":null,"topics":["433mhz","arduino","avr","diy","documentation","esp32","esp8266","examples","homeassistant","library","mqtt","oregon","protocol","receive","rf","temperature","thn128","transmit","wireless"],"latest_commit_sha":null,"homepage":"https://github.com/Erriez/ErriezArduinoLibraries","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Erriez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-17T18:48:10.000Z","updated_at":"2024-05-10T07:18:21.000Z","dependencies_parsed_at":"2023-01-31T20:15:55.832Z","dependency_job_id":null,"html_url":"https://github.com/Erriez/ErriezOregonTHN128","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Erriez/ErriezOregonTHN128","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erriez%2FErriezOregonTHN128","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erriez%2FErriezOregonTHN128/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erriez%2FErriezOregonTHN128/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erriez%2FErriezOregonTHN128/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Erriez","download_url":"https://codeload.github.com/Erriez/ErriezOregonTHN128/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erriez%2FErriezOregonTHN128/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260081866,"owners_count":22956201,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["433mhz","arduino","avr","diy","documentation","esp32","esp8266","examples","homeassistant","library","mqtt","oregon","protocol","receive","rf","temperature","thn128","transmit","wireless"],"created_at":"2024-09-26T11:24:03.450Z","updated_at":"2026-01-04T21:10:11.271Z","avatar_url":"https://github.com/Erriez.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Oregon THN128 433MHz temperature transmit/receive library for Arduino\n\nThis is a 433MHz wireless 3-channel Oregon THN128 temperature transmit/receive Arduino library for ATMega328,\nESP8266 and ESP32 using the (reverse-engineered) Oregon THN128 v1 protocol:\n\n[![Licence MIT](https://img.shields.io/badge/license-MIT-green)](https://github.com/Erriez/ErriezOregonTHN128/blob/master/LICENSE)\n[![Language C/C++](https://img.shields.io/badge/language-C%2FC%2B%2B-informational)](https://github.com/Erriez/ErriezOregonTHN128)\n[![Release tag](https://img.shields.io/github/v/release/Erriez/ErriezOregonTHN128?display_name=tag)](https://github.com/Erriez/ErriezOregonTHN128/releases)\n[![Open issue](https://shields.io/github/issues-raw/Erriez/ErriezOregonTHN128)](https://github.com/Erriez/ErriezOregonTHN128/issues)\n[![PlatformIO CI](https://github.com/Erriez/ErriezOregonTHN128/actions/workflows/actions.yml/badge.svg)](https://github.com/Erriez/ErriezOregonTHN128/actions/workflows/actions.yml)\n\n\n![Oregon THN128](https://raw.githubusercontent.com/Erriez/ErriezOregonTHN128/master/extras/OregonTHN128.png)\n\n## Transmit / receive hardware\n\nThis Arduino library can be used with low-power ATMega328 microcontroller (AVR architectures like `Arduino UNO` and \n`Pro Mini 3.3V 8MHz` boards).\n\n![Transmit and receive hardware](extras/transmit-receive-hardware.png)\n\n**Temperature transmitter on the left breadboard:** \n\n* Pro-Mini 3V3 8MHz.\n* Genuine DS18B20 temperature sensor.\n* STX802 low-power 433MHz transmitter.\n\n**Receiver on the right breadboard:**\n\n* SRX882 low-power 433MHz receiver.\n* SSD1306 I2C 128x64 OLED display.\n* Pro-Mini 3V3 8MHz.\n\n### Supported microcontrollers\n\n* ATMega328 AVR designed for low-power\n* ESP8266\n* ESP32\n* Other microcontrollers are not tested and may or may not work\n\n\n## Arduino Examples\n\n* [Oregon THN128 Receive](https://github.com/Erriez/ErriezOregonTHN128/blob/master/examples/ErriezOregonTHN128Receive/ErriezOregonTHN128Receive.ino)\n* [Oregon THN128 Receive SSD1306 OLED](https://github.com/Erriez/ErriezOregonTHN128/blob/master/examples/ErriezOregonTHN128ReceiveSSD1306/ErriezOregonTHN128ReceiveSSD1306.ino)\n* [Oregon THN128 Transmit random temperature](https://github.com/Erriez/ErriezOregonTHN128/blob/master/examples/ErriezOregonTHN128Transmit/ErriezOregonTHN128Transmit.ino)\n* [Oregon THN128 Transmit DS1820 1-wire temperature sensor](https://github.com/Erriez/ErriezOregonTHN128/blob/master/examples/ErriezOregonTHN128TransmitDS1820/ErriezOregonTHN128TransmitDS1820.ino)\n* [Oregon THN128 ESP32 MQTT Homeassistant](https://github.com/Erriez/ErriezOregonTHN128/blob/master/examples/ESP32/Erriez_Oregon_THN128_ESP32_MQTT_Homeassistant/Erriez_Oregon_THN128_ESP32_MQTT_Homeassistant.ino)\n\n\n### ESP32 with MQTT and Homeassistant\n\nThe [Erriez_Oregon_THN128_ESP32_MQTT_Homeassistant.ino](https://github.com/Erriez/ErriezOregonTHN128/blob/master/examples/ESP32/Erriez_Oregon_THN128_ESP32_MQTT_Homeassistant/Erriez_Oregon_THN128_ESP32_MQTT_Homeassistant.ino) sketch can be used with Homeassistant integration.\n\nExample screenshot Homeassistant dasboard:\n\n![Oregon THN128 ESP32 MQTT Homeassistant screenshot](extras/Erriez_Oregon_THN128_ESP32_MQTT_Homeassistant.png)\n\nFollow the steps below:\n\n1. Configure [Homeassistant MQTT](https://www.home-assistant.io/integrations/mqtt/) in `configuration.yaml`:\n\n```yaml\nmqtt:\n  discovery_prefix: ha\n  # Enable when using SSL:\n  # certificate: /ssl/ca.crt\n  # client_cert: /ssl/client.crt\n  # client_key: /ssl/client.key\n```\n\n2. MQTT broker hostname, username and password should be configured in `Homeassistant | Settings | Devices | MQTT`.\n\n3. 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:\n- sensor.oregon_thn128_ch1\n- sensor.oregon_thn128_ch2\n- sensor.oregon_thn128_ch3\n- sensor.oregon_thn128_battery\n\n4. Configure Homeassistant dashboard configuration file:\n- [Homeassistant Dashboard YAML](extras/HomeassistantDashboard.yaml)\n\n\n## Hardware Design Notes\n\nSupported hardware:\n* AVR designed for low-power\n* ESP8266\n* ESP32\n\n* For low-power transmitters, a `Pro Mini 3V3 8MHz` bare board with ATMega328 microcontroller is highly recommended. The\n  board has no serial interface chip which reduces continuous power consumption. An external FTDI232 - USB serial \n  interface  should be connected for serial console / programming. (See red PCB on the picture)\n  The SMD power LED should be desoldered from the Pro Mini to reduce continuous power consumption. \n* A transmitter with (protected) 1500mA 18650 battery can operate for at least 6 months with `LowPower.h` functionality\n  implemented. (By sending the temperature every 30 seconds)\n* Changing the BOD (Brown Out Detection) fuse to 1.8V allows operation between 1.8 and 4.2V 18650 battery. (Explanation \n  beyond the scope of this project)\n* 1 to 3 temperature transmitters are supported, similar to the original Oregon THN128 temperature transmitters.\n* Check [list of counterfeit DS18B20 chips](https://github.com/cpetrich/counterfeit_DS18B20) , because this makes a huge\n  difference in accuracy and read errors at 3.3V. Many DS18B20 chips from Aliexpress are counterfeit and won't work  \n  reliable at voltages below 3.3V.\n* [NiceRF Wireless Technology Co., Ltd.](https://nl.aliexpress.com/store/934254) sells high quality 433MHz transmit \n  (STX802) and receiver modules (STX882) with a good range.\n* A 18650 battery (with protection circuit) should be connected directly to the VCC pin (not VIN). \n* The voltage regulator can be desoldered from the pro-micro board when not used for more power reduction.\n\n\n## Oregon Protocol\n\nA packet is sent twice:\n\n![Oregon THN128 Protocol](https://raw.githubusercontent.com/Erriez/ErriezOregonTHN128/master/extras/OregonTHN128Protocol.png)\n\nData (see header file [ErriezOregonTHN128Receive.h](https://github.com/Erriez/ErriezOregonTHN128/blob/master/src/ErriezOregonTHN128Receive.h)):\n\n*  Byte 0:\n   * Bit 0..3: Rolling address (Random value after power cycle)\n   * Bit 6..7: Channel: (0 = channel 1 .. 2 = channel 3)\n*  Byte 1:\n   * Bit 0..3: TH3\n   * Bit 4..7: TH2\n*  Byte 2:\n   * Bit 0..3: TH1\n   * Bit 5:    Sign\n   * Bit 7:    Low battery\n*  Byte 3:\n   * Bit 0..7: CRC\n\n![Oregon THN128 Temperature 16.6](https://raw.githubusercontent.com/Erriez/ErriezOregonTHN128/master/extras/OregonTHN128Temperature16.6.png)\n\n\n## Library Changes\n\n### v1.1.0\n\nThe callback function `void delay100ms()` has been removed as this was not compatible with ESP32. The application should\nchange the code to:\n\n```c++\n    // Send temperature twice with 100ms delay between packets\n    OregonTHN128_Transmit(\u0026data);\n    delay(100);\n    OregonTHN128_Transmit(\u0026data);\n```\n\nAVR targets can replace `delay(100)` with LowPower usage:\n\n```c++\n    LowPower.powerDown(SLEEP_15MS, ADC_OFF, BOD_OFF);\n    LowPower.powerDown(SLEEP_60MS, ADC_OFF, BOD_OFF);\n    LowPower.powerDown(SLEEP_15MS, ADC_OFF, BOD_OFF);\n```\n\n## Saleae Logic Analyzer\n\n![capture](extras/SaleaeLogicAnalyzer/RX_rol7_channel1_temp20.7_lowbat0.png)\n\n[capture](extras/SaleaeLogicAnalyzer/RX_rol7_channel1_temp20.7_lowbat0.sal) from the Oregon THN128 can be opened with \nhttps://www.saleae.com/downloads/.\n\n## Generated Arduino Library Doxygen Documentation\n\n* [Online Doxygen HTML](https://erriez.github.io/ErriezOregonTHN128/index.html)\n* [Doxygen PDF](https://github.com/Erriez/ErriezOregonTHN128/blob/gh-pages/ErriezOregonTHN128.pdf)\n\n## MIT License\n\nThis project is published under [MIT license](https://github.com/Erriez/ErriezOregonTHN128/blob/master/LICENSE)\nwith an additional end user agreement (next section).\n\n## End User Agreement :ukraine:\n\nEnd users shall accept the [End User Agreement](https://github.com/Erriez/ErriezOregonTHN128/blob/master/END_USER_AGREEMENT.md)\nholding export restrictions to Russia to stop the WAR before using this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferriez%2Ferriezoregonthn128","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferriez%2Ferriezoregonthn128","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferriez%2Ferriezoregonthn128/lists"}