Design of LED dot matrix handwriting screen based on PIC microcontroller

Publisher:紫菜包饭Latest update time:2010-05-15 Source: 河源职业技术学院Keywords:PIC Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Overview

This paper uses PIC 16F877A microcontroller as the main core control element to design a 32×32 LED dot matrix module writing display screen. It is mainly composed of a light pen module and a dot matrix display module. The light pen module uses the photoelectric characteristics of the photoresistor to realize the micro-brightness detection function. The feedback signal of the light pen is compared by the amplifier LM324 and sent to the microcontroller for processing. The 32×32 dot matrix display module and the driver module are composed of 74HC595 peripheral driver array and 8-bit serial input/output shift register ULN2803A. The light pen scans the display screen to find the coordinate value. The buttons and LED indicator lights can realize writing display functions such as "light up, stroke, reverse display, erase the entire screen, erase strokes, write multiple words in a row, drag objects", etc.

System Overall Structure

This system design includes three parts: PIC 16F877A microcontroller, light pen controller, and dot matrix display screen. The structure of the system is shown in Figure 1.

Figure 1 System structure diagram

The PIC series of single-chip microcomputers are fully integrated mixed-signal system-level chips with a microcontroller core compatible with 8051 and fully compatible with the MCS-51 instruction set. It also integrates analog components and other digital peripherals and functional components commonly used in data acquisition and control systems, and includes A/D and D/A modules, with fast execution speed and powerful functions.

The light pen uses a photoresistor as the sensing device. According to the photoelectric characteristics of the photoresistor, the voltage across the photoresistor changes due to the change of the photoresistor. The voltage value can be compared by the voltage comparator LM324 to output a high/low level. The photoelectric characteristics are nonlinear and easy to adjust, and have good sensitivity.

LED and digital tube are used synchronously. LED is used as function indicator light, and digital tube is used to write the row/column coordinate value of the current light pen on the 32×32 dot matrix LED module.

Analysis and calculation

(1) Light pen selection and parameter design

The dot matrix is ​​scanned with a faint light, and the light pen is used for sensing. When the light pen senses the light, the coordinate value corresponding to the current dot matrix light can be obtained through the program. So as to make corresponding processing. The light pen plays a key role, and its sensing device is a photoresistor. The photoelectric characteristics of the photoresistor are shown in Figure 2.


Figure 2 Photoelectric characteristics of photoresistor

The photoresistor is installed at the tip of the light pen to sense the dot matrix scanning light. The light pen circuit diagram is shown in Figure 3. The circuit compares the positive input/reverse input voltage through the amplifier LM324 and outputs high and low potentials. It is measured that under light conditions, the LM324 output is 0V (RB0) and the voltage across the photoresistor is 0V; when there is no light, the voltage across the photoresistor is 2.8V, and the LM324 output is high potential. The voltage divider formula shows that the RP resistance is 7360Ω. When the light pen receives different light, you only need to adjust the potentiometer and the light pen will work normally. Therefore, in different environments, you only need to adjust the potentiometer and the dot matrix display will work normally.

Figure 3 Light pen circuit diagram

[page]

There is no ready-made 32×32 dot matrix LED module, so 16 8×8 dot matrices are used to form a 32×32 dot matrix. However, this occupies too many microcontroller I/Os, so it must be expanded. The dot matrix operating voltage is around 1.5V~2.2V, and the drive current is relatively large.

(2) Automatic screen brightness adjustment design

The automatic screen brightness adjustment design uses a photoresistor and LM317 (three-terminal adjustable positive voltage regulator) to achieve automatic screen brightness adjustment. According to the principle of the photoelectric characteristics of the photoresistor, the resistance of the photoresistor is different under different light. According to this principle, the photoresistor is connected in parallel with the LM317 adjustable resistor. When the light is different, the LM317 outputs different voltage resistance values. The automatic screen brightness adjustment circuit is shown in Figure 4.



Figure 4 LID screen brightness automatic adjustment circuit

LM317 output voltage calculation, Vout is determined by the total resistance R and current I of the adjustment terminal. The output voltage calculation formula is:
. Here, the voltage is changed by changing the resistance.

(3) Timeout display off power saving design

When the light pen does not touch the display screen for a long time (1~5 minutes can be set by the controller input), it can automatically turn off the display and enter the sleep state. The sleep state is controlled by the program. After the microcontroller enters sleep, the current consumption is less than 2mA.

Circuit Design

(1) Dot matrix display circuit design

