Buy from US Buy from UK Buy from DE Buy from IT Buy from FR Buy from ES ここでご購入を!


In this lesson, we will show how to use the UDP APP to send messages to the NodeMCU and then display those messages on the 1602 I2C LCD display.


An LCD display that can display a max of 16×2 charactors. with the help of the I2C bus convertor and related libraried, you can easily use this module with just 2 wires.

You can find the usage here:×2-i2c-liquidcrystal-displaylcd/


Backlight control and Contrast control

The Backlight can be controlled by the firmware or the on-board jumper:

 lcd.backlight();// light on the backlight;
 lcd.noBacklight();//light off the backligth;


There is a jumper on the board, if you take away this jumper , the backlight will aways be off, and you can also control the LCD contrast by adjust the on-board potentiometer.





NodeMCU I2C 1602 LCD

Upload Sketch

Connect the NodeMCU to computer via USB cable,open this sketch by using Arduino IDE(Version1.6.4+):

Edit the code to fit your own WiFi settings as following operations:

1)Hotspot Configration:

#define STASSID “***” // replace *** with your wifi SSID
#define STAPSK “***” // replace *** with your wifi password

Find above code line,put your own ssid and password on there.

2)UDP local port Settings

         // Define the local port to listen on
        unsigned int localPort = 8888;

We use the “8888” local port here, you can change it to your own local port.

3)I2C Adress Settings
// LCD I2C address settings
LiquidCrystal_I2C lcd(0x27, 16, 2);

*0x27 means the address of this 1602 I2C LCD display,different LCD may have different address,if the LCD do not work,please connect your 1602 I2C LCD dispaly to your NodeMCU,then upload below code to your NodeMCU, you will get the I2C address from the Serial Monitor.You can check following link to get more usages about 1602 I2C LCD dispaly  :×2-i2c-liquidcrystal-displaylcd/.

Boad & COM Port Settings

After do that,choose the coresponding board type and port type as below,then upload the sketch to the NodeMCU.

UDP APP Settings

About how to config the UDP APP,check this link.

Click the setting icon button, you can see the UDP configration page.

UDP response  text display enable button – Enable text play

UDP Incoming Port – Use this port to listen for and accept connections from remote UDP devices, keep the default setting : “8888”

IP address – Change it to your NodeMCU IP address, you can get the IP address from the Arduino IDE Serial Monitor after the code upload down.

Port – Keep the default setting: “8888”.

Keep other settings as default, then click the “Save” button to save your changes.

Running Result

Upload the code to Arduino board, then open Arduino Serial monitor in the upper right corner.

Now please set your Baud Rate to 115200

you will see NodeMCU IP address as following:

Above result shows your NodeMCU IP address (in my case, , NodeMCU is now waiting for UDP message at port 8888.

Onece the upload done,if wifi hotspot name and password setting is ok and UDP APP is connected, open the Serial Monitor,  when you tap any button on the APP, you can see a corresponding value:

At the same time, you can see the LCD display as below:

This means that if you click on any key on the app, the remote LCD will display the character represented by each key.

Want to send more? You need to change the string of the corresponding key in the settings page of the app.

Here we take the “F1” button as an example, it stands for “F” by default, in the first step, we replace the “F” with the string we want to transmit, I filled in “Close the door! “. The second step is to click the “Save” button at the bottom right corner of the APP settings page to save our changes.

After we finish this, we return to the APP operation page and click the “F1” button again we can see “Close the door!” successfully displayed on the LCD screen.

Here are some common backlight-related issues and solutions when using an I2C 1602 LCD:

  1. Backlight not turned on: If the backlight is not turned on, the text on the display may be hard to read or not visible at all. Check the code or adjust the backlight settings on the module.
  2. Backlight too bright or too dim: If the backlight is too bright or too dim, the text on the display may be hard to read or not visible at all. Adjust the backlight intensity on the module or in the code.
  3. Backlight flickering: If the backlight is flickering, it may be due to an unstable power supply or a faulty module. Check the wiring and power supply, or try a different module.
  4. Backlight not working after power up: If the backlight does not turn on after powering up, it may be due to a delay issue in the code. Add a delay to allow time for the module to initialize properly before turning on the backlight.
  5. Backlight consumes too much power: If the backlight is consuming too much power, it may drain the battery or cause other issues. Try using a more efficient backlight or reducing the brightness to conserve power.


Question A:  Why could OSOYOO IoT APP send message to NodeMCU without even knowing the IP address of the NodeMCU board?
Answer: OSOYOO IoT APP default destination IP is which is a broadcasting IP address. Broadcasting means the APP will send UDP message to all device in the same Wifi Network.
So even we does not set destination IP address to NodeMCU IP, the NodeMCU can still get the message.

Question B: Can I change default sending destination IP address and Port Number of OSOYOO IoT APP?
Yes, you can! Osoyoo IoT APP default IP is and default port is 8888. If you need to change the setting,
For example, if our NodeMCU IP address is, here is the guide to make the change to
1)Open APP, click Setting button in upper right corner
2)Use to replace default IP
3)keep default port number 8888 without changing
4)turn on the switch of UDP Response Text Display
5)Click Save button to save the changes you just made
6)Click Back Arrow to go back APP front UI

Question A:  I touched my APP F1 key, but no message shows up in my NodeMCU serial monitor, why?
Sometimes, broadcasting IP Address is not necessarily, for example, if your NodeMCU IP address is, the wifi network broadcasting IP is
So we suggest you replace with to match your network mask of NodeMCU. Of course you can directly set the NodeMCU IP as destination in APP.

If you have any question about OSOYOO NodeMCU products, feel free to contact us or leave comments here.

In next lesson, we will connect a sensor to NodeMCU and send sensor data to  another  Moquitto client software.

We need to note that ESP8266 is a 2.4G WiFi device, please access to 2.4G network, if you access to a 5G router network, there will be a prompt that the network connection is not successful.

Part details

SKU:  DKRK100700

No. Picture Name Link
1 OSOYOO NodeMCU Board
2 Servo motor
3 LED(6 x White, 6 x Red, 6 x Yellow, 6x Green)
4 Buzzer
5 Push Button and Hats
6 Photoresistor(Light Sensor)
7 potentiometer(10K lohm adjustable resistor)
8 I2C LCD Display (16*2)
9  Temperature&Humidity Sensor Module
10 Resistors
11 4*AA Battery Holder Box
12 4 LED Module
13 Stepper Motor +Bridge
14 Tlit Sensor Module
15 Infrared Remote Controller