1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Electronics Controlling many 7-led digit number from a computer

Discussion in 'Modding' started by Elv13, 7 Mar 2010.

  1. Elv13

    Elv13 New Member

    Joined:
    26 Apr 2006
    Posts:
    107
    Likes Received:
    0
    Hi,

    For my new mod I want to have digit number on top of all of my hard drive (5 of them) displaying the used % of each drive. My electronic knowledge is not that big, so I need help. I have a programmer background, assembly included, so I can code chips, even if I never did so. I can also make my circuit board in acid, weld, design circuit using some EDA software and with some work, well, understand what I am doing.

    That's it, it's about all I can do right now. That's not quite enough to do that project, I have no idea how to start, atmega, pic, picaxe? And how to handle 10 digit from 1 port? I think I will need one master chip and 10 slave, but that mean using one wire to call 7 signal (one for each digit led), so how can it be done? Binary, different voltage, telegraph like algo? I really don't know where to start all this. The more coding and less electronic would be the best solution for me, but I know it will take quite a lot of electronic work. I would like to use USB, USB-serial or the DB-9 serial port to communicate, but audio or parallel can work too if it is simpler. I understand the scale of this project, and how much knowledge I miss to complete it, but I will do it anyway.

    http://www.bond-led.com/pic/led-digit-display-02.JPG

    I will be using Linux, FreeBSD or Solaris to control the led (embedded ARM based system), but I can write the driver, it's just matter of I/O binary after all.
     
  2. ChromeX

    ChromeX New Member

    Joined:
    12 Aug 2004
    Posts:
    1,605
    Likes Received:
    22
    This wouldnt actually be all that hard to do, i've got a fair bit of knowledge with PICS so i'd use one of those, but you migt want to use something else. All of your segmented displays can be operated using one pic, arranging them like in the diagram:

    http://yfrog.com/esbitworkj

    As you can see, the segs are turned on by making the individual pin from port C high and making the individual LEDS light by making the corresponding pin on port D low. In code you would have to store the bit patterns for the numbers 0-9 but thats easy enough:

    for 0
    a b c d e f g (segment letter)
    0 0 0 0 0 0 1 (bits on port D)

    for 1
    a b c d e f g
    1 0 0 1 1 1 1

    ETC

    The way to show more than one 7-seg at once is to make them cycle so fast (on port C) the persistance of vision makes it look like they're always on. You only need to cycle them about 50Hz each to achieve this.

    The only real difficulty is getting the data onto the pic from the serial port to begin with. It would require programming on the PIC to handle USART comms and programming on the host machine to actually send data. I've got no idea how you'd do the programming to send HDD data to the serial port from your computer; but if you want some schematics I can help you out. You're project is very similar to something we did in second year of my degree.
     
  3. Elv13

    Elv13 New Member

    Joined:
    26 Apr 2006
    Posts:
    107
    Likes Received:
    0
    Thanks for answering my question. The part about how to get the data from the hdd to the serial port is the easiest. As my NAS servers (where I want those 7 segment) are running Linux, the "everything is a file" approach make it very simple. I just have to read the socket file from the harddrive and calculate the delta every second, really simple, no API, dll or guess, just reading a file. I love Linux just for that. The serial port is also a file, I just have to write the data in that file. I have to set the bitrate prior to do that (also a file), I think that the default one is too fast for what a PIC can handle.

    One thing I does not understand from your post is how to make every 7-segments independent? How can I know on which 7-seg the value will show up?

    As I understand what you said, I have 'X' time 50 "push" per second and each 7-seg capture 1/X to display data. Is that correct? Then how can they be synchronized?
     
  4. StudioRecorder

    StudioRecorder Mobo's need Fabo's for company!!!!!

    Joined:
    14 Jan 2010
    Posts:
    85
    Likes Received:
    1
    if you use a large enough pic (something like a 24 pin one which i think they do) then you can use 4 outputs per display by having a 7 segment decoder chip between the 2.
     
  5. Elv13

    Elv13 New Member

    Joined:
    26 Apr 2006
    Posts:
    107
    Likes Received:
    0
    Yes I understood that, it was in my later design. As ChromeX does not seem to see my PM, I will post the later version here
    [​IMG]
    In that design, I use a single 7 segment, but I could use a double one. It so it will take only one more pin to control, so I can use the 8 RD pin to control the 7 segments and RC and RB to drive which 7-seg will be turned on. It will give me 16 possible 7-seg, but as I will only use 10, I can the the other one to control LED and bipolar LED with an AND gate and an inverter (not sure if the inverter is needed if I do it right the first time). So I can drive 48 simple LED or 24 bipolar one, or 16 RGB LED. I will design those part later as they can be plug and play on my PCB.

    My question now is how to connect the MAX232 and the PIC? And is the transitor from ChromeX plan really needed at all? I don't see what it add to the whole circuit.

    I will use recycled IDE bus to connect modules from the PCB to smaller PCB with the 7-segments and resistor. Other small PCB will be LED too or even a fan with a capacitor and a transistor to keep the motor spinning.

    But will a single PIC be fast enough to keep up with that much logic while keeping an high HZ cycle on the 7-seg to they look to be always on?
     
    Last edited: 19 Mar 2010
  6. Elv13

    Elv13 New Member

    Joined:
    26 Apr 2006
    Posts:
    107
    Likes Received:
    0
    Arg, just saw a post on lifehacker that gave me some help, even if it was not related. It was so simple after all... LPT1 use a 16bit mask to turn voltage on an off on most pins. The voltage was right, no need for anything. just a wire between an old printer cable and the 7 segments
     
  7. Smilodon

    Smilodon The Antagonist

    Joined:
    25 Mar 2003
    Posts:
    6,244
    Likes Received:
    102
    The problem with the method used so far is the multiplexing. You want to control 15digits. That means that you will get a duty cycle at about 6,5%. The flickering will probably be noticeable, and the displays could dim a bit (unless you beef up the current, but this is a bad idea).


    Why not use a PIC with buildt in USB support and a bunch of BCD->segment decoders?

    If you do that you will need 4 pins that outputs a binary code to the decoders (one for each display). And one for each display for the multiplexing.

    If you use a 4511 CMOS chip for each digit you will also have a latch function which mean that the display will show the number you send to it until the latch input goes low. The drawback here is that you will need a total of 34 outputs from the pic. (4 for bcd, and 15 for multiplex and 15 for latch.) If you drop in a couple of 4017's you could get away with using only one pin for latch. You will need to be careful in your coding if you use this, though. You will also need to figure out which output is high at power on. (The 4017 will simply set one output high and advance one pin for each clock cycle.)

    The good thing about the latter solution is that you will get the benefits of multiplexing without the annoying flickering. It will cost you a bit more to make, though.

    Oh, and the 4511 can supply a bit more current than the PIC (25mA vs 20mA IIRC) if you ever need that.


    edit: a bit more info about the 4000-series CMOS chips: http://www.kpsec.freeuk.com/components/cmos.htm
     
  8. capnPedro

    capnPedro Hacker. Maker. Engineer.

    Joined:
    11 Apr 2007
    Posts:
    4,381
    Likes Received:
    241
    Why not have a 4511 for each digit (15 or 10 if you wanted to round 100% usage down to 99% or show free space instead) with an NPN transistor on the store pin and your BCD lines all tied together. Connect the transistors to relative pins on a pair of cascaded 4017s (to make a base 18-counter - you don't need every output) and connect the clock pin to your uC. Tie the last output pin to the reset pin but also make sure the uC can control the reset pin too. You now only need 6 pins on your uC.

    You would need a variable to know which output of the 4017s is high at any time. Reset the counters in a setup method, then just step through every digit (by putting a rising edge on the 4017s clock pin) and just before you do, set the BCD output lines to display the digit that should be shown.

    I reckon I've explained this really badly... I hope you understand it.


    (Or you could implement an i2c type system!)
     
  9. capnPedro

    capnPedro Hacker. Maker. Engineer.

    Joined:
    11 Apr 2007
    Posts:
    4,381
    Likes Received:
    241
    Just a quick follow up...

    Behold, the 4017 which will always start at Output 0:

    [​IMG]

    The hanging diode would connect to the output which you want to trigger the reset from and you can add a third diode so you can trigger the reset from the microcontroller.
    (The diodes act as OR gates)

    And here's the extract from the Motorola datasheet I was thinking of when talking about cascaded 4017s:

    [​IMG]

    Pretty cool and all you need is an AND gate (I have a couple of 7408 quad AND gates in my stock of prototyping parts, but I've not seen a single/dual unit).

    You probably won't end up using this, but it's good information for anyone looking for it. :lol:
     
    Last edited: 8 Aug 2010

Share This Page