HS-F21P LCD1602 liquid crystal display module

HS-F21P LCD1602 liquid crystal display module

1. Introduction

Due to the limited number of I/O ports on Arduino, directly using the I/O ports to drive an LCD1602 would consume a lot of I/O port resources and is not conducive to connecting more other devices. The IIC LCD1602 adapter board can greatly reduce the number of IO interfaces needed. The original 1602 screen requires 7 IO ports to drive, and our developed module can save you 5 IO ports. For Arduino beginners, you don't have to worry about the complicated liquid crystal driver circuit connections. You can simply display data with just two wires, and can also connect with other IIC devices to easily achieve data recording and display.

2. Schematic

LCD1602 liquid crystal screen-HS-F21P schematicClick to view

Module Parameters

Pin Name

description

GND

GND (Negative Power Input)

VCC

VCC (Positive Power Input)

SDA

Bidirectional Data Communication Pin

SCL

Clock Signal Communication Pin

  • Power Supply Voltage: 3.3V / 5V

  • Connection Method: PH2.0 4P Terminal

  • Installation method: Screw fixed

4, Circuit Board Size

5 of Arduino IDE example program

Attention: If prompted with an error message about the library file during program upload, please import the library file first!
Arduino IDE Library Download and Import Tutorial:
Click to view

Example program (UNO development board):

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C mylcd(0x27,16,2);

void setup(){
  mylcd.init();
  mylcd.backlight();
  mylcd.clear();
  mylcd.setCursor(1-1, 1-1);
  mylcd.print("Hello STEM");
}

void loop(){
  //液晶显示屏接开发板IIC
  //scl引脚接开发板scl(A5),SDA引脚接开发板SDA(A4);
  //用螺丝刀调节液晶显示屏显示字体亮度。

}

6, ESP32 Python Example (for Mixly IDE/Misashi)

Choose the development board Python ESP32 [ESP32 Generic(4MB)] and upload in code mode

Attention: If prompted with an error message about the library file during program upload, please import the library file first!
Download and import tutorial for Mixly IDE ESP32 library:
Click to view

Example program (ESP32-Python):

import machine
import i2clcd


i2c_extend = machine.SoftI2C(scl = machine.Pin(22), sda = machine.Pin(21), freq = 100000)
lcd = i2clcd.LCD(i2c_extend,lcd_width=16,i2c_addr=0x27)
lcd.shows('Mixly',column = 0,line = 0,center = True)

7, Mixly example program (graphical language)

Example program (UNO development board):Click to download
Attention: If prompted with an error message about the library file during program upload, please import the library file first!
Download and import tutorial of Mixly IDE Arduino library:Click to view

Example Program (ESP32 Development Board):Click to download
Attention: If prompted with an error message about the library file during program upload, please import the library file first!
Download and import tutorial for Mixly IDE ESP32 library:
Click to view

8. Setting up the Test Environment

Set up Arduino test environment

Prepare Components:

  • HELLO STEM UNO R3 DEVELOPMENT BOARD *1

  • HELLO STEM UNO R3 P EXPANSION BOARD *1

  • USB TYPE-C DATA CABLE *1

  • LCD1602 display screen (HS-F21L) *1

  • PH2.0 4P double-ended terminal line *1 piece or PH2.0 4p terminal to DuPont wire *1 piece

Circuit wiring diagram:

ESP32 Test Environment Setup

Prepare Components:Pending update...

Circuit wiring diagram:Pending update...

9, Video tutorial

Video tutorial:Click to view

10, Test conclusion

Arduino UNO test results:

In the case of the LCD1602 liquid crystal display module being powered on, if the display does not show any text or image, use a small screwdriver to gently adjust the potentiometer of the LCD1602 liquid crystal display module until the set text and image appear.

Display the text and images set in our program on the LCD1602 liquid crystal display.

ESP32 Test Results:

Pending update...