logo elektroda
logo elektroda
X
logo elektroda

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

p.kaczmarek2 
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:

Chinese detailed documentation:


SDK:

Miscellaneous:





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.

About Author
p.kaczmarek2
p.kaczmarek2 wrote 11944 posts with rating 9991 , helped 572 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]

%}