TIP31A Transistor Help

Im working on a project that uses an electronic door lock. It needs a lot more power than an arduino can supply, so my thought was to use a transistor to switch on a second power source solely for the door lock. I've been trying to figure this out for hours. I thought transistors were just electrical switches. Just plug the + side of a battery into the collector of a transistor, and a side of the door lock into the emitter, then connect theother sides of both together.Then send a little electrical signal to the base from arduino. Nothings working. Please help.

picklednerd:
Im working on a project that uses an electronic door lock. It needs a lot more power than an arduino can supply, so my thought was to use a transistor to switch on a second power source solely for the door lock. I've been trying to figure this out for hours. I thought transistors were just electrical switches. Just plug the + side of a battery into the collector of a transistor, and a side of the door lock into the emitter, then connect theother sides of both together.Then send a little electrical signal to the base from arduino. Nothings working. Please help.

A TIP31A is a NPN transistor so is most suitable for 'low side' switching of a device load, meaning you wire as follows. + external voltage to the load (solenoid), other load lead to the collector, emitter wired to external negative terminal, base wired to suitable series resistor (200-1,000 ohms), other side of resistor wired to arduino output pin, and finally a wire from arduino ground pin to external negative terminal (or emitter lead).

That make sense?

Lefty

will you marry me? thank you so much. it works perfectly.

picklednerd:
will you marry me? thank you so much. it works perfectly.

Are you rich? :wink:

When the honeymoon's over, don't forget to connect a diode across the solenoid to catch the back emf when the transistor switches off, otherwise you'll blow the transistor after some number of operations. See Arduino Playground - HomePage. Ignore the bit about using a Schottky diode, an ordinary silicon diode rated at the solenoid current or greater is all you need.

If you ever want to drive high voltage and high amps see about getting a few of these as a sample.
https://ec.irf.com/v6/en/US/adirect/ir?cmd=catProductDetailFrame&productID=IPS1011

I've used them and they're pretty damned tough. It's a low side driver like an NPN transistor but it is designed for logic levels and it's more efficient due to the very low on resistance.

I hadn't come across those before. It looks to be a nice device, although not suited to PWM applications because of the slow switching speed.

retrolefty:
base wired to suitable series resistor (200-1,000 ohms), other side of resistor wired to arduino output pin

Lefty

Sorry I don't mean to hijack your thread, but this question seems relevant to the topic;

How do you choose a resistor value for this application? I have been using N-channel MOSFET for low-side drivers. Example here:

http://www.ladyada.net/products/rgbledstrip/#usage

But they are kind of expensive. I have lots of cheap 2N2222 transistors that I could use for lower current projects, but I'm not sure how to choose the resistor on the base.

but I'm not sure how to choose the resistor on the base.

Choose it such that the base current is at least the collector current divided by the transistor's gain. Then give it a bit of margin by halving it.

How do you choose a resistor value for this application?

technically you can calculate the base resistor value required by determining the load current requirement and then dividing that by the current gain of the transistor, it's beta value, and then size the base resistor to that amount of base current value or more. It's easier to just use a resistor that limits the base current to somewhat less then the maximum arduino output pin current rating (20-30ma) or the maximum base current rating for the transistor being used (whichever is less), that will insure the transistor is turned on to maximum saturation, with minimum voltage drop from emitter to collector.

Lefty

Sometimes its easy just to use something like a tip122
you can get them 50c a piece on ebay and with a hfe(gain) of 1000 because its a darlington pair it is easy to saturate fully like a switch with just a 1k resistor and not bother with the calculations, and its good to 5 amps so it can do a decent amount of work