Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How to use transistors as IC driven switches?

Status
Not open for further replies.

sleeper1987

New Member
Hi. I'm trying to make an LED cube - an 8x8x8 array of LEDs to be driven by a micro-controller. Problem is, I need to source and sink currents from separate output pins.

- One output needs to source current for 1 to 8 LEDs in parallel.
- Eight outputs need to sink current from each of those LEDs individually.

What I have currently is this system:
(see attached file - led_driver.jpg)
In reality, the base voltages are controlled by the output pins, rather than by the source directly.

I'm unsure as to what's going on with the diode here, as it's between the transistors. In my circuit, the whole array of LEDs goes off for seconds at a time, or flickers, and I gather this may be due to the sink diodes oscillating due to their having slightly different gains. Can anyone offer some advice as to how to make this work?

NB: The diodes will only be on for a 1/64 duty cycle, so I'm happy to overdrive them with 80-100 mA of current. Also, I'm aware that 1/64 will be a crappy brightness, but I want to get the basic thing working, then I'll switch to using SIPO registers to controls the 64 columns independently.

Thanks in advance!
 

Attachments

  • 091308_175627.jpg
    091308_175627.jpg
    215.8 KB · Views: 300
  • led_driver.JPG
    led_driver.JPG
    51.5 KB · Views: 217
Change some or all of the resistors so that you can leave the leds turned on permanently, then drive them one at a time and see what is happening with a voltmeter.

In your circuit, it would be normal to leave the collector of the darlington pair at 5V all the time.

The emitter will rise to about 3.5 V when the base of the darlington is driven to 5 V.

When one of the transistors is turned on, the base will rise to about 0.6 V. The 150 Ω resistors limit the base current to about 30 mA and the collector voltage will fall to about 0.1 V

(One base resistor is different. That looks like a mistake and 30 mA is a lot more than you need for the base current. 1 mA would be fine.)

The led voltage will be about 1.6 V so that leaves about 3.5 - 1.6 - 0.1 = 1.8 V across the 30 Ω resistor so you get about 60 mA.

I hope that explains what is going on but I have a feeling that is not answering what you wanted to know.
 
Diver300 - Thank you for your reply!

- I'm not sure how I *could* leave the LEDs on permanently by changing the resistors. Can you briefly explain what you mean?

- As for the 30mA current thing, you may be onto something! Not sure how I missed that, but it now looks like all my current sinking transistors have died. I'll try reducing the current to their bases and report back.

Thanks again.
 
Diver300 - Thank you for your reply!

- I'm not sure how I *could* leave the LEDs on permanently by changing the resistors. Can you briefly explain what you mean?

- As for the 30mA current thing, you may be onto something! Not sure how I missed that, but it now looks like all my current sinking transistors have died. I'll try reducing the current to their bases and report back.

Thanks again.

What Diver was referring to was increasing the resistor values for a safe operating current for the LEDs. Since you are over-driving them with 60mA, it wouldn't be good to leave them at that level for too long, as you are aware. Use 90 ohm resistors for 20mA current draw.
 
Ah, thankyou!

Having sorted that overly large base current, the problem seems to be fixed!
Thanks again - Diver, Rezer - for your help.
 
Hi. I'm trying to make an LED cube - an 8x8x8 array of LEDs to be driven by a micro-controller. Problem is, I need to source and sink currents from separate output pins.

- One output needs to source current for 1 to 8 LEDs in parallel.
- Eight outputs need to sink current from each of those LEDs individually.

What I have currently is this system:
(see attached file - led_driver.jpg)
In reality, the base voltages are controlled by the output pins, rather than by the source directly.

I'm unsure as to what's going on with the diode here, as it's between the transistors. In my circuit, the whole array of LEDs goes off for seconds at a time, or flickers, and I gather this may be due to the sink diodes oscillating due to their having slightly different gains. Can anyone offer some advice as to how to make this work?

NB: The diodes will only be on for a 1/64 duty cycle, so I'm happy to overdrive them with 80-100 mA of current. Also, I'm aware that 1/64 will be a crappy brightness, but I want to get the basic thing working, then I'll switch to using SIPO registers to controls the 64 columns independently.

Thanks in advance!

WOW
That's sure a monster project from a parts count view. Would be cool to build something like that for my grand daughter. However I would certainly first investigate directly driving the diode array with microcontroller output pins via some kind of multiplexing scheme, using software duty cycle adjustments to limit the average LED current, the savings in parts would be tremendous, no?
 
WOW
That's sure a monster project from a parts count view. Would be cool to build something like that for my grand daughter. However I would certainly first investigate directly driving the diode array with microcontroller output pins via some kind of multiplexing scheme, using software duty cycle adjustments to limit the average LED current, the savings in parts would be tremendous, no?

You could look into Charlieplexing.
 
Leftyretro - I did consider doing what you suggest, but my IC (ATMega32) can only source 40mA per pin, so it's useless for driving any kind of large array. The parts count isn't too bad - you just need 64 high side transistors, 8 for the low, a resistor for each base, and 64 more for the columns. In this prototype version, I also have 9 decoder chips, that select the row and column respectively. Using serial-to parallel outputs, that could become 4, using 4 16bit led drivers / SIPOs.

Multiplexing is something of a necessity with these things I think - assuming you want to address every 'voxel' (3d pixel, apparently) of the cube individually, you can't light all the LEDs at once. If you see the enclosed pic, the most LEDs that can be lit at any time is n, where the size of the cube is n^3. If you were to try lighting them all at once - lighting both led (0,0,0) and led (7,7,7) would result in also lighting (0,0,7) and (7,7,0) as well. See the enclosed pic for how it is wired to see what I mean...

Charlieplexing is also possible - my original plan was to use 'googleplexing' - but I figure it adds another layer of complexity to the software element. As far as I can see, it doesn't allow you to light any more LEDs, and is only really of use if you want to drive really huge arrays. As a limiting factor, using serial-to-parallel registers - you only need 1 pin for every 16 columns in the cube. That is; you could easily light a 16x16x16 cube with 20 pins: 16 for the serial input registers, and 4 for a 16bit decoder/demultiplexer.

If you do make a cube, I suggest you construct the thing using a jig and tinned copper wire as a frame for the layers. Just using the LED cathodes to join the ground planes together makes the thing too fragile, and is probably worse aesthetically. Also, if you do go through with it, feel free to ask me, as I dare say I've hit every design hurdle on the way...!!
 

Attachments

  • CUBE DESIGN.png
    CUBE DESIGN.png
    288.7 KB · Views: 308
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top