In this article, we will tell you how to operate a 7-segment display (7SD in short) with a microcontroller. There are two (perhaps more) options to do this. The first is to connect the 7SD directly to the output ports of the microcontroller as shown in the picture above. This may cause a port shortage in large projects. As a second way to avoid this; We can run it by connecting a decoder to the 7SD. We will show both for you.
Let’s say you have a lamp. You want to change the brightness of it. You can use a set resistor to do this, but this will convert some of the electricity into heat. Instead, how to turn on and off the lamp at regular intervals. If we turn the lamp on and off too quickly, it will come to us as if the lamp never went out. Because the off time is shorter than the extinguishing time. If we increase the switch-off time slightly, we will see as the lamp brightness is decreasing. This mechanism is called PWM (Pulse Width Modulation).