t r o n i x s t u f f

fun and learning with electronics

Arduino meets Las Vegas with the Freetronics DMD

Hello Readers

Time once more to have some fun, and this time by examining the new Freetronics DMD “Dot Matrix Display”. We will look at the setup and operation of the display. In a nutshell the DMD comprises of a board measuring approximately 320mm across by 160mm which contains 16 rows of 32 high-intensity red LEDs. For example, in the off state:

Connection of the DMD to your Arduino-compatible board is quite simple. Included with each DMD is a 2×8 IDC cable of around 220mm in length, and a PCB to allow direct connection to the Arduino digital pins D6~13:

Finally the cable connects to the left-hand socket on the rear of the DMD:

You can also daisy-chain more than one display, so a matching output socket is also provided. Finally, an external power supply is recommended in order to drive the LEDs as maximum brightness – 5V at ~2.8 A per DMD. This is connected to a seperate terminal on the rear of the board:

Do not connect these terminals to the 5V/GND of your Arduino board!

A power cable with lugs is also included so you can daisy chain the high-intensity power feeds as well. When using this method, ensure your power supply can deliver 5V at 2.8A  for each DMD used – so for two DMDs, you will need 5A, etc. For testing (and our demonstration) purposes you can simply connect the DMD to your Arduino via the IDC cable, however the LEDs will not light at their full potential.

Using the display with your Arduino sketches is quite simple. There is an enthusiastic group of people working on the library which you will need, and you can download it from and follow the progress at the DMD Github page and forks. Furthermore, there is always the Freetronics forum for help, advice and conversation. Finally you will also need the TimerOne library – available from here.

However for now let’s run through the use of the DMD and get things moving. We will be using Arduino IDE v23. Starting with scrolling text – download the demonstration sketch from here. All the code in the sketch outside of void loop() is necessary. Replace the text within the quotes with what you would like to scroll across the display, and enter the number of characters (including spaces) in the next parameter. Finally, if you have more than one display change the 1 to your number of displays in #define DISPLAYS_ACROSS 1.

Here is a quick video of our example sketch:

Now for some more static display functions – starting with clearing the display. You can use

dmd.clearScreen( true );

to turn off all the pixels, or

dmd.clearScreen( false );

to turn on all the pixels.

Note: turning on more pixels at once increases the current draw. Always keep this in mind and measure with an ammeter if unsure. 

Next some text. First you need to choose the font, at the time of writing there were two to choose from. Use
dmd.selectFont(System5x7);

for a smaller font or

dmd.selectFont(Arial_Black_16);

for a larger font. To position a single character on the DMD, use:

dmd.drawChar(  x,  y, 'x', GRAPHICS_NORMAL );

which will display the character ‘x’ at location x,y (in pixels – starting from zero). For example, using

dmd.drawChar(  10,  5, 'A', GRAPHICS_NORMAL );

results with:

Note if you have the pixels on ‘behind’ the character, the unused pixels in the character are not ‘transparent’. For example:

However if you change the last parameter to GRAPHICS_NOR, the unused pixels will become ‘transparent’. For example:

You can also use the parameter GRAPHICS_OR to overlay a character on the display. This is done with the blinking colon in the example sketch provided with the library.

Next, to draw a string (group of characters). This is simple, just select your font type and then use (for example):

dmd.drawString( 0,0, "Hello,", 5, GRAPHICS_NORMAL );
dmd.drawString( 2,9, "world,", 5, GRAPHICS_NORMAL );

Again, the 5 is a parameter for the length of the string to display. This results in the following:

Next up we look at the graphic commands. To control an individual pixel, use

dmd.writePixel(  x,y, GRAPHICS_NORMAL,1); // turn on a pixel at location x,y

And changing the 1 to a 0 turns off the pixel. To draw a circle with the centre at x,y and a radius r, use

    dmd.drawCircle( x,  y,  r, GRAPHICS_NORMAL );

To draw a line from x1, y2 to x2, y2, use:

    dmd.drawLine(  x1, y1, x2, y2, GRAPHICS_NORMAL );

To draw a rectangle from x1, y2 to x2, y, use:

dmd.drawBox(x1, y1, x2, y2, GRAPHICS_NORMAL );

And to draw a filled rectangle use:

dmd.drawFilledBox(x1, y1, x2, y2, GRAPHICS_NORMAL );

Now let’s put those functions to work. You can download the demonstration sketch from here, and watch the following results:

Update – the DMD will also be available in other colours, such as white:

So there you have it, an inexpensive and easy to use display board with all sorts of applications. Although the demonstrations contained within this article were rather simple, you now have the knowledge to apply your imagination to the DMD and display what you like. For more information, support and conversation visit the Freetronics product page and support forum.

Disclaimer – The parts reviewed in this article are a promotional consideration made available by Freetronics.

Have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column, or join our Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

January 24, 2012 - Posted by | arduino, microcontrollers, product review, review | , , , , , , , , , , , , , , , , , ,

6 Comments »

  1. “For testing (and our demonstration) purposes you can simply connect the DMD to your Arduino via the IDC cable, however the LEDs will not light at their full potential.”

    So in your demo videos for the DMD, you were drawing all of your power through the Arduino? That seems like a lot of watts. I didn’t think the Arduino could power that many LEDs at one time.

    Or am I just reading this wrong?

    Comment by Phil Hutchinson | January 24, 2012 | Reply

    • Not at all. The matrix scans only one row (or column – must check that) at a time which our Arduino can feed nicely. However when you connect 5V at 2.8A to the power terminals on the back of the DMD, the high-intensity mode kicks in and it is ** bright **!

      Comment by John Boxall | January 24, 2012 | Reply

      • Thanks, John, I had forgotten that these devices use persistence-of-vision to work their magic.

        However, I still think you might be pushing your Arduino a bit hard. Worst case, you light up an entire column of 16 LEDs @ 20mA = 320mA, and the most you are supposed to source from an Arduino Uno is 200ma (taken from http://arduino.cc/playground/Main/ArduinoPinCurrentLimitation). I realize this isn’t a continuous power draw, but I always err on the side of caution since I’m cheap and don’t like replacing Arduinos. :-)

        Or maybe my math is wrong.

        Comment by Phil Hutchinson | January 25, 2012

      • I ran the display for about ten hours and none of the Arduino was running warm so to speak. I don’t have the schematic for the board at this time so can’t dissect this any further.

        Comment by John Boxall | January 25, 2012

  2. You can use
    dmd.clearScreen( true ); to turn off all the pixels, or
    dmd.clearScreen( true ); to turn on all the pixels.

    Hmm, really? (My guess is there’s a typo and one of those boolean values should be toggled.)

    Comment by Harley Pebley | January 24, 2012 | Reply

    • Yes, thanks for spotting that. Sometimes I publish these after a very long day.
      cheers
      john

      Comment by John Boxall | January 24, 2012 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 2,240 other followers