# Need urgent help on Digital Logic - super basic question

I have a scheme requiring 9v, which runs perfectly. However I want to trigger it on and off with my arduino.
I used an NPN transistor (bd139, then 13001), by conecting the base to a digitalWrite(HIGH) on a pin, the collector to the just to test things and nothing happened, the scheme didnt work.

The Arduino Basic Connections on this website may be useful.

...R

BD139 needs quite a bit of base current to turn fully on, like 50mA.

That's more than an arduino pin can supply.
Can you use a more efficient part?
I don't see a spec on 13001.

can you recommend me parts to get/look for?

EDIT: multimeter readings indicate 80-85mA output from the arduino

Is the "9V" Gnd connected to Arduino Gnd.? Are you 100% certain about all of your wirning?
There needs to be a base resistor to limit (control) the base current [not shown].
You should be able to conduct a "low level" test using an LED and resistor (1kohm) in place of your device ("load").

Noooooo
That readings implies you are connecting a meter set to current measurement between the Arduino pin and ground. You are shorting out the Arduino like this and will damage the output pin.

menace4:
EDIT: multimeter readings indicate 80-85mA output from the arduino

1. The 9V GND is connected to the - of a battery currently, and the PWR is the +;
2. What kind of a resistor should I use for the base, how can I calculate it?
3. I have attached a scheme with a diode, which still does not work.

What kind of a resistor should I use for the base,

You don't mean kind, because the kind you would use is carbon composite or metal film.
You mean value.
It depends on the other components in the circuit which you have not assigned values to.

Basically it is base current = collector current * transistor gain.

Base resistor = (5V -0.7) / base current.

Then for good measure use half the calculated value.

Grumpy_Mike:
You don't mean kind, because the kind you would use is carbon composite or metal film.
You mean value.
It depends on the other components in the circuit which you have not assigned values to.

Basically it is base current = collector current * transistor gain.

Base resistor = (5V -0.7) / base current.

Then for good measure use half the calculated value.

I guess 100 ohms are good enough?

menace4:
I guess 100 ohms are good enough?

No, that would exceed the output current limit of 20mA.

so 10 or 50?

menace4:
so 10 or 50?

No, that would be 10 or 2 times worse, respectively. You can't go below 220 ohms.

I’m guessing blindly, because following the calculations it should have been 50 (?)
However, that’s derailing the thread, while there is a problem at hand.

What do I need to do to use the arduino as a switch for the 9v circuit?

Derailing? Were we not talking about biasing a switching transistor?

I'm guessing blindly, because following the calculations it should have been 50 (?)

In which case it is too much gain for a single transistor and you should be using a FET.

On the other hand you could have screwed up so show your working.

What do I need to do to use the arduino as a switch for the 9v circuit?

We are telling you, you need to use a transistor or a FET.

``````base current = collector current * transistor gain
``````
``````=>Base resistor = (4.5V -0.7) / 4.5
``````

so I should use a 1k ohm?

menace4:

``````base current = collector current * transistor gain
``````

4.5 = 9 * 0,5

What do those numbers represent, please?

4.5 = 9 * 0,5

It is rubbish.
A transistor with a gain of a half! never seen such a thing.

4.5 Amps base current - just plane silly
9 Amps of collector current - plausible but I suspect it is wrong as it looks suspiciously like you are mixing up current and voltage.

You were given all the answers you need in reply #7. Your circuit is plausible, it just needs an appropriate valued base resistor, and a transistor that has enough gain and current handling capability.

Edit:
Collector current: 1,4A (9v battery)
Base current: 80mA

transistor gain = 0.057