The design and system realization of the photosensitive screen of a LED dot matrix module

According to the photoelectric effect, the PN junction can change its resistivity under the excitation of light, and the LED is also a PN junction, so can the dot matrix photosensitive screen be completed by using the PN junction characteristics of the LED? After a simple experiment and discussion, we found that the LED itself has a good photosensitive ability, so that the photosensitive screen can fully utilize the photosensitive characteristics of the LED to achieve. This text uses an 8×8 dot matrix screen, combined with C8051F020 single-chip microcomputer to realize a dot matrix screen with photosensitive function, as shown in Figure 1.

According to the photoelectric effect, the PN junction can change its resistivity under the excitation of light, and the LED is also a PN junction, so can the dot matrix photosensitive screen be completed by using the PN junction characteristics of the LED? After a simple experiment and discussion, we found that the LED itself has a good photosensitive ability, so that the photosensitive screen can fully utilize the photosensitive characteristics of the LED to achieve. This text uses an 8×8 dot matrix screen, combined with C8051F020 single-chip microcomputer to realize a dot matrix screen with photosensitive function, as shown in Figure 1.

The design and system realization of the photosensitive screen of a LED dot matrix module
figure 1

1 The photosensitive principle of LED

The LED as a photodetector can work in two detection modes: photovoltaic mode (the device has the ability to generate voltage under the action of external light) and photoconductive mode (the conductivity of the device is controlled by external light). The photovoltage or photocurrent generated in the two detection modes is usually about 1/100~1/10 of the ordinary photodiode, and generally requires the aid of an operational amplifier and ADC. And without the op amp and ADC, can the photocurrent of the LED be obtained? In fact, using the internal capacitance of the diode itself (usually pF), a single-chip microcomputer with a high-impedance tri-state bidirectional I/O port and an internal digital counter can also be used to measure the photoelectric signal it generates. .

The simplest realization method is shown in Figure 2, which is realized by the light delay of a single LED. It consists of an LED connected to two single-chip pins. When the LED emits light, it also measures the incident light intensity and indicates whether it exceeds a pre-defined threshold.

The design and system realization of the photosensitive screen of a LED dot matrix module
figure 2
The design and system realization of the photosensitive screen of a LED dot matrix module
image 3
The design and system realization of the photosensitive screen of a LED dot matrix module
Figure 4

The LED working in the photosensitive mode is quickly charged to +5 V (100 ~ 200 μs). The first step is shown in Figure 3. The charge is maintained by the internal capacitance of the diode (usually 10-15 pF), and then pin P1 is switched to high-impedance input mode (about 1015 Ω impedance). In the second step, under reverse bias conditions, the LED can be equivalent to a parallel connection of a capacitor and a current source iR(Φ). The current in the current source is the photocurrent, which changes with the light intensity Φ, such as As shown in Figure 4, the leakage current iL (small, usually 0.002 pA) of the P1 pin is negligible compared with the 50 pA typical photocurrent iR(Φ) generated by the diode under normal ambient light. After analysis, it can be known that the discharge process of Cr can be expressed by the following formula:

The design and system realization of the photosensitive screen of a LED dot matrix module

If iR(Φ) is a constant, the above formula can become:

The design and system realization of the photosensitive screen of a LED dot matrix module

Equation (2) shows that vP1

The design and system realization of the photosensitive screen of a LED dot matrix module

In the formula, NTCNT represents the integer value counted by the counter, ftclk is the counter clock frequency, Np is the scaling factor, and fclk is the main clock frequency. When the amount of received light increases, Td decreases and the diode discharge speeds up; when the amount of received light decreases, Td increases and the diode discharge slows down. By measuring the on and off time Td of the light emitting diode, the error caused by the ambient light can be found and compensated. Td can be measured by ftclk, and the clock of the single-chip microcomputer can be matched by selecting the appropriate Np.

If the delay time is longer or shorter than the specified threshold Tdcr (critical time), the LED turns on and emits light. For example, by blinking to warn, the third step is shown in Figure 3. Some other pins of the microcontroller can be used as delay output or light control PWM output. Of course, the purpose of measuring the time is to obtain the voltage vP1

2 Realization of the photosensitive screen system

2.1 Device selection

According to the above principles, when the wavelength of the incident light received by the LED is equal to the wavelength of the emitted light, the system has the best sensitivity. Therefore, in order to enhance the sensitivity of the system, an LED with a wavelength similar to that of the dot matrix screen is used to make a light-emitting pen.

For the dot matrix screen, two different sizes of dot matrix modules, TOP23088DU and SZ420788K, were selected for comparison tests. Among them, the pixel LED diameter of the TOP23088DU module is 5 mm, the pixel pitch is 7.62×7 mm, the module size is 60.2×60.2 mm, and the pixel is transparent; the pixel LED diameter of the SZ420788K module is 2 mm, and the pixel pitch is 2.5×7 mm. The module size is 20.2 mm×20.2 mm, and the pixels are semi-transparent. The power-on test of the two modules is a dot matrix module with a common cathode emitting red light.

C8051F020 MCU is a highly integrated mixed-signal system-on-chip with 64 digital I/O pins (C8051F020) organized by 8-bit ports. The low ports (P0, P1, P2, and P3) can be addressed either by bit or byte. The high ports (P4, P5, P6, and P7) can only be addressed by byte. All pins are 5 V tolerant and can be configured as open-drain or push-pull output mode and weak pull-up. The principle block diagram of port I/O unit is shown as in Fig. 5.

The design and system realization of the photosensitive screen of a LED dot matrix module
Figure 5
The design and system realization of the photosensitive screen of a LED dot matrix module
Image 6

It can be seen from the I/O port structure in Figure 5 that C8051F020 has an open-drain state, which can fully meet the measurement requirements. 2.2 System composition Considering the convenience of experiment, using 8×8 dot matrix, and adopting common determinant scanning structure, so a total of 16 I/O ports are required. Here, P0 and P1 ports are considered. The system structure is shown in Figure 6 and Figure 7.

The design and system realization of the photosensitive screen of a LED dot matrix module
Figure 7

2.3 System implementation

According to the above principles, combined with the specific LED dot matrix screen, the program flow is shown in Figure 8.

The design and system realization of the photosensitive screen of a LED dot matrix module
Figure 8

As shown by the matrix in Figure 6, first set all P0 ports to high level, and then set each column to low level, high impedance state, delay, check whether it is low level, and turn on the LED. Operation, complete the operation of the 8×8=64 pixel dot matrix. Because the single-chip microcomputer operates very fast, and the LED roll-off time is very fast, every time an operation is completed, a text picture can be quickly formed on the dot matrix screen.

3 Test results

① Comparison of the two modules, through the comparison test of the two different size dot matrix modules of TOP23088DU and SZ420788K, it is found that the pixels of the TOP23088DU screen are fully transparent pixels, while the SZ420788K is small, but the pixels are semi-transparent pixels. At the same time, the TOP23088DU screen is obviously more sensitive to the incident red light, and the effect is better.

② Function realization: You can use a light pen to scan continuously on the dot matrix screen and observe that the dot matrix is ​​lit; you can write strokes and erase Chinese characters on the dot matrix screen, Display and move them one by one; you can all light up on the screen, Turns off by scanning. Observing with an oscilloscope, the pulse voltage that appears at the moment of charging and discharging can be clearly detected.

Concluding remarks

The LED photosensitive screen described in this article has the advantages of simple operation, low cost and good stability. Using the principle of PN junction photoelectric effect, more functions of ordinary LEDs have been discovered, which can be used as light-emitting elements and photosensitive elements, thus providing a good reference for the development of low-cost multi-functional Display screens. Of course, the photosensitive screen also has some shortcomings. For example, the delay is obvious when there are more dot matrix pixels, and the photosensitive sensitivity and anti-interference performance also need to be further improved.

The Links:   AA104XA02 LMG7401PLFC

Leave a Reply

Your email address will not be published. Required fields are marked *