One of 33 LED output Indicator


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2009
    Posts
    50

    Default One of 33 LED output Indicator

    I have 7 relays configured in binary fasion. They then represent 0-128 in digital.

    I want to scan/read the state of the relays continuously light up a single LED to indicate the relative position on a 33 LED bargraph.

    Example 1:

    1) The relays that are ON represent say digital value of 128.
    2) Light up only the 16th LED on the bargraph. This represents 100% of the output.

    Example 2:

    1) The relays that are ON represent say digital value of 64.
    2) Light up only the 33rd LED on the bargraph. This represents approximately 50% of the output.

    Example 3:

    1) The relays that are ON represent say digital value of 5.
    2) Light up only the 1st LED on the bargraph. This represents approximately 4% of the output.

    Would like to use 16F628a or another better choice?

    Since only one LED is lit, the current draw is limited to 10mA when turning ON any of the 33 LEDs.

    Any suggestions?

    Thanks for you help!
    Russ

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,803


    Did you find this post helpful? Yes | No

    Default Re: One of 33 LED output Indicator

    Since 628 has not enough outputs, maybe a serial to parallel chip will help you. Say a 5 x 4094 (total 40 outputs).

    You feed serially the data to the SIPO (serial in - parallel out) and directly drive your LEDs.

    As for the software I see no other solution that Lookup table. Maybe others come up with another idea.

    Ioannis

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,520


    Did you find this post helpful? Yes | No

    Default Re: One of 33 LED output Indicator

    Shiftregisters are probaby the easiest/quickest way. There are dedicated constant current LED driver chips with serial input available (like the classic MAX7219 or perhaps TLC59282 (just one that I found now)). Or you might want to look into Charlieplexing. I think you might have just enough pins on the '628 to do it.

    Sidenote: For 7 bits the range i 0-127, not 0-128.

    /Henrik.

  4. #4
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default Re: One of 33 LED output Indicator

    I agree with Henrik. You could Charlieplex 30 LEDs using six pins or up to 42 LEDs using seven pins. Or add a 74HC595 or a driver IC and multiplex the LEDs. Here's a multiplexed example for 32 LEDs that only requires five pins using my MacMux interface method (below).

    Happy Holidays and cheerful regards, Mike
    Attached Images Attached Images  

  5. #5
    Join Date
    Jan 2009
    Posts
    50


    Did you find this post helpful? Yes | No

    Default Re: One of 33 LED output Indicator

    Thanks for all your replies!! I think my best bet is a serial programmable chip like the MAX7219 or even the AMS AS1116 (http://www.ams.com/eng/Products/Ligh...ver-ICs/AS1116)

    The AMS AS1116 is much less expensive than the MAX7219/7221.

    OK, now I have never programmed these types of IC's. These ICs use an "SPI" interface?

    Any coding examples for this for turning ON/OFF any one of the 64 LEDs?

    Thanks!!
    Russ

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: One of 33 LED output Indicator

    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Jan 2009
    Posts
    50


    Did you find this post helpful? Yes | No

    Default Re: One of 33 LED output Indicator

    I know zip about using ShiftOut and cascading 74HC595 shift registers. I do not understand how to program a cascaded 74HC595's.
    Even looking at that code:
    http://www.picbasic.co.uk/forum/show...ght=smart+star
    I do not really understand what is going on line-by-line.

    Any primers or tutorials on this?? I think using 74HC595 shift registersn would solve my issues.
    Help!
    Thanks!!

Similar Threads

  1. About the replacement of the indicator with BASIC.
    By apollo21 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 8th June 2008, 04:56
  2. open drain output as digital output?
    By droptail in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 10th November 2006, 03:11
  3. 2 PWM output
    By Md.Shah in forum mel PIC BASIC
    Replies: 3
    Last Post: - 9th October 2006, 22:38
  4. Replies: 2
    Last Post: - 20th January 2006, 21:09
  5. Temp. Indicator.
    By PIC Coder in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 28th April 2005, 06:10

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

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