16 leds to drive, how?


+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 22

Thread: 16 leds to drive, how?337 days old

  1. #1
    Fanatical Contributor Tim's Avatar
    Join Date
    Jan 2003
    Posts
    7,689
    Thumbs Up
    Received: 47
    Given: 95
    Total Downloaded
    1.32 GB

    0 Not allowed!

    Default 16 leds to drive, how?

    Hi,

    I have 16 ir leds to drive. The issue is I want as part of the development to have a adjustment of the brightness as I could flood the receivers.

    The part is https://datasheet.lcsc.com/szlcsc/Ev...R8_C131250.pdf

    My supply V is either 12v or 5v. My system uses a number of boards talking back to a main controller. I was going to use 12v with a reg on each board but then I thought that was a waste. So was thinking of a big reg on the main board and feed that out to the other boards. The reason I say this is that if I used 12v I could have 10 leds in series. However that leaves 6 on their own so maybe not such a great idea.


    Back to the question. What's the best way to drive them? 4 banks of 4 leds in series? Can I use a led driver to current control them to drop the output luminance?
    I have no good idea, HELP!

    Thanks

    Tim
    Tim

Attention

This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

The advertisements we display are relevant to this web site and your browsing history

Please consider supporting us by disabling your ad blocker.


Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

If you can, please report issues in the forum area WebSite / Forum Issues


Thank you for your attention.

  • #2
    Senior Member GAMBOA's Avatar
    Join Date
    Nov 2004
    Posts
    424
    Thumbs Up
    Received: 19
    Given: 0
    Total Downloaded
    203.73 MB

    0 Not allowed!

    Default Re: 16 leds to drive, how?

    I have used this AS1110BSSU to excite led of a display.

    Regards,
    Gamboa

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #3
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,481
    Thumbs Up
    Received: 315
    Given: 146
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: 16 leds to drive, how?

    Because there are only 16 LEDs, a standard multiplex can be used for them.

    For example:

    All LEDs have a common anode that is connected, via a transistor, to the microcontroller's CCP pin (PWM). Then each of the LEDs are illuminated in turn and the PWM is adjusted per LED. This is the same mechanism used in 7-segment multiplexed LEDs, and the varying PWM will alter their brightness.

    The multiplexing is carried out within a simple interrupt, and each LED's brightness is stored in an array, so simply changing the value in the array to match the LED will alter a single LED's brightness without effecting any others. You could even make them dance. LOL

    I would recommend a switched constant current source for the LED common so they are not overloaded if something goes wrong. The LED's have a maximum current of 65mA, so a microcontroller pin will not supply enough, so each pin will need a transistor buffer.

    I would recommend a simple PIC24 device for this, mainly because they are fast and have 16-bits per port anyway. Also, their interrupt mechanism is excellent and everything will operate in the background and the rest of your program will be uninterrupted because the LEDs do not need MHz or even KHz scanning. But a standard 18F device will also suffice.

    I'm doing the same principle at the moment to drive RGB 32x16 LED matrix displays, but these have shift registers on them because they have so many LEDs. When an LED is chosen inside the matrix, the software looks inside the array that holds the Red, Green and Blue value for that particular LED then alters 3 PWM values, this giving any colour to an individual LED. These are scanned as fast as possible and the matrix comes to life just like a colour TFT display.
    Last edited by top204; 21st March 2019 at 09:51.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #4
    Fanatical Contributor Tim's Avatar
    Join Date
    Jan 2003
    Posts
    7,689
    Thumbs Up
    Received: 47
    Given: 95
    Total Downloaded
    1.32 GB

    0 Not allowed!

    Default Re: 16 leds to drive, how?

    The one thing I forgot to mention is they are Ir leds and I'm using them to supply a backlight to measure the drop through water. So they need to be constant current. No PWM as that will give timing issues with the result on the A/D input. Multiplexing could work but do not see much of a benefit as the current only needs to be say 5ma to each led, perhaps less.

    Since there will be 4 banks I'm thinking now that a resistor in line will do now. I will only need to play with 4 resistors.

    They can be on 100% of the time. I was not sure if I could use a resistor or needed a constant current device.

    Does that sound right?

    Thanks
    Tim

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #5
    Senior Member Stephen Moss's Avatar
    Join Date
    Jan 2006
    Posts
    526
    Thumbs Up
    Received: 31
    Given: 7
    Total Downloaded
    3.87 GB

    0 Not allowed!

    Default Re: 16 leds to drive, how?

    I have never used one but would a digital pot give enough of a suitable variation to work? That said a variable current is probably more precise that variable resistance.

    How about a summing amplifier with binary weighted input resistors fed from the output port of a PIC driving your 4 banks of 4 LEDs?
    If you consider the forward voltage drop of the LED as being fixed then with a fixed LED dropper resistor the output voltage of the a Summing Amplifier then determines the current and thus luminosity. An ADC would do the same thing with less components but the available output current may be an issue.

    However, if you are concerned that the small differences there may be between the banks due to any variation in the LED forward voltage would create too much of a variation between banks then one programmable constant current source per bank would be a better solution.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #6
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,481
    Thumbs Up
    Received: 315
    Given: 146
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: 16 leds to drive, how?

    The PWM will not interfere with an ADC, and it doesn't matter whether is is standard light or IR light.

    A standard ADC is quite slow compared to the 100Hz or 200Hz or more scanning of the LEDs, so the ADC will see a constant value. On a system like this, the ADC always goes into a low pass filter anyway, software or hardware, so it always returns a value without fluctuations.

    The filter can be a simply rolling average, or median, or even a capacitor on its front end. Because it is not making extremely rapid samples. i.e. Mhz.
    Last edited by top204; 21st March 2019 at 10:56.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #7
    Fanatical Contributor Tim's Avatar
    Join Date
    Jan 2003
    Posts
    7,689
    Thumbs Up
    Received: 47
    Given: 95
    Total Downloaded
    1.32 GB

    0 Not allowed!

    Default Re: 16 leds to drive, how?

    Thanks Stephan

    The system I'm building is a bank of 96 ir receivers multiplexed through to a pic ADC pin. The Ir leds will flood the ir receivers that lie around 20 mm away. As water rises up a tube in between them the water attenuates the ir signal. So I can determine the water level.

    The system will be calibrated to produce a lookup table. It will at the least have a threshold ADC value that will decide on the water no water signal. They may even have individual diff values and could even be dynamic. Eg self calibrating.

    I aim to diffuse the ir light with something but work others has done shows it might not be needed.

    So the requirement is now just to make it easy to adjust the brightness for setup purposes. It may be in the production version I will use an adjustable version as they the equipment may be on 24 / 7 and need auto adjustment for led degradation.

    If I could find a little chip to provide constant current regulation at 40ma that would be good. I could build them in now.

    Thanks

    Tim
    Tim

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #8
    Fanatical Contributor Tim's Avatar
    Join Date
    Jan 2003
    Posts
    7,689
    Thumbs Up
    Received: 47
    Given: 95
    Total Downloaded
    1.32 GB

    0 Not allowed!

    Default Re: 16 leds to drive, how?

    Hi Les

    Good point. I aim to scan the 96 inputs at 20hz with say a 10 over scan for averaging.

    So that's 960 x 20 so that's a 19,200 adc samples a second. The cap filter should be faster than that so there is no bleed over as I swap inputs.

    Tim
    Tim

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #9
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,481
    Thumbs Up
    Received: 315
    Given: 146
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: 16 leds to drive, how?

    Nyquist will still come into it if using PWM, so even at a low of 8-bits for PWM, an 18F running at 64MHz will produce a PWM frequency of 62KHz per LED.

    At that frequency and a high frequency for the scanning of the LEDs, the ADC will see a constant value for the illumination. A constant current source does not need to be a chip, it can be a single transistor, or a double transistor to be switched.

    Where does the 96 inputs come from Tim? Your first message stated 16 IR LEDs.

    IMO, there seems to be an obsecion these days about ICs and chips to do the work, yet in 90% of situations a transistor, or two, or MOSFETs can do the job and they are extremely inexpensive and fully obtainable, and rarely go "out of production".

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #10
    Fanatical Contributor Tim's Avatar
    Join Date
    Jan 2003
    Posts
    7,689
    Thumbs Up
    Received: 47
    Given: 95
    Total Downloaded
    1.32 GB

    0 Not allowed!

    Default Re: 16 leds to drive, how?

    Hi Les

    Note I'm driving 16 leds


    This is a long running project I need to measure the height of water in a tube to ~1 mm resolution. So I have 96 ir sensors stacked 0.8mm apart. On one side of the tube and will have 16 ir Leds on the other. The ir sensors are pressed up against the tube so as the water level rises the ir light from the leds gets attenuated and I detect this.

    If I go the pwm route then it would be good to use something like this http://www.farnell.com/datasheets/1756276.pdf

    Thanks

    Tim
    Last edited by Tim; 21st March 2019 at 12:24. Reason: Pointing out the number of leds I'm driving
    Tim

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #11
    Prolific Poster See_Mos's Avatar
    Join Date
    Feb 2004
    Posts
    1,299
    Thumbs Up
    Received: 17
    Given: 0
    Total Downloaded
    872.27 MB

    0 Not allowed!

    Default Re: 16 leds to drive, how?

    For the initial test I would consider 4 lines of 4 in series / parallel and an LM317 in constant current mode.

    If you want PIC control over the intensity then a PIC with an internal op-amp followed by a MosFET.

    just search for constant current.

    There was an LCD back light circuit I used previously that used a switching regulator and inductor as a constant current regulator but at the moment I cannot recall the IC part number.
    Last edited by See_Mos; 21st March 2019 at 17:51.
    My RAM is failing

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #12
    Prolific Poster shantanu@india's Avatar
    Join Date
    Feb 2007
    Posts
    1,701
    Thumbs Up
    Received: 7
    Given: 21
    Total Downloaded
    827.23 MB

    0 Not allowed!

    Default Re: 16 leds to drive, how?

    Quote Originally Posted by Tim View Post
    Hi Les

    Note I'm driving 16 leds


    This is a long running project I need to measure the height of water in a tube to ~1 mm resolution. So I have 96 ir sensors stacked 0.8mm apart. On one side of the tube and will have 16 ir Leds on the other. The ir sensors are pressed up against the tube so as the water level rises the ir light from the leds gets attenuated and I detect this.

    If I go the pwm route then it would be good to use something like this http://www.farnell.com/datasheets/1756276.pdf

    Thanks

    Tim
    Hi Tim,
    Just curious about the application which you have just explained.Seems to be an HVAC kind of application.
    Is it distilled water or commercial water?
    Commercial water would slowly stain the glass wall resulting in overall attenuation of the received IR spectrum.
    Hope you have taken that into consideration.
    Shantanu

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #13
    Fanatical Contributor Tim's Avatar
    Join Date
    Jan 2003
    Posts
    7,689
    Thumbs Up
    Received: 47
    Given: 95
    Total Downloaded
    1.32 GB

    0 Not allowed!

    Default Re: 16 leds to drive, how?

    Hello Shantanu

    It's not HVAC is for use with purified water (WFI standard) so pure it's corrosive!

    But staining of the glass is something I'm thinking about.

    I spoke to a friend of mine last night and was recommended to run on 12v as it will give me a greater head to reduce the current with. So now I will have 18 Leds made up of 6 blocks of 3 leds in series each with a current resisting resistor. Then PWM them to control the brightness. As the PWM will be controlled by the pic doing the reading of the sensor I can build in an algo to work out the transition value and recalibrate on the fly to compensate for discoloration and led degradation.

    Tim
    Tim

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #14
    Prolific Poster shantanu@india's Avatar
    Join Date
    Feb 2007
    Posts
    1,701
    Thumbs Up
    Received: 7
    Given: 21
    Total Downloaded
    827.23 MB

    0 Not allowed!

    Default Re: 16 leds to drive, how?

    Hope your detector has enough sensitivity to detect very small variations of incident light & sufficiently narrow bandwidth to be immune from ambient light(If you are enclosing the entire contraption inside a dark chamber then obviously ambient light won't affect!!)
    The recalibration-on-the-fly routine should be carried out for each & every IR transmitter-receiver pair with an empty tube & the values stored in an array. This array values would be used during the actual level measurement routine.
    Shantanu

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #15
    Fanatical Contributor Tim's Avatar
    Join Date
    Jan 2003
    Posts
    7,689
    Thumbs Up
    Received: 47
    Given: 95
    Total Downloaded
    1.32 GB

    0 Not allowed!

    Default Re: 16 leds to drive, how?

    Hi

    I and others have shown that the system works well and the important settings are the feed resistor on the sensor and the power of the ir output. Too much IR is the main problem seen so far.

    In my case the unit is enclosed. My main worry is that the IR will flood the sensor hence needing to be able to turn down the ir output.

    With the settings right you can get a 2v swing from water/no water. In use I will be reading the signal via an a/d converter and as I can control the water level be able to do water/no water signal comparison. I will as part of the calibration routine build a table that no only includes the level to ml calibration but base threshold and swing level change.

    Not 100% sure at this time how I will change things on the fly, mainly as I have no idea how it behaves.

    Tim
    Tim

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

    Thread Information

    Users Browsing this Thread

    There are currently 1 users browsing this thread. (0 members and 1 guests)

       

    Similar Threads

    1. Diffuser IR Leds (how)
      By Tim in forum The Lounge
      Replies: 19
      Last Post: 7th February 2019, 09:23
    2. Colour changing LEDs
      By chudson in forum Proton Plus Compiler v3
      Replies: 31
      Last Post: 28th April 2010, 10:22
    3. X Power Leds
      By pic-ignorant in forum The Lounge
      Replies: 61
      Last Post: 7th April 2009, 20:40
    4. [SOLVED !] driving bi-colour leds
      By spenol in forum Proton Plus Compiler v3
      Replies: 10
      Last Post: 10th July 2007, 20:08
    5. [SOLVED !] Grounding LEDs with a PIC
      By Don Stratton in forum Proton Plus Compiler v3
      Replies: 14
      Last Post: 20th June 2007, 17:51

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts