Custom built 16×32 (40) LED Matrix controlled by Arduino

arduinoclockcodematrixmultiplexer

I am planning to build a clock / thermometer / info display. I have ordered 10 pieces of 8×8 LED matrixes from ebay (http://www.ebay.co.uk/itm/331064583297).
As this is not a pre-built one I have got to design some sort of circuit which will be able to do the trick.

  • The commercial ones work by segments, each 8×8 is one segment and you has to shift the code though each segment to get to the last one. (I would rather go this way as this requires more components.)
  • My idea is to make it one big Matrix, not 8 smaller one. A TLC5940 or two 74hc595 would be able to control the lines and i would be able to controll this way the colls as well. (2 TLC5940 or 4 74hc595). (Or 5 74hc595-s and make it 16×40)

So I think I have got this part figured (maybe not share your ideas), but how am I going to display text on these pixels? How am I going to produce the "image" (the array), which should be shifted out? (Not to mention running text, animations, etc..) I am not quite sure how this is going to work.

Oh and the Arduino can be any type, I prefer the MEGA2560 so we don't have to worry about the program size. And I will be able to hook up my RTC, Ethernet Module, Temp sensors, buttons, etc…

Every bit of info is a plus on this. The displays will arrive in 3-4 weeks so it would be nice to have this figured by the time they arrive.

Best Answer

You have a few different layers here:

  • Hardware (actual electrical connections, and chip selections)
  • Display Driver software
  • Text/Graphics Rendering software

I recommend solving these problems individually.

On the hardware side, you have to find a datasheet that gives you the pinout for the modules (it doesn't appear included in the listing, and until you know how the LEDs connect to the pins, trying to choose a driver chip is a waste of time)

For the display driver, you want something like: display_pixel_draw(x, y, on_or_off)

For text rendering, your best bet would be to look for some open-source, monospaced console fonts. Then you represent a character with something like this:

struct display_character{
    boolean active;
    uint16_t x, y;
    uint8_t bitmap[8];  //< 8 * 8-bits == 8x8 display
}

If you wanted to make them all scroll off the right edge, you'd do something like

static displayed_characters[MAX_DISPLAY_CHARACTERS];

#define SCROLL_DELAY_MS 50
#define SCROLL_X_INCREMENT  1

// some init code for your characters

while(any_characters_visible()){
    for(uint16_t i = 0; i < MAX_DISPLAY_CHARACTERS; i++){
        if(!displayed_characters[i].active){
            continue;
        }

        // Make the character move right
        displayed_characters[i].x += SCROLL_X_INCREMENT;

        // Pass a pointer to the character to the render function
        render_character(&(displayed_characters[i]));

        // This function will mark the character as !active if it scrolled
        // off the display (meaning you can re-use it for something else)
        invalidate_if_out_of_bounds(&(displayed_characters[i]));
    }

    delay(SCROLL_DELAY_MS);
}

I leave writing these functions to you.