Go Down

Topic: arduino transistor help (Read 1 time) previous topic - next topic

krazyhorze

Hey guys, I'm doing this project and need some help.
I need to power 4 LEDs in a series which requires a total of 12VDC. But the arduino atmega328 only gives out around 4 -5V which is not enough to power it. I'm trying to use a 3904 NPN transistor as a amplifier to power the 4 LEDs but doesn't seem to work. What should I do? I don't know if I wire it correctly..

AWOL

Quote
but doesn't seem to work.... I don't know if I wire it correctly..

If you tell us how you wired it, maybe we could help...
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

krazyhorze

I connected the Collector to a 12V.  Connect the Base with the output pin from the atmega with 1k Ohm. Connect the Emitter to the positive of the LEDs series and negative to the ground. When I used my multimeter to test the voltages that the Emitter is giving out, its only 4 - 5 V, not 12V...

AWOL

Quote
Connect the Emitter to the positive of the LEDs series and negative to the ground

The 2n3904 is an NPN, isn't it?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

retrolefty

Quote
I don't know if I wire it correctly..


Neither do we without a drawing showing what you are trying. Keep in mind that a transistor cannot create voltage, it can only control it. If your LED string requires +12vdc then you will of course first require a 12vdc voltage source. The transistor can then be wired up to switch the +12vdc current flow on and off via the arduino output pin wired to the base of the transistor with a suitable series current limiting resistor.


Lefty


retrolefty


I connected the Collector to a 12V.  Connect the Base with the output pin from the atmega with 1k Ohm. Connect the Emitter to the positive of the LEDs series and negative to the ground. When I used my multimeter to test the voltages that the Emitter is giving out, its only 4 - 5 V, not 12V...


Wire +12vdc to anode (positive) side of LED string, cathode side of led wires to collector, emitter wired to both negitive terminal of 12 volt voltage source and to arduino ground pin. Output pin to resistor, other end of resistor to base.

Lefty

krazyhorze


Quote
Connect the Emitter to the positive of the LEDs series and negative to the ground

The 2n3904 is an NPN, isn't it?


Yes



Quote
I don't know if I wire it correctly..


Neither do we without a drawing showing what you are trying. Keep in mind that a transistor cannot create voltage, it can only control it. If your LED string requires +12vdc then you will of course first require a 12vdc voltage source. The transistor can then be wired up to switch the +12vdc current flow on and off via the arduino output pin wired to the base of the transistor with a suitable series current limiting resistor.


Lefty




Or can I use it as a switch instead of an amplifier? A switch to turn 12V on or off?

retrolefty

Quote
Or can I use it as a switch instead of an amplifier? A switch to turn 12V on or off?


Using transistors as on/off switches is the only way you can use transistors with arduino digital or PWM output pins.

Lefty


RuggedCircuits

Here's a circuit that I think will work for your application:

http://ruggedcircuits.com/html/circuit__28.html

--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons

krazyhorze


Here's a circuit that I think will work for your application:

http://ruggedcircuits.com/html/circuit__28.html



Its the NTD4960N a NPN transistor that is also connected to a zener diode?

RuggedCircuits

Nope, it's a MOSFET. Less power loss than an NPN transistor. You can buy one here:

http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=NTD4960N-1GOS-ND

--
The Rugged Motor Driver: two H-bridges, more power than an L298, fully protected

krazyhorze


Here's a circuit that I think will work for your application:

http://ruggedcircuits.com/html/circuit__28.html



I tried but the LED doesn't turn off, instead it stay turned on and keep blinking w/o the LED turn off...

RuggedCircuits

What do you mean by "keep blinking w/o the LED turn off"?

--
Beat707: MIDI drum machine / sequencer / groove-box for Arduino

krazyhorze

Well I'm not sure. I followed your schematic but I probably made a mistake. This is how I hooked it up.

The MOSFET pins 1, 2, 3.
I connected digital pin 13 to MOSFET pin 2.
Connect ground to MOSFET pin 1.
MOSFET pin 3 to ground of LED.
5v to LED positive.

and I wanted to power the LED in parallel, not series.

RuggedCircuits

Quote
The MOSFET pins 1, 2, 3.


Looking at the front of the MOSFET:

1=Gate
2=Drain
3=Source

You want digital pin 13 to MOSFET pin 1 (through a resistor, as in the schematic). Ground to MOSFET pin 3, the LED's to MOSFET pin 2.

--
The Quick Shield: breakout all 28 pins to quick-connect terminals

Go Up