0% found this document useful (0 votes)
11 views4 pages

Transistor Switching & 7-Segment Display Lab

Uploaded by

mosesdayes
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views4 pages

Transistor Switching & 7-Segment Display Lab

Uploaded by

mosesdayes
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Circuits & Electronics Lab 3

Using a transistor as a
switch & 7 segment display

Part A: Learning to use a transistor as a switch:


A bipolar junction transistor (BJT) has three terminals: Base, Collector and Emitter. The
arrangement on a transistor varies depending on the construction of the case. A datasheet
gives the correct configuration.

A transistor can be used to interface a low power circuit and a high current/power one.
The base can be supplied with a small current that in turn causes a much larger current to
flow through the collector (and emitter)

Make use of a breadboard power supply if available or the Analog Discovery, to provide a
steady power source to your circuit. You may use a dedicated (bench) power supply, set to
5V.

1. Locate the 2N3904 transistor (also the 2N3906, and TIP31C, TIP32C) from your kit.
Download its datasheet to learn about its pin out configuration. A number of devices
in the kit look similar, some are MOSFETs, etc. Do not assume. Read the part number
on the case. Also look up the pin out. Sketch the pinout.
2. Light up an LED using a resistor that is 1K or more in series with the LED. Note how
bright the LED is. The longer leg of the LED is the anode (+ve). Choose a higher
resistor value to see its effect. Warning: do not connect a diode to 5V directly. It will
be damaged.
3. Light up the LED using a transistor. Note the brightness of the LED again. How do they
compare? Use both the NPN and PNP (one at a time) to turn on the LED. Place the LED
in the collector circuit. Note that you will have to orient the LED differently for the two
transistors. Demonstrate lighting an LED with a transistor.

Circuits (you do not actually need a switch)

NPN: PNP PNP


Part B
Lighting a 7 segment display.
Make use of the Arduino/ESP32 to light the 7 segment display.
a. Sketch the pin out of the 7-segment display.
b. Write code (as a function) to light up each of the 7 segments in turn (optional –
helps you understand).
c. Write code to display from 0 to 9, A, C, E and F one digit every 1000 ms. Demo this
for a grade (do not look online for help; talk it through with your lab-mate).

Part C: Learning about Multiplexing


Make use of Arduino/ESP32 to light the 4-digit 7-segment display or the 3-digit 7-segment
display (depending on which one you have). You can combine the 2-digit displays to make a 4-
digit display.

In multiplexing, multiple signals are combined into one signal over a shared medium.

a. Write code (as another function) to light up one digit of the seven segment display in
sequence. Demo the numbers 9, 7, 5 and 3 (or all of the previous digits if desired).
9 in the first digit position, then 7 in the second digit position, then 5 in the third
digit position and 3 in the fourth digit position.
Note that you need to enable one of the digits eg D1, in order to show only D1.
Explore if a digit (e.g. D1) is enabled with a LOW signal or a HIGH signal. When D2 is
enabled, the second digit will show up instead. Note: show only one digit at a time.
The others should be off. It will be helpful to write a function for each digit.

If you have the 3-digit display, demo the numbers 9, 7 and 5.

b. Write code (as another function) to display at the same time, the ‘numbers’ 0000,
0702, 2025, 1024, 2048, 4096, 2027, and SIGn if you have the 4-digit display. (Display
each ‘number’ only momentarily eg 1000ms). Demo this.

If you have the 3-digit display, display at the same time, the ‘numbers’ 000, 702,
025, 024, 048, 096, 027, and IGn (Display each ‘number’ only momentarily eg
1000ms). Demo this.

It might be helpful to write a function for each number which calls the function for
each required digit that make up that number. Think of how to get the digits to
display at the same time. (A loop? Another method?)
(Figure it out yourselves. Do not look online for help. Talk it through with your lab-
mate).
Common cathode connection

Common anode connection

You might also like