The 32×32 dot matrix LED display has 32 ports. If the dot matrix is ​​not driven, it will occupy too many I/Os of the microcontroller. Here, 74HC595 (eight peripheral drive array), ULN2803A (8-bit serial input/output shift register) dot matrix row driver and 74HC154, 7404 dot matrix driver are used. Together, the 32×32 dot matrix LED display drive is completed. The display row driver circuit is shown in Figure 5, and the column driver circuit diagram is shown in Figure 6. Only 8 I/O ports are used, the dot uses less resources, is easy to control, and has a good display effect.


Figure 5 Display screen row drive circuit diagram


Figure 6 Display column drive circuit diagram

(2) Coordinate display circuit design

[page]

According to the requirements of the topic, under the "light up" function, when the light pen touches a point on the display screen, the control board synchronously displays the coordinate value of the point. The coordinate value is a number, so four digital tubes can be used as display devices. 74LS164 is used to expand the I/O port of the microcontroller, and its circuit is shown in Figure 7. There are four sets of such circuits, two of which are used for X-axis display and the other two are used for Y-axis display.


Figure 7 Coordinate display circuit

Software Design

The system has high requirements for software design, and most functions can only be completed by software. Due to the large amount of programs and limited time, C language programming is used, which greatly improves the program portability and programming efficiency. The key point of programming is the micro-brightness scanning and capture storage, as shown in Figure 8.


Figure 8 Scanning and storage flow chart

Summarize

The 32×32 dot matrix LED module writing display screen designed in this paper uses the photoelectric characteristics of photoresistors to detect and sense light, and feeds back to the microcontroller. Through processing, it can realize writing display functions such as "lighting up, swiping, reverse display, erasing the entire screen, erasing strokes, writing multiple words in a row, and dragging objects".

Keywords:PIC Reference address:Design of LED dot matrix handwriting screen based on PIC microcontroller

Previous article:Research on embedded high-resolution VGA image display method
Next article:Design of uncooled infrared focal plane temperature control circuit based on ADN8830

Recommended ReadingLatest update time:2024-11-17 04:50

PIC16-bit microcontroller - Thoroughly understand the clock
I have always been reading reference materials and books when writing programs. This time, I don't have any information about the 16-bit single-chip dsPIC33EP32GP502. So I took the opportunity to study it in depth! First, let's look at the choice of oscillator. First look at the clock block diagram:   We are using
[Microcontroller]
PIC16-bit microcontroller - Thoroughly understand the clock
Discussion on the design problems of LED lighting power supply
Design Questions: The problem of electrolytic capacitor life not matching LED Common reasons and solutions for LED flickering How PWM dimming affects LED life Potential problems in using TRIAC dimming to control LED brightness In the design of LED lighting power supply, there are several
[Power Management]
Several practical experiences of LED lamp driver power supply
In recent years, with the continuous development of LED lamp packaging technology and heat dissipation technology, the stability of LED lamps has reached a relatively good level. The main causes of light decay and color drift are some counterfeit manufacturers' products, which are mainly due to unreasonable heat dissi
[Power Management]
About __CONFIG() configuration bits in PIC
1. Configuration Words       The configuration words of the PIC microcontroller can be defined using the __CONFIG command:     #include          __CONFIG(x); where x is the configuration word and the corresponding configuration descriptor is defined in the header file. For example:         __CONFIG(WDTDIS & XT & UNPRO
[Microcontroller]
Solar powered LED driver circuit diagram
  This figure shows a solar cell powered LED driver applied to an LED emergency flashlight. When the flashlight is off, the LTC3536 is in shutdown mode. Its quiescent current of less than 1μA minimizes the drain on the supercapacitor when ambient light is no longer available. When the LED flashlight is on, the LTC3536
[Power Management]
Solar powered LED driver circuit diagram
Design of high-power LED constant current drive based on DC/DC regulator
The current global energy shortage is becoming increasingly severe, restricting economic development, and energy conservation has become an important issue facing mankind. In the field of lighting, LED lighting products, known as the 4th generation lighting source or green light source, are attracting the attention
[Power Management]
Design of high-power LED constant current drive based on DC/DC regulator
Taiwan's home LED light subsidies prioritize disadvantaged groups
Taiwan's Ministry of Economic Affairs will launch a subsidy program for household LED bulbs. An official from the Ministry of Economic Affairs said yesterday that it is expected to be submitted to the Executive Yuan for approval within this week, with vulnerable groups as priority recipients of the subsidy. Off
[Power Management]
Reducing LED temperature rise - thermal feedback
Using LEDs to achieve high brightness lighting requires using the maximum current allowed by the manufacturer, but the average life of LEDs is highly dependent on the operating temperature. An increase in operating temperature of only 10°C can reduce its life by half. This situation forces designers to reduce the re
[Power Management]
Reducing LED temperature rise - thermal feedback
Latest Security Electronics Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号