What is a 7 Segment LED display
A 7 segment LED display consists of a number of LED's arranged in a way that allows them to easily create characters.
An example of 7 segment displays can be seen in the image on the right. In this case the LED's have a small dot in the bottom right hand corner which can also be turned on and off.
This type of display is great for projects such as making your own voltmeter and ammeter.
You could make a temperature sensor and make this display the temperature.
You could use it with an accelerometer and have it display the distance travelled.
How to control a 7 Segment LED display
The 7 segment display is made up of 7 LED's which can be controlled to create a character. An example of this is shown on the right. In this case there are 8 LED's as there is an extra small dot in the bottom right hand corner of the display.
In my case the LED's share a ground pin meaning that they are controlled by switching at the anode side of the LED's. A character is created by turning on and off the LED's one at a time so fast in the correct sequence that they create a character. This means that only one LED is on at any one time so the limiting resistor for the cathode side can be calculated based on the properties of an individual LED in the display. If you tried to light more than one LED at once you would have some characters much dimmer than others because the resistor at the cathode leg of the LED doesn't change.
In order to switch these LED's on and off fast enough you will need a microcontroller and to protect the microcontroller from currents greater than 20mA you would use PNP transistors to switch the LED's on and off. This can be seen in the Diagram below.
The transistors are only required when the current drawn from the outputs is going to exceed 20mA. However if you choose a resistor values which ensures this then your display will be dimmer but you can reduce you cost by removing the need for the transistors.
Also if your LED's share a positive supply pin instead of a ground pin then you will need to use NPN transistors on each LED.