0
Offline
Newbie
Karma: 0
Posts: 34
Arduino rocks
|
 |
« on: April 01, 2011, 06:04:59 pm » |
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
Brattain Member
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
|
 |
« Reply #1 on: April 01, 2011, 06:06:19 pm » |
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.
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 34
Arduino rocks
|
 |
« Reply #2 on: April 01, 2011, 06:10:57 pm » |
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
Brattain Member
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
|
 |
« Reply #3 on: April 01, 2011, 06:12:57 pm » |
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.
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15320
Measurement changes behavior
|
 |
« Reply #4 on: April 01, 2011, 06:13:50 pm » |
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
Brattain Member
Karma: 279
Posts: 15320
Measurement changes behavior
|
 |
« Reply #5 on: April 01, 2011, 06:16:51 pm » |
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
Newbie
Karma: 0
Posts: 34
Arduino rocks
|
 |
« Reply #6 on: April 01, 2011, 06:18:22 pm » |
Connect the Emitter to the positive of the LEDs series and negative to the ground The 2n3904 is an NPN, isn't it? Yes 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
Brattain Member
Karma: 279
Posts: 15320
Measurement changes behavior
|
 |
« Reply #7 on: April 01, 2011, 06:24:15 pm » |
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
Faraday Member
Karma: 12
Posts: 2857
ruggedcircuits.com
|
 |
« Reply #8 on: April 01, 2011, 06:44:56 pm » |
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
Newbie
Karma: 0
Posts: 34
Arduino rocks
|
 |
« Reply #9 on: April 01, 2011, 07:18:25 pm » |
Its the NTD4960N a NPN transistor that is also connected to a zener diode?
|
|
|
|
|
Logged
|
|
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 34
Arduino rocks
|
 |
« Reply #11 on: April 13, 2011, 06:41:29 pm » |
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
Faraday Member
Karma: 12
Posts: 2857
ruggedcircuits.com
|
 |
« Reply #12 on: April 13, 2011, 06:44:14 pm » |
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
Newbie
Karma: 0
Posts: 34
Arduino rocks
|
 |
« Reply #13 on: April 13, 2011, 06:51:40 pm » |
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
Faraday Member
Karma: 12
Posts: 2857
ruggedcircuits.com
|
 |
« Reply #14 on: April 13, 2011, 07:00:02 pm » |
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
|
|
|
|
|
|