Hello Everybody, confused newbie....

Brimstone

New Member
Hello all, great to have found you all, as did electronics back in the 80's as also basic programming. Granted a bit rusty but it is slowly coming back to me.
Bought the developers kit and been playing, so far so good, got a chase circuit worked out and flashing leds etc, now transferring to a strip board as the first project.

Using 10mm led's which have the same values at 3 and 5mm ones, which for the red ones I have is, 20ma 1.75-2.2V and white ones with 20ma 3.2-3.4V .

Reading the data for the chips, and testing on the board one led per chip pin is fine, but have confused my self with the resistor needed per led.

In the manual it says 330 ohm is normal for led's, but using a resistor calculator for 4.5v - 5v power supply and the 20ma and average V of 2v for red and 3.3v for white I get red at 150 ohm and white at 91 ohm..... Am I missing something?

Any advice would be great.......

PS Nice to be here......
 

premelec

Senior Member
Welcome to this forum - you are probably missing a lot in regard to the PICAXE driving capabilities - it is a logic device - not a power device. Thus for simple indicator LEDs a few hundred ohms series is appropriate. For fancy LED effects and lots of light external driver transistors are often used. Also the maximum current for a PICAXE chip is such that you can't get maximum pin current for all pins... and in practice the output impedance of pins is limited - at higher currents there are higher voltage drops - different for sourcing an sinking currents.... This has been discussed many times in this forum and if you use the forum search function you likely will find many comments... The basic consideration is that PICAXE [and lots of other micros...] is a best thought of as a logic unit... With excellent versatility for controlling and reading external items...
 

AllyCat

Senior Member
Hi,

Yes, welcome to the forum. Much will depend on the type of power supply e.g. (battery type, etc.) and whether the PICaxe pins "pull-down" or "pull-up" the LEDs (the pull-down FETs have a lower resistance). Not quite on the same topic, but perhaps this recent thread is worth a look from around #6 or #9.

Cheers, Alan.
 

eggdweather

Senior Member
Your calculations are good and have been adjusted for the nearest preferred/available resistor values. As already mentioned your problem is the PICAXE can't supply/source the 20mA and if you dissipate/sink 20mA you will likely destroy the output pin as it tries to take the load.. You need an intermediate transistor or FET there are plenty of circuits around, see the digital logic switch' example: http://www.electronics-tutorials.ws/transistor/tran_4.html
 

Brimstone

New Member
Thank you, think I have it, been searching for a few days and not come up with anything (helps if you know what to search for)....
Project I have is to light 6 leds one at a time in a random sequence and also 2 different coloured ones in random as well....(it is actually for a lift display, so 6 floors and up and down, to make it look like it is working for example up led and floor 6, then down and floor 2, down and floor 1 etc etc.)
I got it working fine on the bread board and wanted to transfer it to a strip board.

In effect then, I am best to start using transistors to get into the habit of thinking as the picaxe as signal out not power, then the leds can be powered through the transistors with the correct resistor for the power, and the transistor switched from the picaxe pin.......
 

hippy

Ex-Staff (retired)
Welcome to the PICAXE forum.

You should be okay with a single LED drawing 20mA, and I think all latest PICAXE are rated to 25mA per output pin, but there are usually total port limits so multiple LEDs on at the same time can become an issue. It's usually advisable to not push I/O to its limits, and one effect is that as current drawn increases the voltage drops.

If it's working on breadboard it should work equally well on stripboard or a PCB. Always worth checking though because prolonged pushing a chip to its limit may cause longer term failure rather than immediate expiry.
 

Brimstone

New Member
Thank you, just been reading up about the ULN2803A 8 x Darlington Array chip, and seems to be easy enough to put it through one of them and then not pushing the chip.
It has enough with 8 to do what I need and can run it all from the 5v mains power adapter and take the led power direct and use the resistors as worked out for the leds.

Just starting out on using Picaxe and got a few projects in mind, and don't want to get into bad habits to start with, so think using the Darlington chip will be a good way to go.

Thanks again, learned loads today..... ;)
 

manuka

Senior Member
Brimstone: Welcome, but -mate- 20mA per status LED- what kind of talk is this !

Few modern LEDs need that sort of current for mere status indication. Many of today's in fact are blindingly bright at even 10mA & often now can be run drawing just a couple of mA. I've a swag of red (ex Xmas tree) LEDs here that are still EVIL at 1mA, and greens (where human perception is better) can often be clearly seen at a few 100 µA. Whites however may need a little more. Experiment - perhaps initially 1000 Ohm dropping resistors on 5V supplies will do ?

Suggest hence considering a SIMPLER approach & use modern "ultra/super/mega" bright LEDs. They cost much the same (in the right places) anyway.

Footnote: Haitz's LED "Law" makes interesting (ah-illuminating ?!) browsing.
Stan.
 

inglewoodpete

Senior Member
A couple of points. Firstly, it is never wise to run any electronic component at its limit. So, if your LEDs are rated at 20mA, I would run them at around 80% (Ie ~16mA) for longest life.

If you are moving your LED concept from breadboard to a more permanent board (stripboard or PCB), consider Rev-Ed's CHI030 (18M2) or the AXE117 (14M2). With a ULN2803A on-board, they may offer you all you need for your project.
 

lbenson

Senior Member
As others have suggested, some of the superbright indicator leds are bright enough for many purposes with even 2.2K resistors.
 
Top