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.

will the MCU survive?

Status
Not open for further replies.

magnatro

New Member
I am doing a small project using at-mega 8, a scrolling message display. i want to connect the micro controller in the way that is explained in the figure.
my question is :
1. will the micro controller survive?
2. if not , how can i improve the circuit?
View attachment 61103
PS i need maximum intensity from the LEDs.
 
I think so... But the LED's wont light... Each led requires around 2v (min) at at least 2..4mA .... In that configuration each LED will only get 714mV.... If you drive the LED's with 14v and sink into the uC as long as the LED's at 2V don't take any more than 20-25mA.. It should work.
 
Definitely survive - like Ian says, there's not enough voltage there to even light them.

Unless you have the atmega sitting a good twenty volts or more higher than the uln2003 and didn't put that in the schematic. I wouldn't recommend doing that. Also, you should always put a current limiting resistor on leds.
 
Last edited:
is current limiting essential ? i need to squeeze everything in a single sided PCB , and iam using only threw hole components.
 
will this update work?

is there any need for current limiter resistance?
 
Yes it is - or you'll probably kill the chip - but what's the ULN2003 for?, and why are the LED's switched by both that and the MCU?.
i've done that for simplicity. the switching is done by using the Johnston counter 4017, so the "switch" is the Johnston counter.
 
As Nigel stated above -

YES THE CURRENT LIMITING IS ABSOLUTELY ESSENTIAL!

When you wire LEDs in series, the current through them remains the same. HOWEVER...the forward voltage drop decreases every time you add another LED to the series string. As was stated above, with that many in series your LEDs will not light because the Vforward has dropped too far down for them to light up.

If you're limited on space, you can use a bussed resistor array which doesn't take up much space at all. They offer them in through hole versions.
 
Last edited:
You need an isolated resistor network between the MCU and the LEDs. A value of 330R should suffice.
 
Last edited:
i've done that for simplicity. the switching is done by using the Johnston counter 4017, so the "switch" is the Johnston counter.

Why aren't you using the MCU as a counter?, perhaps you should explain exactly what you're doing, instead of posting small pieces of diagram.

As others have suggested, you need one resistor for each LED on your updated circuit - which bares no similarity to the first one?.
 
I figure he wants to cut back on resistors as he will be using a lot of LEDs in his msg display => a lot of resistors.

That being so, perhaps a PWM modulated signal from the MCU driving a low pass RC filter into an LM317 ( configured as a modified constant current) control pin can self modulate the LED current based on the # of LEDs being lit.

http://users.telenet.be/davshomepage/current-source.htm
 
Why aren't you using the MCU as a counter?, perhaps you should explain exactly what you're doing, instead of posting small pieces of diagram.

As others have suggested, you need one resistor for each LED on your updated circuit - which bares no similarity to the first one?.
Not to mention that the AVR may struggle to turn on all these LEDs in parallel; usually these things can drive 20-25mA per pin, but not all at the same time. You'll need to calculate the power dissipation of driving each of those pins at the same time. Like Nigel and others have suggested; it is quite difficult to understand what is it you're trying to do by looking at bits and pieces. Normally the ULN is used to do the heavy lifting (i.e. the current sinking) and the MCU (i.e. AVR) is used to turn it on or off. Not sure what your attempting, but taking a wild guess you could have the timer thing as an input to the AVR, and then have the AVR drive the ULN.
View attachment 61125
 
^ That's true, there's a separate spec on total pin current for Vss and Vdd. Another hidden "Gotcha!" I wish chip designers would eliminate.
 
^ That's true, there's a separate spec on total pin current for Vss and Vdd. Another hidden "Gotcha!" I wish chip designers would eliminate.
Why a hidden gotcha? How would they eliminate it?
That is a part of how the chip is supposed to work, and I don´t think some information in a datasheet is more important than other. Would you like a nice list full with bold text saying what you should not do with your parts?

If you want to use some part, you need to read the WHOLE datasheet, especially for complex parts like microcontrollers.
I just opened a datasheet from atmega164a, section Electrical characteristics. The very first thing on the page is a thick box in which it says that you can have 40mA per i/o pin and 200mA per Vcc/GND pins. What is hidden and obfuscated in that I don´t understand.
 
Last edited:
Why a hidden gotcha? How would they eliminate it? That is a part of how the chip is supposed to work, and I don´t think some information in a datasheet is more important than other. Would you like a nice list full with bold text saying what you should not do with your parts? If you want to use some part, you need to read the WHOLE datasheet, especially for complex parts like microcontrollers. I just opened a datasheet from atmega164a, section Electrical characteristics. The very first thing on the page is a thick box in which it says that you can have 40mA per i/o pin and 200mA per Vcc/GND pins.

You were born in 1987. I was programming microcontrollers before you were born, and so am very familiar with spec sheets. The Absolute Maximum Ratings box on page 329 of the Atmega164a spec sheet, which has this particular spec on the 7th line down (after things like the "Storage Temperature") is not any thicker than any other - https://www.electro-tech-online.com/custompdfs/2012/02/doc8272-7.pdf

I point things out like this primarily to help 25-year-old noobs who think they know it all and blow out their chips because they made a reasonable, but incorrect assumption about things like the current limit on the port pin driver being the engineering constraint - not realizing there is a deficiency in the current handling ability of the die's power rails.
 
Last edited:
To be honest, you should listen to what the guys are telling you here, if you hooked your 5V 100mA power supply for arguments sake to a LED it would not last very long, putting a current limiting resistor of about 300R / 330R will allow it to light up all happy!

I've seen loads of people put an LED as a power indicator forgetting the resistor and think their power section isn't working because the LED isn't on! Doh!

You need to look at the datasheets and see what the maximum per pin is AND maximum per device is that it can sink / source.

If you need to light up strings of LED's use transistors and drive the transistors using the micro / counter instead! (Don't forget the base current limiting resistor! 2.2k should suffice!).

I'm 29 and don't have anywhere near the level of skill set that most of the guys on this forum have, to which I will happily admit! I learnt with a 500 in 1 electronics kit and a book called The Art of Electronics, to which I still have for reference! I was programming windows and linux before uC's and have done so in basic, assembler and C, i've been dabbling with micros for about 3 years, and they still confuse me to this day, and always will I expect.

The thing about electronics is you are always learning, the thing about software is you are always learning, combine the two together, and you either accept that you will never know "everything" or give up trying!
 
You were born in 1987
Is this your problem?
Otherwise I don't see why you would out of sudden reply to two other threads I replied to. If you think you are so old you know everything, keep on.

7th line down (after things like the "Storage Temperature") is not any thicker than any other
Maybe the current maximums are not thicker, but they definitely stand out from the other specs. I don't know what you're trying to prove.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top