LEDS controlled with raspberry pi 3 and external batttery

Thread Starter

ElPapu666

Joined Jul 5, 2017
19
Hi.
I am doing a remote control nightvision camera rover and everything has been fine until I have found my self in a problem that might be very stupid but I have been stuck with it for 2 days.
I want a circuit that detects if a GPIO pin is on the battery powers the LEDS so they turn on.
The circuit I have been trying(with a bunch of variations) is this:

GPIO connected to 2N2222 NPN transistor so it can activate the flow of current.
Positive side of 10000 mAh battery (with an output of 5 volts and 1 Ampere) connected to the collector of the transistor.
Emitter of the transistor connected to the positive side of an array of 21 IR LEDS connected int three parallel rows each of one with 7 LEDS.
And the negative side of the LEDS connected to GROUND, (The battery's ground and the Raspberry Pi 3's ground).

Can´t figure out whats wrong.

Thanks for any help.

Miguel.
 

bertus

Joined Apr 5, 2008
22,278
Hello,

You will have to many leds in a row.
IR leds have a forward voltage between 1.2 and 1.6 Volts.
Look in the datasheet of the used leds for the expected forward voltage.
When you have 7 in series, you will need 8.4 to 11.2 Volts for a string.

Also it is not wise to have the leds in the emmitor of the transistor.
Use less leds in a string on the collector of the transistor.
Also use current limiting resistors in each string of leds and on the base of the transistor.

For more info take a look at this post:
https://forum.allaboutcircuits.com/threads/leds-555s-flashers-and-light-chasers.19075/#post-117646

Bertus
 

Thread Starter

ElPapu666

Joined Jul 5, 2017
19
Ok, gonna try thanks

Tried what you said with only one led to see if current was passing and it didn't work
 
Last edited by a moderator:

Thread Starter

ElPapu666

Joined Jul 5, 2017
19
This is the schematic

Screen Shot 2017-12-12 at 8.30.26 PM.png

Oh yeah, and forgot to put it in that schematic but there is a 220 ohm resistor from the GPIO to the transistor base
 
Last edited by a moderator:

bertus

Joined Apr 5, 2008
22,278
Hello,

Both the led and the transistor are connected to the + of the battery.
The emmitor of the transistor should go to the - of the battery and the - of the Rpi.

Bertus
 

Thread Starter

ElPapu666

Joined Jul 5, 2017
19
Yeah, sorry thats wrong in the sketch too, I did it a bit quickly and messed that up. In real life it is connected properly as you say
 

bertus

Joined Apr 5, 2008
22,278
Hello,

How did you check that the led is coming on?
Did you measure the current?
Can you measure the base current?

Bertus
 

Thread Starter

ElPapu666

Joined Jul 5, 2017
19
I'v discovered that the problem might be the battery for as it works with the rsapberry pi's 5 volts but not with the battery's
But, I can charge anything with the battery.
So I can´t find the problem.
 

Thread Starter

ElPapu666

Joined Jul 5, 2017
19
Yes, I did

I think that the battery isn't delibering any power at all, but I dont know why

Ok, certainly the problem is the battery, because it works but it has to have something that doesnt let electricity out if it doesnt detect a circuit she likes.
Because with a barttery of an other brand it works

Do you know a way to mod the battery so it doesn't do that?
 
Last edited by a moderator:

bertus

Joined Apr 5, 2008
22,278
Hello,

Measure the battery voltage when connected.
See if there is a difference in voltage when the led is on or off.
If there is a large change in the voltage, the battery is likely bad.

Bertus
 

philba

Joined Aug 17, 2017
959
Generally when you have a circuit that isn't working, decompose it into small units. Try cutting the RasPi out of the equation. Check to see that the battery+resistor+LED is working. Then check the transistor+bat+R+LED (directly wire the base to the correct voltage). Have you verified that the GPIO pin on the RasPi is actually getting turned on?

Also, that fritzing diagram doesn't give me confidence in your wiring - I'm not going to look up pin outs and such.
 

Thread Starter

ElPapu666

Joined Jul 5, 2017
19
The circuit works with a different battery, it just fails with that one in particular

I think a fuse turns off when you connect the circuit with the battery I've told you about because you can see the led turn on and off for a moment

Any idea on how to take out the fuse???

Or any other battery that is big and will work?
 
Top