Научная статья на тему 'READ DATA FROM KEYBOARD AND OUTPUT TO LCD DISPLAY. CODE LOCK'

READ DATA FROM KEYBOARD AND OUTPUT TO LCD DISPLAY. CODE LOCK Текст научной статьи по специальности «Электротехника, электронная техника, информационные технологии»

CC BY
21
0
i Надоели баннеры? Вы всегда можете отключить рекламу.
Ключевые слова
LCD / HD44780 / Arduino / Circuit) / String / Genuino / I2C / IIC / LED / USB / SDA / SCL / motherboard / Sketch / digitalWrite.

Аннотация научной статьи по электротехнике, электронной технике, информационным технологиям, автор научной работы — Mustfoyev A.A.

This article discusses the code lock that shows how to read data from the keyboard and output it to the LCD screen, and the connection schemes are explained and analyzed in detail.

i Надоели баннеры? Вы всегда можете отключить рекламу.
iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.
i Надоели баннеры? Вы всегда можете отключить рекламу.

Текст научной работы на тему «READ DATA FROM KEYBOARD AND OUTPUT TO LCD DISPLAY. CODE LOCK»

Mustfoyev A.A. teacher

Jizzakh Polytechnic Institute

READ DATA FROM KEYBOARD AND OUTPUT TO LCD DISPLAY.

CODE LOCK

Abstract. This article discusses the code lock that shows how to read data from the keyboard and output it to the LCD screen, and the connection schemes are explained and analyzed in detail.

Keywords: LCD, HD44780, Arduino, Circuit), String, Genuino, I2C, IIC, LED, USB, SDA, SCL, motherboard, Sketch, digitalWrite.

Theoretical information.

Liquid crystal indicators display symbolic information. They come in different sizes, measured by the number and length of lines displayed. Some are backlit and allow you to choose the color of the characters and background. Any LCD display with a compatible HD44780 interface and a 5V backlight supply voltage can work with the Arduino board.

The I2C adapter module allows you to connect the character display to the Arduino board with just two signal wires. I2C is a serial two-wire bus for communicating integrated circuits inside electronic devices, known as I 2 C or IIC (Inter-Integrated Circuit). I2C was developed by Philips in the early 1980s. as a simple 8-bit bus for internal communication between circuits in control electronics, such as computers on motherboards, mobile phones, etc. (Fig. 1.).

vcc -

1.5k

SDA -

SCL -

GND -

Arduino Device 1 Device 2

(Master) (Slave) (Slave)

Fig.1. Connecting multiple devices to the I2C bus

The LCD display with I2C adapter module connects to the Arduino with only 4 wires - 2 data wires and 2 power wires.

To connect an LCD display to Arduino via an I2C adapter module, you need to install the LiquidCrystal_I2C library. You also need the Wire library, which is already installed in the standard Arduino IDE program.

LiquidCrystal_I2C library.

The LiquidCrystal_I2C(address, col, row) constructor creates an object of type LiquidCrystal_I2C and accepts display connection parameters (I2C address and display size).

Connecting a membrane matrix keyboard to Arduino.

In projects where the Arduino is not connected to a computer, you need to be able to enter characters, such as a secret code, to turn something on or off. To do this, use a matrix keyboard (Fig.2).

Fig.2. Matrix keyboard and its circuit

The advantage of such a keyboard is that only 8 contacts are used instead of 16. For this circuit to work, it is necessary to use dynamic polling of the keyboard. The Arduino pins to which keyboard pins 1, 2, 3 and 4 are connected are configured as digital outputs, and the pins to which 5, 6, 7 and 8 are connected are configured as inputs. A low voltage level is alternately applied to pins 1, 2, 3 and 4 of the keyboard. Pins 5, 6, 7 and 8 are under control. If the button is pressed, the Arduino will determine which line the 42nd level was low on and from which line it came to the Arduino input. As a result, the coordinates of the button will be determined.

Description of the demo program.

The program simulates the operation of a combination lock. Connected to Arduino:

- 4x4 matrix keyboard, the pins of which are connected to digital pins 2..9 of Arduino;

- 16x2 LCD display, which is connected to Arduino via an I2C adapter board; The riser board is connected to pins A4 (SDA) and A5 (SCL) of the Arduino;

- two LEDs LED1 and LED2, which are connected to pins 10 and 11 of the Arduino, respectively.

After power is applied, the Arduino LED lights up, which is connected incircuit to pin 13. The INSERT CODE message is displayed on the top line of the

display, and the cursor blinks on the bottom line. LED1 also lights up, which means the lock is closed.

After dialing the code 8888, press # to confirm. If the code is entered correctly, the message CORRECT CODE is displayed on the top line of the display and the entered code on the bottom line is deleted. The lock opens for 4 seconds, which means that LED1 goes out and LED2 lights up. After 4 seconds, LED2 goes out and LED1 lights up again. The INSERT CODE message appears again on the top line of the display. If the code is entered incorrectly, INCORRECT CODE appears on the top line of the display. After 2 seconds, the information on the display is cleared and the INSERT CODE message appears again. After the third attempt, a 30-second countdown begins: INCORRECT CODE is displayed on the top line of the display, and WAIT XX SECONDS is displayed on the bottom line, where XX seconds (30, 29, 28, etc.). After 30 seconds have passed, the message INSERT CODE is displayed on the top line of the display and the program again waits for the code to be entered.

References:

1. Irisboyev, F. (2022). ELEKTR SIGNALLAR KUCHAYTIRGICHLARI VA ULARNING ASOSIY PARAMETRLARI VA TAVSIFLARI. Евразийский журнал академических исследований, 2(11), 190-193.

2. Ирисбоев, Ф. Б., Эшонкулов, А. А. У., & Исломов, М. Х. У. (2022). ПОКАЗАТЕЛИ МНОГОКАСКАДНЫХ УСИЛИТЕЛЕЙ. Universum: технические науки, (11-3 (104)), 5-8.

3. Irisboyev, F. (2022). YARIMO 'TKAZGICHLI MODDALARDAN TAYYORLANADIGAN KUCHAYTIRGICHLARNING PARAMETRLARI VA XARAKTERISTIKALARI. Science and innovation, 1(A6), 374-377.

4. Irisboyev, F. (2022). YARIMO 'TKAZGICHLI MODDALARDAN TAYYORLANADIGAN KUCHAYTIRGICHLARNING PARAMETRLARI VA XARAKTERISTIKALARI. Science and innovation, 1(A6), 374-377.

5. Islomov, M. (2023). CALCULATION OF SIGNAL DISPERSION IN OPTICAL FIBER. Modern Science and Research, 2(10), 127-129.

6. Irisboyev, F. B. (2023). THE INPUTS ARE ON INSERTED SILICON NON-BALANCED PROCESSES. НАНОЭЛЕКТРОНИКИ », 1(A4), 241.

7. Boymirzayevich, I. F., & Husniddin o'g'li, I. M. (2023). INTERNET QURILMALARINING IOT (INTERNET OF THINGS) TEXNOLOGIYALARI.

8. Islomov, M. (2023). CALCULATION OF SIGNAL DISPERSION IN OPTICAL FIBER. Modern Science and Research, 2(10), 127-129.

9. Islomov, M., & Irisboyev, F. (2023). IOT (INTERNET OF THINGS) TECHNOLOGIES OF INTERNET DEVICES. Modern Science and Research, 2(9), 220-223. Retrieved from https://inlibrary.uz/index.php/science-research/article/view/24108

10. Islomov, M.. (2023). CALCULATION OF SIGNAL DISPERSION IN OPTICAL FIBER. Modern Science and Research, 2(10), 127-129. Retrieved from https://inlibrary.uz/index.php/science-research/article/view/25048

11. J.T., M., & F.B., I. (2023). VOLATILE AND NON-VOLATILE MEMORY DEVICES. Modern Science and Research, 2(10), 116-119.

12. Ж. Метинкулов ИСПОЛЬЗОВАНИЕ МИКРОКОНТРОЛЛЕРОВ ДЛЯ УПРАВЛЕНИЯ НАПРЯЖЕНИЕМ Vol. SCIENTIFIC APPROACH TO THE MODERN EDUCATION SYSTEM 2 No. 20 (2023):

13. Mirzaev, U., Abdullaev, E., Kholdarov, B., Mamatkulov, B., & Mustafoev, A. (2023). Development of a mathematical model for the analysis of different load modes of operation of induction motors. In E3S Web of Conferences (Vol. 461, p. 01075). EDP Sciences

i Надоели баннеры? Вы всегда можете отключить рекламу.