1
\$\begingroup\$

My background: I have years of programming experience and have always tinkered. I own lots of components and have built many a circuit using various arduino microcontrollers (love them because I can program them with a C-like language!) - but most of the circuits I've built are because I've read a tutorial, and followed directions, without ever understanding the "why's" of most parts I've used.

I understand the concept of a relay - powering a relay to switch a higher load power on and off (basically).

I also understand that transistors can be used in the same manner, although to a much much lower degree. I've used them in the past, again, following online instructions or guidance.

This time, I'm trying to go off script and build something of my own, and I'm at the limit of my knowledge and googling has stopped giving me any help. So, asking some experts here to help me understand the how and why of it.

I'm building a toy for my cat, which uses an accelerometer to detect when it's moving, and after it stops moving for a bit, it is to jump/move/shake/etc. I'm doing this by mounting a shaft inside a cylinder, and using a tiny DC motor, spinning the guts of the toy around the shaft, in essence, turning the entire thing into a large vibro motor, but with much more force.

The motor pulls 60mA of power, more than my Arduino can supply on one pin. So it needs to be switched. Enter my transistor.

The code runs, the toy "works" but the motor never turns on. No tools to build a schematic so here's a simple text breakdown of the circuit.

Powered by 2 LR44 button batteries, about 3.1v total. Battery + goes to power arduino, and splits off into the collector of the NPN 2222 transistor.

The emitter of the transistor connects to the motor. The other lead of the motor to the battery ground.

Arduino pin 3 connects to the base of the transistor, with a 560ohm resistor in between. I found that value using an online calculator.

When the arduino turns on pin 3, testing with my multimeter, this is what I find:

Voltage into collector from battery is about 3v

Voltage into the resistor leading to the transistor base is about 3v.

Voltage out the resistor into the transistor base is about 1v, which seems right given the numbers the calculator was showing me and the saturation voltage for the transistor.

Voltage out of the emitter to the motor? I see it peak at about .3 volts or so. The motor is only on for short bursts (half a second) so its hard to say, but it's obviously nowhere near enough to run the motor.

What am I doing wrong? I'm obviously fundamentally misunderstanding something and either have something wired wrong, or... I don't know?

Thanks for any input.

\$\endgroup\$
  • 5
    \$\begingroup\$ FYI : There is a built in schematic tool, press Ctrl-M to access it. \$\endgroup\$ – Tyler Mar 29 '16 at 14:40
  • 2
    \$\begingroup\$ Always connect your load between collector and VCC unless you are trying to build an Emitter-Follower (Google it). Also do not forget about diode across the motor (anode to the collector). \$\endgroup\$ – G36 Mar 29 '16 at 14:50
1
\$\begingroup\$

I think I know your issue. If I understand correctly, this is your current circuit:

schematic

simulate this circuit – Schematic created using CircuitLab

The problem is that there is a PN junction between the base and the emitter of an NPN transistor. This means your maximum \$V_{BE}\$ is approximately 0.7V. So, if you measure 1V at the base, there must be approximately 0.3V at the emitter. The way to fix this is to move the transistor so it is low side switching like so:

schematic

simulate this circuit

It is important to keep in mind that BJTs are current-controlled current-sources. That is to say, a collector current flows based on a multiple of the base current, \$i_B\$. This multiple is called the current gain, and it's symbol is usually \$\beta\$ (Greek letter Beta). In this case (assuming your arduino is outputting 3.1V), you will get a base current of \$\frac{3.1V-0.7V}{1000\Omega}=2.5mA\$.

Since the typical current gain of a 2222 is about 150 (I'm going off memory here), you can rest assured that the collector current will be high enough, as the transistor will be fully in saturation (all the way on).

\$\endgroup\$
  • 1
    \$\begingroup\$ The diode across the motor prevents the transistor from being subjected to high voltage transients when you turn the transistor off, and the inductance of the motor tries to maintain current through the motor. \$\endgroup\$ – Ecnerwal Mar 29 '16 at 15:08
  • \$\begingroup\$ You say it's required, but in Roker's answer, Spehro says in a comment it's not. Who is correct? \$\endgroup\$ – MichaelK Apr 1 '16 at 11:08
  • 1
    \$\begingroup\$ @mKafarowski I would say it's always better to add some protection, even if you don't think you'll need it. \$\endgroup\$ – Brendan Simpson Apr 1 '16 at 13:25
0
\$\begingroup\$

Am I right to assume that this is your circuit:

schematic

simulate this circuit – Schematic created using CircuitLab?

I see a couple of problems with this aproach. First, it is very unusual to put an inductive load on the emmiter. Why? Because the transistor is turned on when voltage between base and emmiter is bigger than 0.6V. With the inductive load turned on and off you'll have some weird voltage outbursts at the emmiter and your Vbe won't be exactly 0.6V.

Better aproach is to put the motor between collector and voltage source. Emmiter should be on the GND and Vbe would then be either 0 or 0.6V. This is how you'd control your motor's current.

Second part, protection. This voltage outbursts might be so high to damage your transistor or even Arduino. That's why you'd need to put some protection diode, parallel to the motor, with cathode towards voltage source.

schematic

simulate this circuit

\$\endgroup\$
  • \$\begingroup\$ The diode is not required for an emitter follower/inductive load. It is required when the load is in the collector circuit. \$\endgroup\$ – Spehro Pefhany Mar 29 '16 at 16:12
  • \$\begingroup\$ @Spehro Pefhany, why? I don't see any significant difference... \$\endgroup\$ – Circuit fantasist Aug 18 '17 at 13:47
  • \$\begingroup\$ @Circuitfantasist When the low side (inductance in collector) switch turns off the collector voltage rises until the collector-base junction breaks down, which is not good. When the emitter follower switch turns off, the emitter voltage drops until the emitter-base junction becomes forward biased and then the transistor turns on again until the energy is absorbed by the transistor and coil resistance. There must be a path from the emitter to ground- either a resistor, a push-pull output or the protection circuit in an AtMega output (which has been unpowered). \$\endgroup\$ – Spehro Pefhany Aug 18 '17 at 14:24
  • \$\begingroup\$ @Circuitfantasist The one case in which you could get into trouble is if the base becomes totally disconnected after it was powered. This is not really a concern in a commercial design, but for a hobbyist putting a diode across the coil will protect against that and will only have minimal disadvantages. \$\endgroup\$ – Spehro Pefhany Aug 18 '17 at 14:26
  • \$\begingroup\$ A very interesting situation, @Spehro Pefhany... I have a good intuitive understanding of the inductor behavior and imagine your explanation very well... So what happens - we turn off the coil from the side of the base... but it continues keeping on from the side of the emitter... \$\endgroup\$ – Circuit fantasist Aug 18 '17 at 17:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.