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".
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
- Popular Resources
- Popular amplifiers
- Mir T527 series core board, high-performance vehicle video surveillance, departmental standard all-in-one solution
- Akamai Expands Control Over Media Platforms with New Video Workflow Capabilities
- Tsinghua Unigroup launches the world's first open architecture security chip E450R, which has obtained the National Security Level 2 Certification
- Pickering exhibits a variety of modular signal switches and simulation solutions at the Defense Electronics Show
- Parker Hannifin Launches Service Master COMPACT Measuring Device for Field Monitoring and Diagnostics
- Connection and distance: A new trend in security cameras - Wi-Fi HaLow brings longer transmission distance and lower power consumption
- Smartway made a strong appearance at the 2023 CPSE Expo with a number of blockbuster products
- Dual-wheel drive, Intellifusion launches 12TOPS edge vision SoC
- Toyota receives Japanese administrative guidance due to information leakage case involving 2.41 million pieces of user data
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- Taiwan Sun Yat-sen University ASIC Laboratory Comprehensive Script Tutorial
- The ESP32 branch of MicroPython now has dual cores enabled by default
- Vehicle CAN bus network data access and research significance
- Zigbee Topology Research
- Hands-on learning about power supply Season 1: DIY small fan, fan all summer long!
- Watch the HDC 2022 developer keynote speech, and a demo will explain the Hongmeng development kit
- How to express the volt-ampere characteristic of a field effect tube? Take an N-channel junction field effect tube as an example to explain the output characteristics of the field effect tube.
- The motor drive waveform has burrs
- I'm almost driven crazy by AD
- stm32 pwm fails after eight cycles