Switching Power with 2N2222 Transistor

I have a project where I want to be able to completely power down some accessories when not in use (e.g. SD card, camera module)… My thought was to use a transistor to be able to switch power on and off. I’m using a breadboard, so I wanted to control power to one side of the breadboard for things I wanted switch on/off.

I hooked up a 2N2222 transistor and a simple LED as a test; I can successfully blink the LED. Everything seems fine, I can connect accessories to the +/- rails on the switched side of the breadboard and I see that they get power.

However, my accessories fail to work properly when behind the switched power (even if always on); move the power cables to the unswitched side, they work fine.

I connected my multimeter to the pins on the LED, and I am only showing 3.4 volts; checking power one the other side of the breadboard I get 5v. Does the transistor cause that much of a voltage drop, or am I doing something else wrong?

Thank you for any help.

I don't see a base resistor nor do I see a series LED resistor.

Duue to the size of the pictures it's hard to tell on my phone.

A schematic is better.

Edit

The image loaded! You have 5v going to the collector then out to the emitter! Plenty of voltage loss.

Instead, you should either switch to a pnp or, on your npn...

emitter to ground
Collector to the negative terminal, eg - of your led.

  • of your led to the 5v rail
    Base pin to your button.

The transistor completes the path from the positive terminal of say your led through the collector to the emitter to gnd.

But!

You NEED a resistor (s) on the base and maybe between collector/emitter depending.

Please resample your images to a reasonable size, and post a schematic.

Lack of a base resistor is causing a reduction in voltage output because you are drawing a damaging ammount of current from the arduino pin.

When you switch the power to a deceive you must first remove any output signal you feed to it before the power is removed to prevent latch up.

You need a PNP transistor to do high-side switching, not an NPN transistor.

Without a base resistor something will be damaged. Use 220 ohms to get maximum
switched current.

For a switching transistor the load is on the collector, not the emitter, so the
device can work in the switching region (full saturation). The voltage drop across
the transistor should be 0.2V or less in full saturation.

Thank you for the feedback, I believe I have now created the circuit as instructed…a new circuit drawing is attached. Here is what I am experiencing though: I attach my multimeter to the top rails of the breadboard and I measure about 5V; I can plug in accessories, the voltage stays about the same (4.5 - 5v), accessories work correctly.

When I attach my meter to the bottom power rails (switched side), the voltage starts at about 4.5v, BUT THEN DROPS to around 2.4v when I attach accessories (which needless to stay don’t run work).

What I have tried: I’ve tried two different resistors, and using the two in series together, coming from the Arduino to the transistor. I have also tried measuring the voltage at different points on the power rails.

Please help me, I obviously still have some learning to do…

NOTE: I couldn’t find the exact parts I am using on Fritzing, the transistor is a 2N2222, and I have tried both 10k and 220 ohm resistors.

If you have connected it exactly like that physical layout then you have connected the collector of the transistor to ground instead of +5V.
And also you have connected the 5V sides together instead of the grounds.

Grumpy Mike is this correct now?

A schematic is much clearer.

is this correct now?

No.
The collector is still connected to the ground, if you are switching power it needs to be connected to 5V.

As mentioned before when you do this the maximum voltage you will have is 4.3V, because it will always be 0.7V below the base voltage. You need not the 2n2222 but a PNP transistor and connect the emitter to +5V and the collector to your load.