Pages: [1]   Go Down
Author Topic: Control more leds with transistor  (Read 1301 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 104
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi!

Sorry if this a total noob question but I would like to PWM run more than one LED on a pin.
The fading of one LED is no problem I was able to write a library for this task.

I build this circuit:


As I said one Led is no problem but these 4 are not working any more. When I connect them directly
to the 12V they light up quite nicely so no problem here. Connected to the transistor the are constantly
very dim, no fading here. The strange thing is when I conncet the +5V from my FTDI breakout before the
emitter they are fading and running at full brightnes.


Thanks in advance!! smiley
« Last Edit: June 27, 2011, 11:25:21 am by asuryan » Logged

Montreal
Offline Offline
Faraday Member
**
Karma: 29
Posts: 2591
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Change polarity Leds and battery, plus connect negative terminal battery to ground of arduino board.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 104
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks very much!

Like this?


Please bear with me these are my first attemps with the arduino and electronics... smiley-wink
« Last Edit: June 27, 2011, 11:25:32 am by asuryan » Logged

Montreal
Offline Offline
Faraday Member
**
Karma: 29
Posts: 2591
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Excellent. Have you already tested it?
Logged

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

Not sure that circuit will actually work. The four series wired leds have 3.2vdc forward voltage drop each, therefore the whole led string will require 12.8vdc before starting to conduct. You may have to break up the 4 led string into two led strings, each with it's own series current limiting resistor.

Lefty

Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 104
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for your replies!

I tested it and it actually works (Ok only 3 Leds because they are brighter then. Thx, retrolefty)! Hurray! smiley


But! I would really like to undrstand why?! Where does the GND from the Arduino board itself come from??
Is the GND some sort of reference for the transistor? I thought a transistor is like a switch, triggered by the
base so that the circuit from +12V to GND is closed? Why do I need the GND from the Arduino?
Where does the GND from the Arduino come from when I would like to build a standalone ATMega328 circuit?

I designed a little circuit (hope I made nothing wrong with the standalone ATMega wiring):


OMG... Im such a noob... please forgive me! smiley
Thanks in advance!! smiley

« Last Edit: June 27, 2011, 11:25:44 am by asuryan » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 627
Posts: 34239
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ground doesn't come from anywhere, it is a refrence point. You need it to allow current to flow from the arduino, through the base to the emitter and back into the arduino. Without this path the transistor can't switch.
Logged

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

Quote
Where does the GND from the Arduino come

The originating source of GND is the negitive voltage terminal of the voltage source powering the arduino, either USB or through the external power connector. If using an additional external DC voltage source for powering external leds, motors, lamps, etc then both the external power source and arduino must have a wire connecting their two negative terminals.

As GM said, current flows in a circuit so there must be a complete current path which includes ground.

Lefty
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 104
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, thanks very much guys for your input!

So in an standalone ATMega328 circuit (as seen above) I have to connect the negative main
voltage (12V that go directly to the Leds) with the regulated negative voltage (after the 7805)? Is this
correct (A wire in my ciruit design that goes between powersource and crystal straight up to the
negative voltage)?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 627
Posts: 34239
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
after the 7805
The ground doesn't go through the regulator. Before or after it is the same place.
You have this right on your diagram.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 104
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok guys I think I understand! smiley

I would like to say a big "thank you" to you! Its very nice to be supported that way
especially when there are mostly "pro´s" who care about people with very low experience
in electronics but who are eager to learn something new!

Thanks a lot for support! smiley

Logged

Pages: [1]   Go Up
Jump to: