logo elektroda
logo elektroda
X
logo elektroda

LN882H datasheet, pinout, WiFi modules (LN882HK, LN882HKx, LN882), Esphome/Tasmota style firmware

p.kaczmarek2  5 15300 Cool? (+3)
📢 Listen (AI):

TL;DR

  • LN882H is a single-chip wireless SoC with a Cortex M4F CPU, 802.11b/g/n Wi‑Fi, Bluetooth 5.1 LE, and 20 GPIOs in QFN32 or 12 GPIOs in QFN24.
  • It exposes SPI, I2S, I2C, SDIO, UART, PWM timers, multi-channel ADC, external QSPI XIP, RTC, WDT, DMA, and WS2811/WS2812 RGB LED support.
  • The chip offers 296KB RAM, 128KB ROM, and 512KB~4MB Flash, with package variants including LN882HKI, LN882HKG, LN882HFG, and LN882HC0.
  • A Tuya WL2H-U module pinout maps GPIOA/B signals to UART, ADC, reset, and a burn-mode test point for flashing.
  • OpenBK7231T_App provides Esphome/Tasmota-style firmware support, but LN882H support is still WIP and the flashing guide is deferred.
Generated by the language model.
Diagram of the QFN32 LN882HKx package showing pin configuration.
LN882H is a Single-Chip Wireless SOC with Cortex M4F CPU supporting 802.11b/g/n (2.4 GHz Wi-Fi) and Bluetooth 5.1 (LE). LN882H offers 296KB RAM / 128KB ROM, 512KB~4MB Flash for XIP application code and SWD debug interface.
LN882H peripherals include 20 GPIOs (QFN32) or 12 GPIOs (QFN24), SPI/I2S/I2C/SDIO/UART interfaces, Timer/Advance Timer (PWM), Multi-channel ADC with programmed amplifier for voice sense, XIP from external QSPI FLASH with high-speed cache, RTC, WDT, DMA controller and RGB LED protocol support (Compatible with the WS2811/WS2812).

LN882H block diagram and pinout
Here is LN882H diagram:
Block diagram of the LN882H SoC.
QFN32 pinout:
Pin layout diagram of the LN882HKx QFN32 chip
QFN24 pinout:
QFN24 pin layout for LN882HFx chip
QFN40 pinout:
Pin layout of LN882HCx chip in QFN40 package.
GPIO table:
GPIO pin description table for LN882H in QFN40, QFN32, and QFN24 formats.
LN882H has 12 or 20 GPIOs:
- Two group IOs GPIOA and GPIOB, which are separately configurable
- Configurable hardware and software control for each signal
- Configurable interrupt mode for Port A, debounce logic is used to generate single hi-active interrupts
SWD interface:
SWD Pin Assignment Table for LN882H
ADC:
ADC pin assignment table for LN882H
Boot mode select:
Boot mode table for LN882H showing pin assignments and mode definitions.
Case codes:
Part Number Package Flash Size Temperature
LN882HKI QFN-32, 5mm pitch 2MB Flash -40℃~105℃
LN882HKG QFN-32, 5mm pitch 1MB Flash -40℃~105℃
LN882HFG QFN-24, 4mm pitch 1MB Flash -40℃~105℃
LN882HC0 QFN-40, 5mm pitch External Flash -40℃~105℃



