Using transistors to control 12v source

by STS-135 on Mon Mar 18, 2013 2:17 pm

I'm looking to power a few (large) seven-segment displays off a 12v source and control them with some shift registers connected to an Arduino. I'd planned on just using run of the mill NPN transistors to control the 12v supply to the seven-segment displays from the 5v shift register/Arduino side, however the transistors don't seem to turn on. I've double checked my wiring and made sure the grounds were tied together for the two sources, but still have had no luck. I can, however use the 12v side to trigger the transistor and light the seven-segment display. After looking around it appears the only suggestion is a beefier transistor or optocoupler. The main problem with that is that I have three of the seven-segment displays which would mean 21 of whatever I decide to use and will get pretty expensive for big transistors or optocouplers. I also would like to make as compact a design as possible, as eventually I plan on having a PCB made for this project and size is a key factor in the cost. Any parts recommendations?
STS-135
 
Posts: 4
Joined: Mon Mar 18, 2013 2:10 pm

Re: Using transistors to control 12v source

by Zener on Mon Mar 18, 2013 2:57 pm

It would be best if you can post your schematic so we can see where the trouble might be.
Zener
 
Posts: 2382
Joined: Sat Feb 21, 2009 1:38 am

Re: Using transistors to control 12v source

by EasternStarGeek on Mon Mar 18, 2013 2:58 pm

whoa- hold your horses!

There's no reason why this should be difficult to figure out.

May I respectfully suggest that you post a schematic of exactly what you built? Please specify if the displays are Common Anode or Common Cathode. If you are not sure, then please supply the part number.

We'll get you going, but you have to do your part.

Looking forward to hearing from you.
EasternStarGeek
 
Posts: 306
Joined: Mon Dec 13, 2010 12:39 pm
Location: Upper Eastern Tennessee

Re: Using transistors to control 12v source

by STS-135 on Mon Mar 18, 2013 4:18 pm

Probably should have included more information to start with, but here goes:

The 7-segment display is a common cathode. Its' datasheet can be found at:
http://www.futurlec.com/LED/7SG23011AGpr.shtml

The transistors I'm trying to use are C945 NPN "General Purpose" transistors. Their datasheet is at:
http://www.futurlec.com/Transistors/C945pr.shtml

And here's a quick sketch of the schematic:
Image

I did end up simplifying it down to just the two voltage sources, the transistor, one segment in the display and the current limiting resistor but for some reason still had issues. Powering the transistor off the 12v source for both Collector and Base will work, but not 5v for base with 12v for source.
STS-135
 
Posts: 4
Joined: Mon Mar 18, 2013 2:10 pm

Re: Using transistors to control 12v source

by Zener on Mon Mar 18, 2013 4:54 pm

NPN transistors are for low side switching, not high side. Move the transistor to the low side of the LED/resisitor. Also you need a base resistor for the transistor, like 1K.

So, do this:

Put a 1K resistor in between the Arduino output and the base of the transistor. Hook the emitter to ground. Disconnect the resistor from ground and hook the collector to the side of the resistor that was connected to ground.

Then it should work, I think...
Zener
 
Posts: 2382
Joined: Sat Feb 21, 2009 1:38 am

Re: Using transistors to control 12v source

by uoip on Mon Mar 18, 2013 5:36 pm

I believe Zener is exactly right.

In addition, I'll gently suggest that things will be easier for you if you learn and follow the standard schematic conventions. Ground at bottom, V+ at top, input to the left, output to the right. There may occasionally be good reasons to violate these conventions, but those will be the rare exceptions to the common rule. For a single-transistor used as a switch, I can't think of a reason to violate the convention.

Just as one convenient source of an example, let's look at the 2N3904 data sheet: http://www.fairchildsemi.com/ds/MM/MMBT3904.pdf

Your circuit will look like Figure 1, the Delay and Rise Time equivalent test circuit, except without the capacitor C1. Your high rail voltage will be 12V instead of 3.0V. Your LEDs and current limiting resistor will go in place of the 275 ohm load in the sample circuit. You may use a different size base resistor.

But my point is mainly around the layout of the schematic, not the values of various components. If you look for almost any schematic of an NPN transistor used to switch a large load, it's drawn more-or-less that way. If you had used that convention, and compared your circuit to a sample switching circuit, the difference would have been easier to spot, I believe.
uoip
 
Posts: 127
Joined: Wed Sep 23, 2009 4:48 pm

Re: Using transistors to control 12v source

by BruceF on Mon Mar 18, 2013 6:40 pm

I'd suggest trying something like the following:

Image

You may want to check the value of R3, and note that the decimal point will require a different R3 regardless, but other than that I think the circuit should work fine. I'd suggest chaining two shift registers together; one to loop through the high-side segment drivers one at a time, and the other to drive the low side circuit for any characters that should have that segment lit. I think you should be able to do this whole thing with TO92 packages, so no 'beefy' transistors required.

I used this as an excuse to try out Digikey's online SchemeIt tool, which is fantastic. If they offered PCB layout, I'd never use a regular EDA tool again.
- Bruce
BruceF
 
Posts: 205
Joined: Tue May 03, 2011 3:51 pm

Re: Using transistors to control 12v source

by STS-135 on Mon Mar 18, 2013 7:11 pm

Thanks! I'll try moving the transistor and adding a resistor before the base, I wasn't aware that it could make a difference. As you can probably tell (especially from the way I drew the schematic, haven't quite gotten the hang of that) I'm relatively new to this sort of thing, mostly just messing around. This is the first big project I've undertaken that wasn't a kit or something.

I'll report back with the results.
STS-135
 
Posts: 4
Joined: Mon Mar 18, 2013 2:10 pm

Re: Using transistors to control 12v source

by STS-135 on Mon Mar 18, 2013 10:51 pm

It worked as expected when the transistor was moved to the low side. Didn't realize how much of a hassle the common cathode was going to cause. At any rate, I can more or less say that I understand what wasn't working and why as well as how I'll need to fix it. Thanks for the help, everyone!
STS-135
 
Posts: 4
Joined: Mon Mar 18, 2013 2:10 pm

Re: Using transistors to control 12v source

by BruceF on Mon Mar 18, 2013 11:06 pm

Common cathode is no harder than common anode, and I doubt you'll find a 7 segment display that isn't one or the other. Either way, you need to implement a multiplexing scheme to get multiple characters working. Well, unless you want to repeat the high-side drivers eight times for each character - that would allow you to just ground the low side, at the cost of roughly eight times the parts.

And credit where it's due; I found the source of my high side MOSFET driver schematic.
- Bruce
BruceF
 
Posts: 205
Joined: Tue May 03, 2011 3:51 pm

Re: Using transistors to control 12v source

by EasternStarGeek on Tue Mar 19, 2013 1:31 pm

Here's a little project I did that is somewhat related to your post:

http://easternstargeek.blogspot.com/201 ... ensor.html
EasternStarGeek
 
Posts: 306
Joined: Mon Dec 13, 2010 12:39 pm
Location: Upper Eastern Tennessee