Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Light emitting Diode (LED Lamp) on single Chip Microcomputer

2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

LED (light-emitting diode), that is, light-emitting diodes, commonly known as LED lights, it has many varieties, parameters are not the opposite, we use popular chip light-emitting diodes on the board. The positive guide voltage of this kind of diode is between 1.8V and 2.2V, and the task current is usually between 1mA~20mA. Therefore, when the current changes between 1mA~5mA, as the current passing through the LED becomes larger and larger, our naked eye will clearly feel that the small light is getting brighter and brighter, while when the current changes from 5mA~20mA to 5mA~20mA, the brightness change of the LED we see is not too clear. When the current exceeds the 20mA, the LED is at risk of burnout, and the higher the current, the faster it burns out. Therefore, in the process of application, we should pay special attention to its design requirements on current parameters.

So let's take a look at the design and use of this light-emitting diode on the pioneer board. First of all, look at figure 2-3.

Figure 2-3 USB interface circuit

Figure 2-3 shows the USB interface circuit on our pioneer board. Through the USB line, the computer supplies power to our pioneer board, downloads the program and completes the communication between the computer and the pioneer board. As can be seen from the figure, there are 6 interfaces in the USB seat, of which 2 and 3 are data communication pins, 1 and 4 are power pins, 1 is VCC positive power supply, and 4 is GND ground wire. 5 feet and 6 feet are the shell, we connected directly to the GND, everyone can take a look at the six pins of the USB seat on the opening board.

We are now mainly looking at 1-pin VCC and 4-pin GND. 1 foot through F1 (self-recovery fuse) to the right, in the normal task, the fuse can be directly counted as a wire, so both of you are USB power + 5V, self-recovery fuse influence is, when you have a short circuit in the middle of the circuit, the fuse will actively cut off the circuit, maintain the opening board and the computer's USB port, when the circuit is normal, the fuse will resume dredging, the normal task.

There are two divergent paths on the right. The first one is connected to a 470uF capacitor at + 5V and GND. The capacitor is isolated from DC, so there is no current in this misalignment. We will introduce it again in the next lesson. In this class, we will focus on the second wrong path. Let's pick out the second wrong road as shown in figure 2-4.

Figure 2-4 LED small lamp circuit (1)

Light-emitting diodes are one of the diodes, so like popular diodes, this diode also has cathodes and anodes, which are habitually called negative and positive electrodes. The LED in the truth diagram is so easy to see on the circuit that it must be connected correctly in order to have a smooth current to let the LED light shine. It was just mentioned that the voltage of the VCC we connected to is 5V, and the voltage drop of the LED itself is about 2V, so the voltage accepted on the left R34 resistor is 3V. So now we ask that if the current scale is 1~20mA, we can calculate the lower limit and lower limit of this resistance according to Ohm's law R=U/I.

When the current is 1mA, the resistance is 3K; when the current is 20mA, the resistance is 150ohms, that is, the scale of R34 is 150,3K ohms. The change of the resistance value can directly limit the current of the whole path, so this resistance is usually called the "current limiting resistor". In figure 2-3, the resistance we use is 1K. I think everyone can easily figure out the size of the diverted current, and the influence of this light-emitting diode here is used as a power guide light. Use USB cable to connect the pioneer board with the computer, and this light will come on.

Similarly, we add another LED10 LED in the center of the switch at the back of the board, which lights up when we turn on the switch, as shown in figure 2-5.

Figure 2-5 USB power supply circuit

Everyone pays attention to the fact that there is only one switch here, but it is 2-way, and the 2-way switch and parallel connection can be better guaranteed to supply more current to the later stage. Capacitors C19 and C10 are mostly isolated and disconnected from DC, which affects our introduction to next class, where everyone can be negligent.

So next, let's stop the change in figure 2-4, lose the GND on the right, and change it to a single-chip microcomputer IO port, as shown in figure 2-6.

Figure 2-6 LED small Lamp Circuit (2)

Figure 2-4 because the power supply has a voltage difference from the positive pole to the negative pole, and the circuit is on, there will be a smooth current, and the LED lamp will glow directly because of the smooth current. We connect the original GND on the right to the P0.0 pin of the single-chip microcomputer, so if we input a low level, that is, the same voltage of 0V as the GND, we can make the LED lights glow as in figure 2-4.

Because our single-chip microcomputer can be programmed to master, we can let P0.0 this pin input a high level, that is, the same 5V voltage as VCC, then at this time, the voltage of the left VCC is different from that of the right P0.0, then there is no voltage difference, there is no voltage difference, there is no current, there is no current LED light will not be lit, that is, it will be in the extinguishing state. Next, we will use our programming software to master the lights on and off.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report