LED Bargraph chip (guitar LED bling-age) ..do with a PIC?


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by toneman View Post
    Hey Hank,
    that's just a LED VU meter using a bargraph IC.
    3915 is log while the 3914 is linear.
    I'm using the 3914 with a PIC in a BatteryMonitorSystem(BMS) that I
    am working on. For monitoring 18 batteries in real time.
    U don't really need a PIC for this simple VU meter.
    I've seen several "light shows" circuits using LEDs and bargraph ICs.
    IIRC, Craig Anderton had a "blinky light machine" using bargraphs.
    that's all I got for ya..... afn Tone
    Thanks Tone,

    I guess it's the log that would be most useful on a guitar. (the reason I want to use a PIC, is I'm putting on in my guitar anyway & it has lots of unused pins still! BLING!)

    Just thinking here that to get the LEDs to fade rather than abrutly cut off, would problably need nothing more than a capacitor.

    So...how on earth can log calculations on an analogue input be achieved on a PIC?

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default

    With a PIC it is a little difficult to do all the math and stil have time for the A/D and display.

    Also for the Log function you might need floating point calculations (even slower...).

    If 55-60db dynamics are enough for you with linear response then you have to:

    1. amplify the signal to be in the range of 0-5 volt
    2. use an absoluter value converter to feed the A/D of the PIC with just positive voltages
    3. setup PIC to continusly read the analog value, make a small average and display it

    If you insist on making it logarithmic then use an CA3089 or CA3189 chip and take advantage of the log amplifier that is used for the AGC and S-meter.

    And if you want to do the math way, have a look at http://www.emesys.com/BS2math3.htm#Logtable

    Ioannis

  3. #3
    Join Date
    Feb 2009
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    Hank and all,
    I still think a PIC is overkill. Even if U have "extra pins" LOL!!
    It's the software that will drive U insane!!! LOL!!!!!!!
    The 3915 (and 3914) **are** A-2-D converters!
    They are known as "flash converters" cause they just use a bunch of
    comparators and convert the input V either to a bar or a dot...in a FLASH!
    Really cool (and complex) would be to use a hexphonic guitar like a Roland-Ready Stratocaster and tap off the six preamps inside and split to six bargraphs!! IIRC, the bargraph IC just needs 2.5V for max level.
    I'm using an expanded scale to measure a narrow voltage range for my BMS.
    I also use a divide-by-2 attenuator to scale the approx 6V down.
    For regular strat PUs, U should still use a singlesupply opamp as a preamp/buffer. I think either lin or log ICs would work fine.
    The trick is to dial the gain of the preamp(direct from PUs), and dial in the bargraph to make a responsive looking display. Then, if U ran to 3 filters, low, mid, hi, U would have a triple LED bargraph lite show on your Axe!
    But, where would U put all those LEDs?!?!?!?
    LOL!!! <shakes his head> :-)

  4. #4
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by toneman View Post
    Hank and all,
    I still think a PIC is overkill. Even if U have "extra pins" LOL!!
    It's the software that will drive U insane!!! LOL!!!!!!!
    The 3915 (and 3914) **are** A-2-D converters!
    They are known as "flash converters" cause they just use a bunch of
    comparators and convert the input V either to a bar or a dot...in a FLASH!
    Really cool (and complex) would be to use a hexphonic guitar like a Roland-Ready Stratocaster and tap off the six preamps inside and split to six bargraphs!! IIRC, the bargraph IC just needs 2.5V for max level.
    I'm using an expanded scale to measure a narrow voltage range for my BMS.
    I also use a divide-by-2 attenuator to scale the approx 6V down.
    For regular strat PUs, U should still use a singlesupply opamp as a preamp/buffer. I think either lin or log ICs would work fine.
    The trick is to dial the gain of the preamp(direct from PUs), and dial in the bargraph to make a responsive looking display. Then, if U ran to 3 filters, low, mid, hi, U would have a triple LED bargraph lite show on your Axe!
    But, where would U put all those LEDs?!?!?!?
    LOL!!! <shakes his head> :-)
    Funny you should mention Roland GK (as it goes I'm well into midi guitars - this is me )...becuase I'm presently designing a 6ch HEX sustainer driver to bo on my guitar (note: not a pickup.....the very opposite in fact), furthermore, I'm having to design my own bobbins in CAD, then cut them on a CNC machine I built (out of dot matrix printers!), so I can therefore cater for 6 LEDs to be mounted within the bobbin itself. (I already intend having an LED light under each string when it's plucked but figured an LED bargraph might be cool too!)

    Re getting the guitar signal level up ....well my sustainer driver circuit alreeady does that. I simply want to go ther PIC route to save PCB real estate (there's not a lot of room in a guitar for big PCBs), & like I say, I'll already have a PIC on the PCB. I use the PIC for digital AGC for my sustainer (basically I AtoD the amplified incoming analogue signal then make some gain decision based on the corresponding DC level....with that in mind, I guess I'm 70% of the way there for LED bling already!

    I think I'll give it a pop regardless...it ought to be fun....& like I say, you can never have enough LED bling!

    Thanks for you comments.
    Last edited by HankMcSpank; - 10th July 2009 at 08:32.

  5. #5
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Ok, my first attempt. I'm a beginner, so I welcome any comments towards a more efficient way of doing what I've just done (see code below)

    I'm using the Microchip low count board...which only has 4 LEDs - the code I've kludged together below works fine as I turn the potentiometer on the Low Pin Count Board.

    I don't think doing 'log' will be so tough after all (on account, there'll only be six LEDs involved when this is on the guitar, just a matter of tweaking with those individual thresholds to get it looking 'right').

    My next attempt will be to get a sample & hold vibe going down (which I'm thinking will just be some form of short 'pause' in each of those 'blocks' & some resistors/caps in series with the LEDs?)

    Code:
    Start:
    ADCIN 2, DC_In ; Read the DC level IN
    DC_In = DC_In /2 '256 is too much resolution...cut it down by 50%
    IF DC_In < 10 THEN
    low PortC.0 
    low PortC.1 
    low PortC.2 
    Low PortC.3
    endif
    IF DC_In > 25 THEN
    HIGH PortC.0 
    low PortC.1 
    low PortC.2 
    Low PortC.3
    endif
    IF DC_In > 55 THEN 
    High PortC.0 
    High PortC.1 
    low PortC.2 
    Low PortC.3
    endif
    IF DC_In > 85 THEN
    High PortC.0 
    High PortC.1 
    high PortC.2 
    Low PortC.3
    endif
    IF DC_In > 110 THEN
    High PortC.0 
    High PortC.1 
    high PortC.2 
    HIGH PortC.3
    ENDIF
    GOTO START
    end
    Last edited by HankMcSpank; - 10th July 2009 at 13:59.

  6. #6
    Join Date
    Feb 2009
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by HankMcSpank View Post
    Ok, my first attempt. I'm a beginner, so I welcome any comments towards a more efficient way of doing what I've just done (see code below)

    I'm using the Microchip low count board...which only has 4 LEDs - the code
    which board??? which PIC??
    I'm assuming U R using PicBasicPro(?)


    Quote Originally Posted by HankMcSpank View Post
    just a matter of tweaking with those individual thresholds to get it looking 'right').
    yes, this applies to analog and/or digital.


    Quote Originally Posted by HankMcSpank View Post
    My next attempt will be to get a sample & hold vibe going down (which I'm
    S&H usually refers to a gated analog capacitor with a HiZ buffer.
    In digital "terms", U are storing the value(s) in binary and "delaying" the output processing via conditions.
    Since U are already processing the input voltage signal level(one) for the digital AGC,
    U already have the info. Just output it to a bunch of LEDs.
    The refresh rate needs to only be fast enough so that it looks good to the eyeballs.

    Sounds like a very interesting project.
    Have U visited the DIYStompbox forum?
    There is a "digital" section.
    afn
    T

  7. #7
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by toneman View Post
    which board??? which PIC??
    I'm assuming U R using PicBasicPro(?)
    This board ( with a 16f690 which is part of the PICKit2 beginners setup)...

    http://ww1.microchip.com/downloads/e...e%2051556a.pdf

    Quote Originally Posted by toneman View Post
    S&H usually refers to a gated analog capacitor with a HiZ buffer.
    I've read that more than once...no matter how many times I read it, it's still not sinking in (the gated capacitor bit!)


    Quote Originally Posted by toneman View Post
    Sounds like a very interesting project.
    Have U visited the DIYStompbox forum?
    There is a "digital" section.
    I haven't but I will.

    Re that code I posted above, hmmm, well - after posting it up, I realised it's not what I want (damn it...wish they had a delete button!) - it's just a simple LED level representation of signal level. What I want (what I really, really want) is a sample /hold representation ...I've spent a frustrating couple of hours, trying to do this with the PIC...it ought to be a piece of wII, but I actually spontaneously combusted (freaked the wife out a bit I can tell you...only because it made a terribly mess on the sofa)...just got back from the burns unit - I'll have another go, but will keep a fire blanket handy.

    re the project - yep, it is a good 'un....all the elements are coming together, this LED level indicator is just bells whistles - totally unnecessary, but much sought after nevertheless!
    Last edited by HankMcSpank; - 11th July 2009 at 20:50.

Similar Threads

  1. Calulating BJT base resistance for PIC led switching?
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 20th November 2008, 08:41
  2. new and need help
    By smeghead in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd November 2008, 20:19
  3. Camera with PIC chip
    By The Master in forum Off Topic
    Replies: 5
    Last Post: - 1st July 2008, 14:28
  4. PIC chip resetting. Very weird
    By The Master in forum Off Topic
    Replies: 0
    Last Post: - 28th October 2007, 17:07
  5. Help on coding/ selecting PIC chip for project
    By lovemeok in forum General
    Replies: 0
    Last Post: - 27th July 2006, 19:21

Members who have read this thread : 0

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