Logo
Nanxin Power Monitoring Plug (NX-SM400)
BR
Nanxin

Available from:
Aliexpress.com





Manufacturer:
Alibaba.com

Install method:
USB to Serial

GPIO #Component
GPIO00 None
GPIO01 None
GPIO02 None
GPIO03 Button1
GPIO04 BL0937 CF
GPIO05 HLWBL CF1
GPIO09 None
GPIO10 None
GPIO12 HLWBL SEL
GPIO13 Led1
GPIO14 Relay1
GPIO15 None
GPIO16 None
FLAG None
Configuration (old format, will be converted to new template when applied)
{"NAME":"NX-SM400","GPIO":[0,0,0,17,134,132,0,0,130,52,21,0,0],"FLAG":0,"BASE":18}
For more accurate energy consumption measurements this device requires power monitoring calibration.

Recently, some smart plugs with the BR plug type started appearing on AliExpress

Usually, these products don’t have a specific model and make, since they are mostly Tuya whitelables. After searching alot, I’ve found Nanxin NX-SM400 which looks like this one.

Flash Tasmota

Since this model working with the Smart Life app, we know it uses a Tuya chip. To flash Tasmota, we need to us tuya-convert. There’s an excellent tutorial (in pt-BR) by Douglas Baptista that you can use.

Configuring Tasmota

Go to the device’s IP address > Configuration > Configure Other > Template

{"NAME":"NX-SM400","GPIO":[0,0,0,17,134,132,0,0,130,52,21,0,0],"FLAG":0,"BASE":18}

Just paste that line and check Activate

Teardown

To create the template, I had to open the plug up.

If you want to do that, you can use a hot air gun on the bottom part and a flat head screwdriver to force it open. It will probably damage the case a little bit and you will need to glue it shut.

image

image

image

image

The smart plug uses the TYWE2S Tuya chip, which is a ESP8285.

image

The power monitoring chip is the BL0937 It’s pins are connected like this:

BL0937 ESP8285
Pin 6 (CF) GPIO 4
Pin 7 (CF1) GPIO 5
Pin 8 (SEL) GPIO 12

image

The switch and LEDs are on another PCB. They are connected like this:

PCB ESP8285
Red LED GPIO 14 (Same as Relay)
Blue LED GPIO 13
Switch GPIO 3 (Rx)

At last, the Relay is connected to the GPIO14 pin.

Pinout

.