Scoreboard rebuild from discrete components to PIC

Discussion in 'General Electronics Chat' started by chrischrischris, Mar 29, 2015.

  1. chrischrischris

    Thread Starter Member

    Feb 18, 2012
    283
    10
    Hi.
    With the help of members in the forum, in 2013, a novice like me I completed a fully functioning scoreboard with home score, away score, timer, clock, and temp display. I made each of the 15 large digits (common anode) from 330 LEDs - that was alot of soldering!!!. Each segment draws either 105mA max or 120mA (depending on which segment it is).

    I was toying back there to eventually run this via microcontrollers instead of discrete components. In my thread called "count down timer for my soccer club", someone on the forum called "MMcLaren" suggested the use of 4 x MIC5891, however I can't contact him to chase this further (see part picture below of an image he sent me):
    [​IMG]
    However, since then I've been told that I can use 15 x TPIC6B595N shift registers. I'm told these can drive 150mA each pin, so I think this might be the best solution. I also think they don't need any external mosfets, etc. I want to drive this via code written in Arduino. Can I please get some feedback as to whether this is a good way to go. Thanks in advance.
     
  2. MMcLaren

    Well-Known Member

    Feb 14, 2010
    759
    116
    Hi Chris,

    For a non-multiplexed display, I don't see why you couldn't use fifteen 8-bit serial-to-parallel TPIC6B595N "sinking" drivers on the cathode segments of the common anode displays...

    Good luck on the conversion.

    Cheerful regards, Mike
     
    Last edited: Mar 29, 2015
  3. MCU88

    Member

    Mar 12, 2015
    360
    35
    Yeah you could do the whole project with an single 40-pin PIC 16F877a coded in mikroC...
    • Download demo version of mikroC (FREE)
    • Purchase K150 PIC programmer (10-dollar eBay)
    • Buy MCU chip (2 dollar eBay)
    Easy greasy...
     
  4. MMcLaren

    Well-Known Member

    Feb 14, 2010
    759
    116
    Could you elaborate, please? Are you talking about multiplexing? If so, would you scan digits at 1/15th duty cycle which would require driving each segment at fifteen times 105-ma (1.757-A), or would you scan segments at 1/7th duty cycle which would only require driving each segment at seven times 105-ma (735-mA)? It seems to me you'd need some pretty hefty drivers of some sort.

    Cheerful regards, Mike
     
  5. MCU88

    Member

    Mar 12, 2015
    360
    35
    Of course I am talking about multiplexing. With the duty cycle I would toy with it until I got adequate brightness from the displays... I have made huge matrix moving message displays using just one PIC 16F628a and decade counters for the columns. The duty cycle being an mere few % for each column. The LEDs were just bright enough as an result. Yes you would need some drivers. I would probably just go with super / darlington transistors.
     
    Last edited: Mar 29, 2015
  6. chrischrischris

    Thread Starter Member

    Feb 18, 2012
    283
    10
    Hi Mike, good to hear from you again and thanks for the reply. From your previous sketch (with the MIC5891) you linked what I think is the "data", "clock" and "latch" of all registers. Is that correct? If this is the case, are the signals somehow sent via multiplexing? Also, from the data sheet I can't see how to dim the digits with these registers - I assume I can somehow send a PWM signal?

    MCU88 - you may be right that using a 40 pin PIC may be a "neater" solution, however I'm only comfortable at the moment with Arudino programming. Also as Mike highlighted, I'm trying to steer away from multiplexing. I'm not willing to sacrifice longevity of the LEDs by pulsing higher than 20mA current at 1/10 duty cycle / 0.1ms pulse width. But thanks for the suggestion.
     
  7. MCU88

    Member

    Mar 12, 2015
    360
    35
    Personally I would toy with the duty cycle in the C code until I got adequate brightness from the LEDs.
     
  8. MMcLaren

    Well-Known Member

    Feb 14, 2010
    759
    116
    Hi Chris,

    That multiplexed circuit example is probably not a good choice given the high current displays you're using.

    In your new non-multiplexed design, you could connect all of the TPIC6B595 output enable pins together and drive them with one of the Arduino PWM outputs for brightness control. If the Arduino PWM output is active high then display brightness will be inversely proportional to the PWM duty cycle. That is, setting a 0% PWM duty cycle will give you full brightness and setting a 100% duty cycle should leave the displays dark.

    You've got lots of ways to update the displays. You could daisy-chain all fifteen TPIC6B595 drivers using only three pins on the Arduino but then you'd have to shift out eight bits of data for all fifteen displays (120 bits) even if you only wanted to update a single display. You might consider driving the CLK and DAT lines for all fifteen displays in parallel and then simply pulse the individual LAT line for the particular display you want to update. In effect, you'd be loading all fifteen shift registers with new data but you're only copying (latching) the shift register data onto the outputs of a single display driver. If you're short of Arduino pins you could probably use something like a 74HC154 as a de-multiplexer to drive the fifteen driver LAT lines. Using a 74HC154 would require four Arduino pins to select one of the sixteen outputs and another pin to dispatch the LAT pulse through the selected 74HC154 output.

    I am concerned about the amount of current going through the TPIC6B595's. Check the Datasheet carefully and experiment for proof of concept.

    Take care... Have fun...

    Cheerful regards, Mike

    PS:
    I never did tell you how awesome I thought your Scoreboard project turned out.
     
    Last edited: Mar 29, 2015
  9. Wendy

    Moderator

    Mar 24, 2008
    20,766
    2,536
    One of the problems you face is the max you will get is a 25% duty cycle per digit. I suspect you will need a conversion table in a 5th uC to translate the brightness level seen by the LDR to the appropriate duty cycle to the digits. To me this implies some sort of OR/AND mechanism to the drive MOSFETs Q1-4 to provide dimming, reducing the max duty cycle to a non-linear reduced duty cycle to adjust the brightness to some thing you are happy with.. Basically your thoughts on increasing current to the LEDs seems sound.
     
  10. MCU88

    Member

    Mar 12, 2015
    360
    35
    [​IMG][​IMG]
    Here's a very infamous 245 LED moving message display that I did back in 2006 http://www.picbasic.co.uk/forum/showthread.php?t=6033
    2.8% duty cycle to be exact. A lot of interest in the project, but people were having BIG problems building it. The thread was shutdown by administrators and the project labelled a 'train wreck'

    Lol ...
     
  11. Wendy

    Moderator

    Mar 24, 2008
    20,766
    2,536
    One of the problems we are facing is the digits are very large, Chris can remind me of the size. This means a lot more LEDs than usual, not to mention being a lot brighter than average. The 150ma spec mentioned earlier may not be enough, but in most cases it would be.
     
  12. MCU88

    Member

    Mar 12, 2015
    360
    35
    Bill,
    Can all be tailored in the C firmware to suit requirements. I don't see much point of using an microcontroller if multiplexing is out of the question. I'd personally zip this whole thing up with just one 40-pin MCU...
     
  13. Wendy

    Moderator

    Mar 24, 2008
    20,766
    2,536
    Didn't say not to use MX, but the need for extra parts for current drive may not be avoidable. Kinda like with Q1-4 in the original schematic, they are so beefy that they will not get a bit warm. Drivers for the LEDs will probably be needed. Remember, this is a very large outdoor scoreboard we are talking about that will be in sunlight..

    My sense is this is a work in progress, with lots to be determined left.
     
  14. elec_mech

    Senior Member

    Nov 12, 2008
    1,513
    193
    Still love this project. You took an idea and with time, dedication, and patience turned it into a finished, robust, working product for your community. I love that so many of us were able to help out in this effort.

    I would have originally suggested a multiplexing IC like the MAX7219, but MMcLaren and yourself make excellent points about the cons of high pulse current in this application.

    I took a quick look at a portion of one of your schematics. It appears you're using common anode displays and a MOSFET controls the brightness. You could keep this going and simply swap the existing MOSFET with a logic-level one with the same or higher current rating. This will allow you to connect the Arduino directly to the MOSFET in order to control the brightness.

    So, is it safe to say you'd prefer to just drive each segment directly?

    I don't know if this is any better or not, but you could use an I/O expander IC like the MCP23017 with a ULN2003 (7 outputs) or ULN2803 (8 outputs). The latter will sink up to 500mA. The MCP23017 has 16 outputs and would communicate to the Arduino through a protocol called I2C which only uses two wires. You can set the address of each MCP23017 different from one another which would allow you to control multiple of these from just two pins on the Arduino. I can draw something up if you like. There is an SPI version if you prefer, the MCP23S17. This requires 3 Arduino pins two of which are shared by all IC's and one dedicated to each IC - in other words, total Arduino pins required would be 2+# of MCP23S17 IC's used. This is why I like the I2C version, but both have their pluses and minuses.

    Are you planning to change out the insides of your display or build a new one altogether? If the former, could you post a complete schematic of the existing circuit? This will allow us to make suggestions that better minimize the amount of rework you'll undertake.
     
  15. MCU88

    Member

    Mar 12, 2015
    360
    35
    Of course current drivers will be needed. The PIC is good for 20mA of current at best. I too would use some beefy TIP series super transistors in an TO220 case. But we are not talking about PICs here, since the OP is stuck on using Arudino. Which I personally know next to nothing about. The title of this thread states PIC, but the one thing I do know is that Arudino uses Atmel MCUs. Nothing I can say to convince that mikroC is likely just as easy as Arudino? Then we could use an 40-pin PIC from scratch.
     
  16. Wendy

    Moderator

    Mar 24, 2008
    20,766
    2,536
    I would be tempted to use catch and hold circuits, even an analog one as described in my article LEDs, 555s, Flashers, and Light Chasers, Chapter 12 Special LED Effects (Fading LEDs, Comet Trails). It may not be useable, or it might provide an interesting fading effect between two numbers.

    It could be done digitally too of course, with catch and hold latches (built into the displays themselves perhaps).

    There is an old old expression from Albert Einstein, Make things as simple as possible, but no simpler. The extra current requirements may require some extra complexity, but the uC will provide an offsetting simplicity that is to be desired.
     
  17. MCU88

    Member

    Mar 12, 2015
    360
    35
    Bill, the code that tells the uC what to do is not simple. I've done about 5,000 hours of programming just to be able to say "Yeah I think I can make this work. I know a way, but someone else's way is probably better!"
     
  18. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,815
    835
    BTW, there is a 54 pin Aduino. The Arduino Mega 2560. I used it for my last project. (Not for the number of pins, but for the program memory size my case)
     
  19. MCU88

    Member

    Mar 12, 2015
    360
    35
    There are MONSTER sized modern PICs with the computing power of the late 90s. Personally I am about an decade obsolete with hands on experience with PICs. I am stuck in my ways with the 16F628 and the 16F877a.
     
  20. chrischrischris

    Thread Starter Member

    Feb 18, 2012
    283
    10
    I did just have a play with duty cycle with 4 x 1/2" single 7 segment displays (20mA normal, 160mA max @ 1/10 duty cycle and 0.1ms pulse width). I ran them via 2n2222 NPN transistors. What I found was I couldn't match the intensity of 100 duty cycle without raising the pulse really high. Given my "actual" digits are made up of 360 odd LEDs each, I don't really want to pulse them high at all if I can help it, as it would be a pain to get up on this scoreboard to replace single LEDs if they burnt out. The longer they last - the happier I'll be. But thanks for the suggestion. It was the way I was going to go originally.
    Yes, I didn't think it was exactly what I'd need, but a great starting point - thanks for the initial suggestion.
    Sounds promising, but sorry for my ignorance, are these the "drain" pins in my case (pins 4 to 7 and 14 to 17)? If so, do you mean all the pin 4s together, then the pin 5s, etc, then somehow multiplex? I think I need to try research a bit more and forward a sketch as a question. The Arduino PWM output I do understand.
    If this is doable, and simply need Arduino code to do this, then it might be the simplest.
    Yes, this is what I thought of too. Again, I'll have to sketch something up. I was considering using an Arduino Mega that I have. It has 54 digital I/O pins of which 15 can be PWM output as well as 16 analog inputs. I did want to include building the board from scratch however on my new board, but I think due to the small chip might be difficult as comparted to the larger Arduino Uno chip. The 74HC154 is tempting however.
    The current for the TPIC6B595N is "Continuous drain current, each output, all outputs on, ID, TC = 25°C = 150mA". I assume this means 150mA per output continuous sinking, so should handle my 120mA and 105mA segments ok.
    I would like if possible not to duty cycle the digits. I'd rather more hardware if I have to so I can run at 100% d.c. and say 80% normal LED current rating so as to extend their lives.
    MCUU8, please don't go anywhere, a rolling message is my next project. The soccer club have asked if I can add that as a separate item and I know it's possible. I even have my local voluntary fire brigade that I'm part of asking if I can make one for them to put on the fire station tilt up door. We don't have the money to buy one.
    Can you check out the attached file of one of the digits (or part thereof). I hope I've got the common anode and sinking right with the PIC.
    It's amazing what can be accomplished in numbers. Thanks again everyone.
    I "think" between the PIC and the arduino I can control brightness. I need to study more
    Yes, I think that's best thing to do here for longevity of the displays. I'm trying to do away with ULN2003's however it worked well the first time. I just want to see what the PICs can do on their own. Soon I'll come up with a concept sketch only, that can be melded into working order. I want to keep simple if possible. I'm planning on removing the 5 boards in the display and replace with a single one. This way when we create our next soccer pitch (yes, next one - construction starting this year), I can build a second new improved scoreboard as well as altering the existing one.
    Yes "dj", you read my mind. I will was considering using this one as mentioned above in this reply. Also MCU88, again I'm trying to steer to what I can easily (cough, cough) write up in Arduino, else I'll probably have to have someone else fully write my code and that's not as fun.

    Sorry for the long reply - just wanted to capture all. I'm now just wondering, do I buy the PICs and experiment (Easter break is coming up), or do I hold off? I'm getting itching fingers.....

    (PS. The 2 attachments - first one is a layout of the digit setup, and the second one shows all the digits and boards on my lounge room floor - I have a very patient wife!)
     
    Last edited: Mar 29, 2015
Loading...