Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Transistor and PIC16F877

Status
Not open for further replies.

AliRazoR

Advanced Member level 4
Full Member level 1
Joined
Oct 26, 2010
Messages
115
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,298
Activity points
2,001
Hi,

Can we use any transistor to drive 7 segment with PIC16F877?
i am using BC107 NPN transistor to turn on and off seven segment but i do not know the reason!

for example is it possible to use 2N3904?

thanks in advance.
 

Hi,
You can use any transistor as long as it can take the maximum current load. eg. If each segment takes 10mA current, the max possible current is 70 mA. So, you can use any transistor here that can handle more than 70mA safely (continuous current). The real world current varies depending on the size and type of 7-segment used. So, make sure you know the current rating.

You can use 2N3904 for standard-sized 7-segment.

Hope this helps.
Tahmid.
 
you'll have less problems if you put IC like ULN2003 (7 transistors) or ULN2803 (8 transistors). Of course you can use any NPN or PNP (depend on the schematic) transistor until it has enough Icc_max
 
any PNP or NPN transistor you can used, it depends what type of 7-segment you are using.
common cathode or common anode.
also 7-segment is used individually or in multiplex mode.
if you are using one or two 7-segment display even you can hook up them with the
micro controllers. normal micro-controllers can sink 30 mili amp at-least.
 
Hi,
I think, what AliRazoR meant is, drive the individual segments through the PIC and the common anode/cathode with a PNP/NPN transistor. That's why the maximum current is so important, as this transistor will take the total current load (of all the segments), maxed when segment displays "8" (when all 7 segments are on and consuming power).

Hope this helps.
Tahmid.
 
thanks for answers.
i am using common cathode seven segment so i connect the collector to the seven segment.what if i use common anode?
 

Hi,
If you use common anode, you use a PNP transistor, connect emitter to +5v and collector to common anode. Connect a 10k resistor from base to emitter and drive the transistor with 0 to turn on. You can also use an NPN transistor at the cost of 0.6v drop, so you'll get 4.4v at the output instead of 5v when using PNP.

If you use NPN, then, connect collector to +5v and emitter to common anode and drive the transistor with 1 to turn on.

Hope this helps.
Tahmid.

---------- Post added at 23:33 ---------- Previous post was at 23:24 ----------

micro controllers. normal micro-controllers can sink 30 mili amp at-least.

I wouldn't generalize like that. While most PICs can handle 25mA and AVRs upto 40mA (I'm not sure about 8051, I think its 20mA), the PIC24F can handle max 18mA, 24H and dsPIC33 can handle max 4mA. So, I'd say, that you should consider each microcontroller family individually.

Hope this helps.
Tahmid.
 
you'll have less problems if you put IC like ULN2003 (7 transistors) or ULN2803 (8 transistors). Of course you can use any NPN or PNP (depend on the schematic) transistor until it has enough Icc_max

ULN2003 has an open collector output, it can only sink current (ground the output) so it can only be used with common cathode displays.
In your case it can work because you are using common cathode but since ULN2003 has 7 outputs it would be a waste if you are using only using one or two displays.

Alex
 

While most PICs can handle 25mA and AVRs upto 40mA (I'm not sure about 8051, I think its 20mA), the PIC24F can handle max 18mA, 24H and dsPIC33 can handle max 4mA. So, I'd say, that you should consider each microcontroller family individually.

Also note that these are maximum ratings and the output voltage is much lower when you source that current, take a look below for the output voltage of AVR and PIC (PIC16F87) depending on the current.

avr.jpgpic.jpg

Alex
 

If you use common cathod then you need NPN (sourcing) drivers like UDN2891A or UDN2892A -
Notice that all talks about how much one uP pin can sink are not very precise - in case you want to light all 7 segments and each uP pin can source 30mA you'll find out that the Vcc pin on the uP should withstand 210mA (which is not true in more of the cases). My point is - the main limit is not how much current can source each uP pin but how much current can pass through the Vcc pin!
 

If you use common cathod then you need NPN (sourcing) drivers like UDN2891A or UDN2892A -

The devices that you describe (2981/2982) are sourcing current, that is they provide the positive voltage not the ground.
These can be used with a common anode display to provide the positive supply,
for a common cathode display you need a device like ULN2003 to sink current and provide the gnd.

Alex
 

Hi Alexan_e, the driver type depends on what we're talking. If we talk about single LED digit the common cathod is connected permanently to GND - **broken link removed**. I got feeling that he was speaking about single LED display. In case he needs to drive several digits than you're right - ULN2003 will drive the common cooo cathodes to GND and 2981 will drive the segments.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top