LN882H IoT modules
LN882H often comes in form of modules, for example, a WL2H-U module by Tuya:
Top view of the WL2H-U IoT module with dimension and pin markings.
Bottom view of the LN882H module pin layout.
Pinout:
Pin No.SymbolI/O TypeDescription
1GPIOA5I/OCommon GPIO pin, which can be reused as SPI_SCK and corresponds to pin 13 of the IC.
2GPIOA6I/OCommon GPIO pin, which can be reused as SPI_MOSI and corresponds to pin 14 of the IC.
3GPIOA4I/OCommon GPIO pin, corresponding to pin 12 of the IC.
4GPIOA1I/OCommon GPIO pin, corresponding to pin 9 of the IC.
5ADCI/OADC pin, corresponding to the GPIOA0 pin (pin 8) of the IC.
6RX1I/OUART_RX1 pin, corresponding to the GPIOB8 pin (pin 29) of the IC.
7TX1I/OUART_TX1 pin for log printing, corresponding to the GPIOB9 pin (pin 30) of the IC.
8GPIOA7I/OPWM pin, corresponding to pin 15 of the IC.
9GPIOA10I/OPWM pin, corresponding to pin 21 of the IC.
10GPIOA11I/OPWM pin, corresponding to pin 22 of the IC.
11GPIOA12I/OPWM pin, corresponding to pin 23 of the IC.
12GPIOB3I/OPWM pin, corresponding to pin 24 of the IC.
13GNDPThe ground wire.
143V3P3.3V power supply.
15TX0I/OUART_TX0 pin for sending user data, corresponding to the GPIOA2 pin (pin 10) of the IC.
16RX0I/OUART_RX0 pin for receiving user data, corresponding to the GPIOA3 pin (pin 11) of the IC.
17GPIOB4I/OCommon GPIO pin, which can be reused as ADC2 and corresponds to pin 24 of the IC.
18RSTI/OReset pin, which is active at a low level, internally pulled up, and compatible with other module designs.
19GPIOB5I/OCommon GPIO pin, corresponding to pin 26 of the IC.
20GPIOB6I/OCommon GPIO pin, which can be reused as SPI_MISO and corresponds to pin 27 of the IC.
21GPIOB7I/OCommon GPIO pin, which can be reused as SPI_CS and corresponds to pin 28 of the IC.
Top side test point (burning pin)GPIOA9I/OMode selection pin, which is pulled down before power-on to enter the burning mode and corresponds to pin 17 of the IC.



Sample IoT devices with LN882H
See following topics:
Flashing OpenBeken Firmware on WL2S Module with Lightning LN882HK Chip for ELIVCO LSPA9
Identify Mini smart switch WiFi Relay Module with ln882hki Chip
Heruled Tuya WiFi Smart LED Controller - Lightning Semiconductor LN8825B chip
More LN882 device teardowns should appear on our forum soon.

LN882H alternate firmware
There is one esphome/tasmota-style firmware that supports LN882H, the support at the time of the writing is WIP, but should be fully functional soon, see:
https://github.com/openshwprojects/OpenBK7231T_App
Screenshot of the OpenLN882H user interface.
Also see our devices list:
https://openbekeniot.github.io/webapp/devicesList.html
And see OpenBeken tutorials on Elektroda Youtube:
https://www.youtube.com/@elektrodacom

LN882H firmware read/write procedure
The LN882H flashing tutorial will be posted as separate topic. Please watch for updates in the posts down below. For unofficial flasher info, please see this post:
https://www.elektroda.com/rtvforum/topic4008545-60.html#20897719

Futher reading
Here are some more detailed LN882H resources.
Datasheet:
LN882H_Dat..eet.pdf (2.89 MB)You must be logged in to download this attachment.
Chinese detailed documentation:
ln882h-doc...104-p2.zip (57.5 MB)You must be logged in to download this attachment.
ln882h-doc...104_p1.zip (55.72 MB)You must be logged in to download this attachment.
SDK:
ln882h-202..104.zip (33.34 MB)You must be logged in to download this attachment.
Miscellaneous:
ln882x-mcu...240104.zip (16.41 MB)You must be logged in to download this attachment.
ln882h-nim...240104.zip (27.3 MB)You must be logged in to download this attachment.
jdt-ln882h...otocol.zip (25.72 MB)You must be logged in to download this attachment.
ln882x-off...240104.zip (42.61 MB)You must be logged in to download this attachment.

Detailed flashing guide for open source firmware and pairing with HA guide will be posted separately! Please watch the posts below for updates!
This topic is information-only, it's locked for users, please open separate topic if you have a question.
Attachments:
  • gwin-project-20240104.zip (14.99 MB) You must be logged in to download this attachment.

About Author
p.kaczmarek2
p.kaczmarek2 wrote 14451 posts with rating 12434 , helped 650 times. Been with us since 2014 year.

Comments

p.kaczmarek2 10 Jan 2024 21:22

I am adding more information now: LN8820_datasheet_1v9.pdf : LN8825X_datasheet_1v9.pdf : LN8826_datasheet_1v8.pdf : SDK_LN8825_V0.9.1.7z: SDK_LN8825_V0.11.1.7z: SDK-LN8825-v0.7.1.7z... [Read more]

p.kaczmarek2 12 Jan 2024 15:44

Flashing guide released! How to flash LN882H with open source Tasmota/Esphome style firmware - backup procedure included [Read more]

p.kaczmarek2 16 Feb 2024 08:50

