Pages: [1] 2   Go Down
Author Topic: arduino transistor help  (Read 1738 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 34
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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..
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 310
Posts: 26631
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

"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.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 34
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 310
Posts: 26631
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Connect the Emitter to the positive of the LEDs series and negative to the ground
The 2n3904 is an NPN, isn't it?
Logged

"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.

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 362
Posts: 17307
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 362
Posts: 17307
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 34
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 362
Posts: 17307
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

0
Offline Offline
Faraday Member
**
Karma: 16
Posts: 2855
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 34
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

0
Offline Offline
Faraday Member
**
Karma: 16
Posts: 2855
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 34
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

0
Offline Offline
Faraday Member
**
Karma: 16
Posts: 2855
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 34
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Faraday Member
**
Karma: 16
Posts: 2855
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1] 2   Go Up
Jump to: