Shop OBEX P1 Docs P2 Docs Learn Events
LED on Parallax Propeller Proto Board — Parallax Forums

LED on Parallax Propeller Proto Board

HumanoidoHumanoido Posts: 5,770
edited 2011-01-21 01:22 in Propeller 1
The SMD LED on the board, when isolated to just the LED and resistor, draws 20mA. I tried adding another resistor and it goes down to 19mA and then becomes too dim.

Why, when I add my own larger LED, it draws 1mA at full brightness? Are all SMD LEDs hungry power consumers or is it just based on the specs of this one SMD LED?

I did try other PPPBs and all the SMD LEDs draw the same power.

Comments

  • LeonLeon Posts: 7,620
    edited 2011-01-13 05:51
    The LEDs probably have different specifications. High-brightness devices are much brighter than ordinary ones, even at low currents.
  • Roger LeeRoger Lee Posts: 339
    edited 2011-01-13 08:14
    The SMD LED on the board, when isolated to just the LED and resistor ...

    Q: How did you isolate the LED? Did you remove it from the board?
  • HumanoidoHumanoido Posts: 5,770
    edited 2011-01-13 08:43
    Roger Lee wrote: »
    Q: How did you isolate the LED? Did you remove it from the board?
    No I did not remove it from the board. I removed power from the barrel jack and unsoldered the 3.3-volt regulator. For more info, go to my Fill the Brain thread, post #46 etc. here and read about the Brain guts data light. There are additional pages to the thread with more photos including some microscope images. In summary, with that mod, since one side of the LED goes to Vss, I soldered a wire to the through-hole connection above the LED (point A) as seen in the sketch below and led the wire to a prop pin for Vdd.

    attachment.php?attachmentid=76992&d=1294306926
  • HumanoidoHumanoido Posts: 5,770
    edited 2011-01-13 14:49
    I also though perhaps there was some monkey business going on through hole A on the back side of the board so on one PPPB I cut the trace to assure that absolutely nothing was on A. The result produced the same 19mA current draw from the LED. I checked the severance with a VOM with audible continuity feature because the trace is extremely small and surrounded by more trace and as far as I can tell, the connection was indeed severed. Unless some strange anomaly happened and my eyes didn't see it, I'm reasonably certain the LED does indeed draw 19mA with the 241 ohm resistor.
  • Kal_ZakkathKal_Zakkath Posts: 72
    edited 2011-01-13 15:44
    That doesn't sound right to me. I could be wrong here, but going with Ohm's law we get:

    V = I * R
    or
    0.019A * 240R = 4.56V

    So at 19ma, that 240Ohm resistor would be dropping 4.5V!
    But it sounds like you were running the LED from a prop pin for the test? in which case the absolute max current should be 3.3v / 240R = 13.75mA (that's with 240R straight to ground, no diode).

    Even if we assume the worst case of a 20% tolerance resistor (240 * 0.8 = 192) the absolute max current is still only 3.3/192 = ~17.2mA (again, that's with no diode to drop the voltage).

    I wonder if there is something else at work here? Perhaps you should measure the voltage on each side of the resistor (obviously one side should be 3.3v) then use that to determine the current going through the LED?

    Side note: googling leads me to believe that an SMD resistor marked '241' is 240 ohms (last digit is the number of zeros: '240' = 24 ohms, '241' = 240 ohms, '242' = 2400 ohms, etc).
  • HumanoidoHumanoido Posts: 5,770
    edited 2011-01-16 17:41
    That doesn't sound right to me. I could be wrong here, but going with Ohm's law we get:
    V = I * R
    or
    0.019A * 240R = 4.56V
    So at 19ma, that 240Ohm resistor would be dropping 4.5V! But it sounds like you were running the LED from a prop pin for the test? in which case the absolute max current should be 3.3v / 240R = 13.75mA (that's with 240R straight to ground, no diode). Even if we assume the worst case of a 20% tolerance resistor (240 * 0.8 = 192) the absolute max current is still only 3.3/192 = ~17.2mA (again, that's with no diode to drop the voltage). I wonder if there is something else at work here? Perhaps you should measure the voltage on each side of the resistor (obviously one side should be 3.3v) then use that to determine the current going through the LED? Side note: googling leads me to believe that an SMD resistor marked '241' is 240 ohms (last digit is the number of zeros: '240' = 24 ohms, '241' = 240 ohms, '242' = 2400 ohms, etc).
    Thanks Kal_Zakkath, I completed the voltage tests today. The sketch shows the results.

    attachment.php?attachmentid=77299&d=1295228462
    568 x 332 - 24K
  • Kal_ZakkathKal_Zakkath Posts: 72
    edited 2011-01-16 18:30
    Ah, so it looks like the resistor is dropping:

    2.78V - 1.94V = 0.84V
    Meaning that the current (I = V/R) is 0.84 / 240 = 3.5mA.
    And the diode has a forward voltage of around 1.9V-2.0V.

    Giving some wiggle-room on the resistor (say, 20% as before - also allows for some inaccuracy of the multimeter), gives us a max current of around 4.38mA.

    That sounds more reasonable to me :)

    I guess the 0.5V drop between the prop and the resistor must be in the wire being used (0.5/4.5 = ~110mOhms, which is too small for cheaper multimeters to measure).
  • HumanoidoHumanoido Posts: 5,770
    edited 2011-01-17 01:09
    Kal, can you calculate a way to reduce the current drawn by the LED? I tried adding a resistor from the Propeller pin but the LED was too dim to be usable.
  • Kal_ZakkathKal_Zakkath Posts: 72
    edited 2011-01-17 12:41
    I'm afraid if it is too dim with another resistor there isn't much one can do. 4mA is quite low for an LED (through hole ones are often rated for 20mA).

    One option could be to flash it on/off (say 1Hz, 500ms on, 500ms off). That way the LED is still bright (and drawing 4mA) but it is not drawing it continuously - so your average draw goes down to 2mA.
    You could also change the ratio to increase the power savings (e.g. 250ms on, 750ms off).

    Many of the products at my work have a 1Hz flash pattern as the standard 'on' signal as it also has the advantage of showing you that the microcontroller is still running (though obviously this does not really apply to the propeller as the other cogs can stop/start independently of the LED flash).
  • HumanoidoHumanoido Posts: 5,770
    edited 2011-01-17 15:40
    Kal, thanks for the great idea about flashing the LED. I could use PWM to control it and check current draw to balance it at a lower number. I did a Penguin robot project that controlled the LED brightness using PWM. However, it could take a while for me to write the PWM Spin code as I'm still learning Spin. There's downloadable PBASIC code at the PT#4 thread Rudolph the Red LED Penguin! in Penguin Tech #4.

    I wish the surface mount LED was 4mA current draw after adding the resistor to the prop pin and going dim. I could use it that way. But I'm not seeing 4ma draw. It drops by only 1mA so it draws current around 19 or 18mA. I can try measuring this again and confirm the results on a different board but I expect results will be about the same.
  • Kal_ZakkathKal_Zakkath Posts: 72
    edited 2011-01-17 18:37
    Yes, PWM can be used and there is an object for it in the obex (PWM_32 I think it's called, from memory) - though the results will be the same as adding a resistor (but with the advantage of being able to easily adjust it in software).

    I'm a little confused though, based on the voltage readings above there is only ~4mA going through the LED and resistor when they are fed from 3.3v - how are you measuring the current to get 19mA?

    The ammeter should be in series with the circuit, something like this:

    Prop pin -> ammeter + lead -> ammeter -> ammeter - lead -> resistor -> LED -> gnd

    Or, if you care about total current (say, for battery life) you could measure the current going into the board as a whole:

    + supply -> ammeter + lead -> ammeter -> ammeter - lead -> prop pcb Vin

    Method #2 will give you a better idea of what it 'costs' to have the LED on, as it includes all the power lost along the way (such as losses in the regulators, current drawn by the prop if running another cog to do the LED, etc).

    If you are measuring using #1 above and still seeing 19mA it might indicate a partial short to ground somewhere - a strong possibility if you are hacking up boards :) I've occassionally found pieces of lint/dust/etc can cause this kind of thing. It's not as obvious as a dead short (which generally results in something burning) but rather lowers the resistance of a circuit causing more current through parts of it.
    My main suspect would be the around wire from the prop pin to the resistor, as the voltage drop across it is higher than I would've thought - though without seeing it it's hard to say.
  • ratronicratronic Posts: 1,451
    edited 2011-01-17 19:55
    Humanoido - here is a quick example that will vary the pwm output duty cycle from 0 to 100% back and forth on p3 led going from dim to bright). You can delete all of my repeat stuff and just call dim your self with a # between 0 to 255.
    This uses Phil's pwm object.
    Con                       ''continuously vary brightness on led(w/resistor) hooked to p3               
      _clkmode = xtal1 + pll16x                                                                            
      _xinfreq = 5_000_000                                                                                 
     
      pwmbasepin = 0 
     
    ''pwmbasepin=0 for p0-p7,  pin=8 for p8-p15,  pin=16 for p16-p23,  pin=24 for p24-p31                   
     
    Var                                                                                                    
     
    Obj                                                                                                    
     
      pw : "pwmx8"                                                                                         
     
    Pub main  | i                                                                                          
     
      pw.start(pwmbasepin, %0001000, 100)   ''start pwm object on basepin, for p3 pwm output, at 100 hertz 
    ''set a 1 for pwmout on p3 ^   , ^ pwm output frequency                                                
     
     
      repeat                                                                                               
        repeat i from 0 to 255                                                                             
          dim(i)                                                                                           
          waitcnt(clkfreq/500+cnt)                                                                         
        repeat i from 255 to 0                                                                             
          dim(i)                                                                                           
          waitcnt(clkfreq/500+cnt)                                                                         
     
    Pub dim(brightness)                                                                                    
     
    ''brightness can be from 0 to 255 for 0% to 100% duty cycle                                            
     
      pw.duty(pwmbasepin + 3, brightness)    ''set p3 dutycycle
    
  • HumanoidoHumanoido Posts: 5,770
    edited 2011-01-17 22:05
    Kal, I completely agree with your analysis. The way of measuring amperage is at the power supply. The bench lab power supply I use is capable of giving both voltage and amperage output on a display when supplying power to a circuit. Perhaps I had better run some calibration tests on this to see what's going on and post the results here. As far as this being a random short circuit, probably not, with the same mod it's happening on several PPPB boards.
  • HumanoidoHumanoido Posts: 5,770
    edited 2011-01-17 22:26
    Ratronic, thank you for sharing this code. It's a nice small program ideal for this use and testing. I look forward to trying it and measuring LED loading results.
  • Kal_ZakkathKal_Zakkath Posts: 72
    edited 2011-01-18 18:35
    Humanoido wrote: »
    ...The way of measuring amperage is at the power supply...As far as this being a random short circuit, probably not, with the same mod it's happening on several PPPB boards.

    Yes, if you get the same result on multiple boards then a random short is unlikely.
    My first step in that case would be to run the same test you have been doing, but alter the prop code so that the LED pin stays low (or is an input).

    Then you can compare it with the result when the pin is set high to power the LED.

    If the difference is more than the expected LED current (around 4mA from our calculations) then the current is going through the pin but does not appear to be going to the LED. If not, then the current draw has nothing to do with the LED but is from something else (for example, the prop itself may be drawing the extra current to run the test program - remembering of course that the prop's current draw can vary a lot depending on clock speed, how many cogs are running, whether waits are used, etc).
  • HumanoidoHumanoido Posts: 5,770
    edited 2011-01-19 19:50
    The tested PROTO board draws 5mA with the pin low and 19mA with the pin high driving the LED.

    When the pin is low, there is 0 volts at points A, B, C and D.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-01-19 20:12
    Humanoido,

    I've had trouble in the past conductive flux leaking current. Have you washed the areas you soldered with an appropiate solvent?

    Duane
  • HumanoidoHumanoido Posts: 5,770
    edited 2011-01-19 20:16
    Ratronic, the program works well with pin 3. How to change it for pin 24? I tried changing to pwmbasepin = 24 but this didn't work.
  • HumanoidoHumanoido Posts: 5,770
    edited 2011-01-19 20:25
    Hi Duane. Thank you for this good tip. I did not wash the area to be soldered. But I did take a knife edge and gently brazed the surface and the wire to be soldered for best connection. The connections are good. I had 3 out of 20 boards that required inspection. One of those needed resoldering. I also did a trace cut on one board from the back side to assure component isolation and then tested. No leakage. Someone should test the LED on their PROTO board and see what readings are found.
  • HumanoidoHumanoido Posts: 5,770
    edited 2011-01-19 20:53
    Ratronic, I got the PEK single ended duty mode code working on the board. It's much simpler because an OBEX object is not required and visually it does the same. I'm not sure about power consumed because it's on the high side, even higher at 22mA! The code requires a 1/20th second delay mod for the amperage reading to settle. Next, I will try direct pulsing.

    http://www.parallax.com/go/pekit
  • HumanoidoHumanoido Posts: 5,770
    edited 2011-01-19 21:31
    I found a solution to the problem of the LED drawing too much current. I have written a Spin program that takes the power drawn down from 19-20 mA to 3-5 mA by pulsing the LED-resister combination in two disparate cycles. This is an amazing and very simple solution and does not require any extra objects from the OBEX and the code is very small - only 7 lines. For anyone wishing to reduce the power consumed on LEDs in their boards, the code is provided for download at the Brain project thread.

    http://forums.parallax.com/showthread.php?124495-Fill-the-Big-Brain&p=969476#post969476
  • TubularTubular Posts: 4,717
    edited 2011-01-19 22:08
    Humanoido wrote: »
    Someone should test the LED on their PROTO board and see what readings are found.

    On one of my proto boards the LED (near the power switch) was drawing 12.7mA. Its series resistor was 237 ohms.

    Here's how I measured:
    With proto board off, measure the series resistance with a dmm
    Power it up. Measure the voltage drop across the same series resistance.
    Ohms law gives you the current (3.01 volts / 237 ohms = 12.7mA).

    Measuring the voltage drop across the resistor is more accurate than inserting the meter in series. My Fluke 77 was dropping 208mV while measuring a current of only 27mA (proto board supply idle current).

    If I tried to measure the LED current using a DMM in series, I would have seen 12.3mA instead (about a 3~4% error).
    However the error would have been much worse if the LED was operating from a 3v3 rail (something like an 8% error at the same led current of 12.7mA). The voltage drop method is only better because of the high impedance input of the multimeter (typically well over 1 Megohm)

    Some high efficiency LEDs are quite visible well down below 1mA.
  • HumanoidoHumanoido Posts: 5,770
    edited 2011-01-21 01:22
    Tubular, thanks for these very useful tests. I can see your methods have generated an unparalleled degree of accuracy. It's interesting your board has a slightly different value resistor. It would be much more useful if Parallax had chosen one of the high efficiency LEDs that are visible down to 1mA and below. Maybe they were not thinking about anyone connecting together multiple boards and trying to keep the power consumption low as possible. Let's hope they can upgrade the current boards. For now, I can use pulsing code and add-on data lights run at 1mA.
Sign In or Register to comment.