Need to control 12vDC with a 5vDC signal...

I thought I had my whole project figured out, and now im super stuck.

I have a 5vDC signal (arduino high or low) that I need to control 12vDC.

E.G. If Arduino pin 13 goes HIGH I need it to turn the 12vDC ON. When it goes low I need it to turn the 12vDC OFF.

I thought I could do this with a TIP31AG transistor, and now that I am getting the whole thing soldered up I am relizing that I cant.

I had the TIP31AG set up with pin1 = GND pin2= 5v signal , but then if I apply 12DC to pin3 it is always ON.

Im so close!

I been soldering for the last 4 hours

Can someone please help a newb get pointed in the correct direction?

Thanks

Search the board for logic level MOSFET.

Here is a data sheet for a TIP31C ( Intelligent Power and Sensing Technologies | onsemi ). It shows that the base is terminal 1, collector 2 and emitter is pin 3. The base should wire to a series resistor and the other end of the resistor to the Arduino output pin. The emitter should wire to the Arduino ground and the ground of the +12vdc power source. The collector should wire to the device you are trying to control (lamp, motor, etc). The other end of the device should wire to the +12vdc voltage.

The missing information needed to properly size the resistor and to ensure that the TIP31C can indeed work for you, is how much current is your controlled device drawing?

Lefty

This shows how to figure out the base resistor when using an NPN transistor as a switch.
http://www.kpsec.freeuk.com/trancirc.htm

An NPN transistor needs to be on the low (ground) side of the load. PNP on the high side.

pingy

I need to control 12vDC

You don't mention how much current is used in the 12v circuit...however...

A TIP31 is an NPN transistor, and in this configuration you can only switch the GROUND of the 12v system on/off. This may not suit your application.

There are some other methods available...
Let us know how much current you are wanting to control.

Mark

Thank you for the out pouring of really helpful responses!

I noticed that I did indeed forget to mention the current.

The current is 450mA.

I gather a TIP31 being a NPN should be placed on the ground side of my project.

Any help with if/and/or/what resistor would be needed for the 450mA?

The data sheet shows the TIP31C has a current gain of over 100 at that collector current so a series resistor of 500 ohms or so should work fine. Resistor wires between output pin and base terminal of the transistor.

Lefty

lefty
Unless my old memory fails me this line is the gain
(It doesn't copy too well..sorry)

hFE

  • DC Current Gain MIN MAX
    VCE = 4V, IC = 1A 25
    VCE = 4V, IC = 3A 10 50

It also indicates there could be a voltage drop of 4v across it.

pingy
At the worst case you might need an extra transistor to drive it.

Cheers
Mark

I was looking at the gain chart (fig 1) in this datasheet:

http://www.fairchildsemi.com/ds/TI/TIP31A.pdf

The 4v is the test voltage for the specs published. You are going to be operating in a saturated on, fully off switching application.

I think you will find that the 500 ohm resistor will work fine and that the transistor has more then enough gain to switch 1/2 amp load.

Lefty

retrolefty
I did say it was old memory...
Thanks for reminding me that that was the voltage used, not the recorded voltage. ::slight_smile:

Your sheet does give the same gain, but additionally it specifies that the Base saturation is 375mA and that the C-E voltage should be 1.2v.

Hopefully pingy has overcome his frustration with soldering, and is able to measure if the switching is working now....

If all else fails pingy, often using a resistor power supply and a light bulb, without anything else quickly proves that damn transistor you sweated with for hours has had the smoke released earlier, and is nothing more than carbon, housed in a small plastic container with legs. :cry:
Mark

/me has the soldering iron smoking as we speak.

...results yet to be seen.

I have a 510ohms resistor...if my references serve me correctly.

Color = Green Brown Brown.

This should work just fine in place of the 500 ohm resister lefty referenced correct?

Correct, I bet anything from 200 to 750 ohms would probably work.

Lefty

Ok lefty, I must call upon your thus far infinite wisdom one more time.

I am 98% there....really I am.

I got everything wired per the suggestions here and it all is working great..EXCEPT!

When the Arduino triggers the TIP31 my multimeter is going from 0 to only 2.x vDC ..its not making it anywhere close to 12vDC.

Now the only thing I can thing of is the fact that I put a 12vDC zener diode in series to stop the voltage spiking back. Could I have put the diode in backwards?
is this a valid symptom of having the diode in backwards?

...I thought I checked and double checked and triple checked how to install the diode, but at this point all I can think of is that it is backwards.

....thoughts?

http://picasaweb.google.com/lh/photo/XU2gPup6iwLzzdFNNJanYg?feat=directlink

current flow top to bottom of the pic.
out the bottom of the transistor and into the zener diode, then out to my 12vDC load. Diode band is at the bottom.

I sure would like to see a drawing showing the whole thing including the load, however I can say I don't think I have ever seen a series zener diode used in a simple 12vdc switching application, did you copy that from some design, or are you winging it. :wink:

You normally see a reversed biased diode wired right across any inductive load device terminals (motor, solenoid, relay coil, etc). So try it without a the zener and try and provide a drawing (even a picture of a hand written schematic) if you want more comments.

When the Arduino triggers the TIP31 my multimeter is going from 0 to only 2.x vDC ..its not making it anywhere close to 12vDC.

Again without a drawing it's hard to see what and where you are measuring. You say it works, does that mean the load turns on and off under Arduino control?

Lefty

I finally got it all working!

It was indeed my zener diode was in the wrong way (wish i would have tested it before I soldered it down) oh well I guess 2 come in a pack for a reason!

thank you so much to everyone for your input (even that guy that just told me "search MOSFET") :slight_smile:

Especially you lefty. I do not know why this transistor has me so confused but it really did.

Thank you for taking the time.

....this is gonna be awesome

In series with what? You need a standard high speed diode for a motor or relay to quench the voltage spike from the collapse of the coil energy.

Thanks again to everyone that helped answer some questions for me.
A special thanks to lefty!

Here is my finished project. [ch8730]