PWM and LED

xtech007

Senior Member
Hi all!
Need a lil Help on how to wire an Led to be driven by PWM.
Will be using 28x1 pwmout pin to anode leg of the led and cathode to resistor and ground!
Specs of led are 2.2v,20mA and will be powered by 5v. The resistor will be a 180ohm resistor.
Is this correct?
 

Goeytex

Senior Member
The 180 Ohm resistor is neither correct nor incorrect. You can use any value resistor from about 120 ohms up to about 4K Ohms depending upon the max brightness required at 100 percent duty.

Given the same series resistance, due to voltage droop at the Picaxe Output Pin under loads > ~2 ma, the LED will be brighter when using a transistor switch than from the I/O pin.
 

xtech007

Senior Member
Ah transistors!

Did used transistors in the past, and learned a lot , specially about the base transistor required to saturate the base!

For now was using the pin from the 28x1 to show my 9yr old son about picaxe and wiring in the process .
For now he really understand how to wire an LED to the IC and the high and low comands, also letpins syntax.

So as a bonus will teach him to fade the led using PWM.

But transistors are comming soon!
 
Top