PWM issue with LED
Siri
Posts: 220
I am trying to use PWM to drive a 5V LED.
The LED is connected as shown in the circuit diagram-[noparse][[/noparse]Attached] and also the spin code is also attached.
The the LED works as it is intended but the problem is when the USB cable is disconnected the LED brightness is only about 50%. - when USB cable is
re-connected the LED glows brighter.
The voltage accross the LED is ---> 4.87V when USB is connected
----> 2.1V when USB is disconnected.
Can someone explain this issue.
Thanks ,
Siri
Post Edited (Siri) : 11/21/2009 11:41:14 PM GMT
The LED is connected as shown in the circuit diagram-[noparse][[/noparse]Attached] and also the spin code is also attached.
The the LED works as it is intended but the problem is when the USB cable is disconnected the LED brightness is only about 50%. - when USB cable is
re-connected the LED glows brighter.
The voltage accross the LED is ---> 4.87V when USB is connected
----> 2.1V when USB is disconnected.
Can someone explain this issue.
Thanks ,
Siri
Post Edited (Siri) : 11/21/2009 11:41:14 PM GMT
Comments
Your schematic link is not working.
-Phil
I uploaded it again.
Thanks
Siri
With the LED removed or turned off does the supply return to 5v?
Graham
The power supply is rated at 5V dc @ 4 Amps
The voltage across the power at the point of entry to the board is always 5.1v.
Yes - when the LED is removed and USB disconnected the power where the LED was connected is 5.0v. and when the LED re-inserted the power drops to 2.0v.
Siri
The LED I am using is a 5V one - you think I still need a resistor.
If so - please explain it to me.
Thanks.
Siri
how much is current maximum ? If it is a more or less standard-LED it has 20mA.
As the voltage drops down to 2V I'm pretty sure it is NOT a 5V LED, then the voltage would stay at 5V when connected
Can you post a typ-Nr or are buy-number ?
best regards
Stefan
You say it is a 5v LED, does this mean it includes a current limiting resistor or constant current circuit built in?
Another quick test, put the LED straight across the supply and see what your voltage and current is. I can't see why this would have anything to do with your PWM control it seems more likely that a large current is being pulled from the supply and this is causing it to current limit lowering the voltage.
Another test is to see if the always on brightness changes, make the propeller turn the led on and try with and without USB.
Graham
I resolved the issue.- but needs explanation.
While I was connecting/disconnecting the USB to the Propeller Education Board - I noticed that I did not really have to totally connect the USB
but as soon as the casing touched the USB cable - the LED became bright.My conclusion was a bad GROUND. ?? Correct.
The I proceed to Ground the Propeller Chip's Gnd pin ----> to house AC ground.
The LED now is bright and the spin program works as intended.
Why do other programs including the LCD examples and the power indicator LED on the Propeller Education Board function normally without
this additional ground.
Thanks,
Siri
During normal operation of your circuit do you have two supplies one for the prop and one for the LED?
If the ground that the emitter of the transistor is connected to was not also connected with the ground of the prop chip you might have problems because the output voltage of the propeller pin would not be referenced to the same 0v so it might not turn the transistor on fully.
Because voltage is all about potential differences you need to tie the 0V lines together but you should not need to connect to AC ground.
Cheers,
Graham
Thanks .
I did exactly what you suggested and now it works well.
Siri