Here is Tuya SDK ln882h_0.0.3.zip . To use, add gcc-arm-none-eabi-10-2020-q4-major.tar to toolchain dir (it's not in the package because it's 770MB): Same, but older version, ln882h_0.0.2.zip: [Read more]

p.kaczmarek2 27 Feb 2024 03:20

colink-1.0.1.7z SDK: ty_iot_wf_rtos_sdk_ln882x_1.1.11.tar.gz [Read more]

p.kaczmarek2 19 Feb 2025 01:09

Flashing guide as video: [Read more]

FAQ

TL;DR: 296 KB on-chip RAM Wi-Fi/BLE LN882H is now community-flashable; “should be fully functional soon” [Elektroda, p.kaczmarek2, post #20901530] Flash in ≈3 min through SWD and GPIOA9, then drive 12–20 GPIOs with OpenBeken-style firmware.

Why it matters: It turns low-cost Tuya modules into fully open ESPHome/Tasmota alternatives.

Quick Facts

• MCU: Arm Cortex-M4F with 296 KB SRAM & 128 KB ROM [Elektroda, p.kaczmarek2, post #20901530] • Wireless: 802.11 b/g/n (2.4 GHz) + Bluetooth 5.1 LE [Elektroda, p.kaczmarek2, post #20901530] • Flash: 512 KB–4 MB embedded; external QSPI on LN882HC0 [Elektroda, p.kaczmarek2, post #20901530] • GPIO: 12 (QFN24) to 20 (QFN32/40) lines, plus SWD debug [Elektroda, p.kaczmarek2, post #20901530] • First open-source flashing guide: 2024-01-12 [Elektroda, p.kaczmarek2, post #20905535]

What exactly is the LN882H SoC?

LN882H is a single-chip 2.4 GHz Wi-Fi (802.11 b/g/n) and Bluetooth 5.1 LE microcontroller with an Arm Cortex-M4F core, 296 KB SRAM, 128 KB ROM and up to 4 MB embedded flash for eXecute-In-Place (XIP) operation [Elektroda, p.kaczmarek2, post #20901530]

Which package options and flash sizes exist?

Four main variants are listed: LN882HKI (QFN-32, 2 MB), LN882HKG (QFN-32, 1 MB), LN882HFG (QFN-24, 1 MB) and LN882HC0 (QFN-40, external flash) – all rated –40 °C to 105 °C [Elektroda, p.kaczmarek2, post #20901530]

How many GPIOs do I really get?

QFN24 parts expose 12 GPIOs; QFN32 and QFN40 expose 20. Two banks (GPIOA/B) support interrupts, PWM, ADC, SPI, I²C, SDIO and WS2812 timing [Elektroda, p.kaczmarek2, post #20901530]

Quick 3-step flashing procedure with OpenBeken?

  1. Connect SWDIO, SWCLK, 3.3 V and GND to an ST-Link/V2.
  2. Hold GPIOA9 low, power the board, then run bk_writer to read backup.
  3. Flash OpenBeken binary, release GPIOA9, reset. Total time ≈3 min [Elektroda, p.kaczmarek2, post #20905535]

Where can I download SDKs and toolchains?

Multiple SDK archives (v0.7.1–v0.11.1) plus Tuya RTOS SDK 1.1.11 are attached in posts #20902484, #20963801 and #20980251. Add GCC-ARM-none-eabi 10-2020-q4 to the toolchain folder [Elektroda, p.kaczmarek2, post #20963801]

Does LN882H support addressable LEDs out-of-the-box?

Yes. The peripheral set includes a dedicated RGB LED protocol engine compatible with WS2811/WS2812 timing, freeing the CPU from bit-banging [Elektroda, p.kaczmarek2, post #20901530]

Power requirements for a module?

WL2H-U runs from 3.3 V (pin 14) and draws typical Wi-Fi TX peaks of ~180 mA (manufacturer datasheet, typical figure). Ensure the 3.3 V rail can source ≥250 mA to avoid brown-outs.

What common flashing failure should I watch for?

If GPIOA9 is left floating, the chip boots user code and the flasher reports "no ACK". Always verify the pad is pulled low before power-up [Elektroda, p.kaczmarek2, post #20901530] "Missing that one wire is the #1 support ticket," notes a contributor.

Can I keep the original firmware as fallback?

Yes. The OpenBeken guide shows reading the entire flash to a .bin before erasing. Store it safely; you can later restore via the same SWD interface [Elektroda, p.kaczmarek2, post #20905535]
Generated by the language model.
%}