Posts | Comments

Planet Arduino

Archive for the ‘MAX7219’ Category

Introduction

Time for another kit review, and in this instalment we’ve received some LED matrix modules and a matching Arduino-compatible controller board from friedcircuits.us. Behind the name is William Garrido – who some of you may know as “mobile will” from following his blog. Over time William has created a range of small and useful products, which are now available on the tindie online store.

The system comprises of two modules. The first is a small Arduino-compatible board with an ATmega328P microcontroller – the LED matrix master. It’s quite small and is designed to be the start of a chain of matching LED matrix link boards. Each of these holds an 8×8 LED matrix and is controlled by the AS1107 LED driver IC. This is a direct replacement IC for the popular MAX7219, works exactly the same and is a great find instead of using knock-off MAX7219s. You can chain up to 8 matrix modules from the one controller. We received a matrix master and two matrix link boards to examine, which arrived in solid packaging a fun Tindie sticker:

friedcircuits_kit_contents

Assembly

All the surface-mount soldering is done in advance, leaving you with some simple through-hole soldering for the LED matrix and the connectors between each module. The PCBs are clearly labelled with the silk screen and have mounting holes for permanent installations:

friedcircuits master module

friedcircuits matrix module rear

So after a few minutes of soldering it’s time to get the blinking on:

friedcircuits matrix modules rear

You may have noticed by now that the master board doesn’t have  a USB socket, so you’ll need a 5V FTDI cable or a USBasp programmer to upload your Arduino sketches or AVR .hex file to get things moving.

Controlling a matrix or more

As the system is basically an Arduino-compatible with one or more MAX7219-compatible modules you can find all sorts of example sketches to experiment with. If you haven’t used a MAX7219/AS1107 before there are a couple of starting points including the Arduino library and another random tutorial. Using an example sketch on the Arduino forum by member “danigom“, and after checking the data, clock and load pins it was ready to go. Here’s the sketch for your consideration:

/* Program is currently hard coded to drive 4x MAX7219 chips
   though altering code to drive upto 7 chips is trivial
   Orginal sketch by Arduino forum member "danigom"
   http://forum.arduino.cc/index.php?action=profile;u=188950
*/

//We always have to include the libraries
#include <avr/pgmspace.h>
#include <LedControl.h>

// *CONSTANTS
const int DIN = 12;            //DataIn pin (18)
const int CLK = 11;            //Clock pin (17)
const int LOAD = 10;           //Load pin (16)
const int numDevices = 2;      //Number of MAX7219 LED Driver Chips (1-8)
const long scrollDelay = 70;

prog_uchar font5x7 [] PROGMEM = {      //Numeric Font Matrix (Arranged as 7x font data + 1x kerning data)
    B00000000,	//Space (Char 0x20)
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    6,

    B10000000,	//!
    B10000000,
    B10000000,
    B10000000,
    B00000000,
    B00000000,
    B10000000,
    2,

    B10100000,	//"
    B10100000,
    B10100000,
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    4,

    B01010000,	//#
    B01010000,
    B11111000,
    B01010000,
    B11111000,
    B01010000,
    B01010000,
    6,

    B00100000,	//$
    B01111000,
    B10100000,
    B01110000,
    B00101000,
    B11110000,
    B00100000,
    6,

    B11000000,	//%
    B11001000,
    B00010000,
    B00100000,
    B01000000,
    B10011000,
    B00011000,
    6,

    B01100000,	//&
    B10010000,
    B10100000,
    B01000000,
    B10101000,
    B10010000,
    B01101000,
    6,

    B11000000,	//'
    B01000000,
    B10000000,
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    3,

    B00100000,	//(
    B01000000,
    B10000000,
    B10000000,
    B10000000,
    B01000000,
    B00100000,
    4,

    B10000000,	//)
    B01000000,
    B00100000,
    B00100000,
    B00100000,
    B01000000,
    B10000000,
    4,

    B00000000,	//*
    B00100000,
    B10101000,
    B01110000,
    B10101000,
    B00100000,
    B00000000,
    6,

    B00000000,	//+
    B00100000,
    B00100000,
    B11111000,
    B00100000,
    B00100000,
    B00000000,
    6,

    B00000000,	//,
    B00000000,
    B00000000,
    B00000000,
    B11000000,
    B01000000,
    B10000000,
    3,

    B00000000,	//-
    B00000000,
    B11111000,
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    6,

    B00000000,	//.
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    B11000000,
    B11000000,
    3,

    B00000000,	///
    B00001000,
    B00010000,
    B00100000,
    B01000000,
    B10000000,
    B00000000,
    6,

    B01110000,	//0
    B10001000,
    B10011000,
    B10101000,
    B11001000,
    B10001000,
    B01110000,
    6,

    B01000000,	//1
    B11000000,
    B01000000,
    B01000000,
    B01000000,
    B01000000,
    B11100000,
    4,

    B01110000,	//2
    B10001000,
    B00001000,
    B00010000,
    B00100000,
    B01000000,
    B11111000,
    6,

    B11111000,	//3
    B00010000,
    B00100000,
    B00010000,
    B00001000,
    B10001000,
    B01110000,
    6,

    B00010000,	//4
    B00110000,
    B01010000,
    B10010000,
    B11111000,
    B00010000,
    B00010000,
    6,

    B11111000,	//5
    B10000000,
    B11110000,
    B00001000,
    B00001000,
    B10001000,
    B01110000,
    6,

    B00110000,	//6
    B01000000,
    B10000000,
    B11110000,
    B10001000,
    B10001000,
    B01110000,
    6,

    B11111000,	//7
    B10001000,
    B00001000,
    B00010000,
    B00100000,
    B00100000,
    B00100000,
    6,

    B01110000,	//8
    B10001000,
    B10001000,
    B01110000,
    B10001000,
    B10001000,
    B01110000,
    6,

    B01110000,	//9
    B10001000,
    B10001000,
    B01111000,
    B00001000,
    B00010000,
    B01100000,
    6,

    B00000000,	//:
    B11000000,
    B11000000,
    B00000000,
    B11000000,
    B11000000,
    B00000000,
    3,

    B00000000,	//;
    B11000000,
    B11000000,
    B00000000,
    B11000000,
    B01000000,
    B10000000,
    3,

    B00010000,	//<
    B00100000,
    B01000000,
    B10000000,
    B01000000,
    B00100000,
    B00010000,
    5,

    B00000000,	//=
    B00000000,
    B11111000,
    B00000000,
    B11111000,
    B00000000,
    B00000000,
    6,

    B10000000,	//>
    B01000000,
    B00100000,
    B00010000,
    B00100000,
    B01000000,
    B10000000,
    5,

    B01110000,	//?
    B10001000,
    B00001000,
    B00010000,
    B00100000,
    B00000000,
    B00100000,
    6,

    B01110000,	//@
    B10001000,
    B00001000,
    B01101000,
    B10101000,
    B10101000,
    B01110000,
    6,

    B01110000,	//A
    B10001000,
    B10001000,
    B10001000,
    B11111000,
    B10001000,
    B10001000,
    6,

    B11110000,	//B
    B10001000,
    B10001000,
    B11110000,
    B10001000,
    B10001000,
    B11110000,
    6,

    B01110000,	//C
    B10001000,
    B10000000,
    B10000000,
    B10000000,
    B10001000,
    B01110000,
    6,

    B11100000,	//D
    B10010000,
    B10001000,
    B10001000,
    B10001000,
    B10010000,
    B11100000,
    6,

    B11111000,	//E
    B10000000,
    B10000000,
    B11110000,
    B10000000,
    B10000000,
    B11111000,
    6,

    B11111000,	//F
    B10000000,
    B10000000,
    B11110000,
    B10000000,
    B10000000,
    B10000000,
    6,

    B01110000,	//G
    B10001000,
    B10000000,
    B10111000,
    B10001000,
    B10001000,
    B01111000,
    6,

    B10001000,	//H
    B10001000,
    B10001000,
    B11111000,
    B10001000,
    B10001000,
    B10001000,
    6,

    B11100000,	//I
    B01000000,
    B01000000,
    B01000000,
    B01000000,
    B01000000,
    B11100000,
    4,

    B00111000,	//J
    B00010000,
    B00010000,
    B00010000,
    B00010000,
    B10010000,
    B01100000,
    6,

    B10001000,	//K
    B10010000,
    B10100000,
    B11000000,
    B10100000,
    B10010000,
    B10001000,
    6,

    B10000000,	//L
    B10000000,
    B10000000,
    B10000000,
    B10000000,
    B10000000,
    B11111000,
    6,

    B10001000,	//M
    B11011000,
    B10101000,
    B10101000,
    B10001000,
    B10001000,
    B10001000,
    6,

    B10001000,	//N
    B10001000,
    B11001000,
    B10101000,
    B10011000,
    B10001000,
    B10001000,
    6,

    B01110000,	//O
    B10001000,
    B10001000,
    B10001000,
    B10001000,
    B10001000,
    B01110000,
    6,

    B11110000,	//P
    B10001000,
    B10001000,
    B11110000,
    B10000000,
    B10000000,
    B10000000,
    6,

    B01110000,	//Q
    B10001000,
    B10001000,
    B10001000,
    B10101000,
    B10010000,
    B01101000,
    6,

    B11110000,	//R
    B10001000,
    B10001000,
    B11110000,
    B10100000,
    B10010000,
    B10001000,
    6,

    B01111000,	//S
    B10000000,
    B10000000,
    B01110000,
    B00001000,
    B00001000,
    B11110000,
    6,

    B11111000,	//T
    B00100000,
    B00100000,
    B00100000,
    B00100000,
    B00100000,
    B00100000,
    6,

    B10001000,	//U
    B10001000,
    B10001000,
    B10001000,
    B10001000,
    B10001000,
    B01110000,
    6,

    B10001000,	//V
    B10001000,
    B10001000,
    B10001000,
    B10001000,
    B01010000,
    B00100000,
    6,

    B10001000,	//W
    B10001000,
    B10001000,
    B10101000,
    B10101000,
    B10101000,
    B01010000,
    6,

    B10001000,	//X
    B10001000,
    B01010000,
    B00100000,
    B01010000,
    B10001000,
    B10001000,
    6,

    B10001000,	//Y
    B10001000,
    B10001000,
    B01010000,
    B00100000,
    B00100000,
    B00100000,
    6,

    B11111000,	//Z
    B00001000,
    B00010000,
    B00100000,
    B01000000,
    B10000000,
    B11111000,
    6,

    B11100000,	//[
    B10000000,
    B10000000,
    B10000000,
    B10000000,
    B10000000,
    B11100000,
    4,

    B00000000,	//(Backward Slash)
    B10000000,
    B01000000,
    B00100000,
    B00010000,
    B00001000,
    B00000000,
    6,

    B11100000,	//]
    B00100000,
    B00100000,
    B00100000,
    B00100000,
    B00100000,
    B11100000,
    4,

    B00100000,	//^
    B01010000,
    B10001000,
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    6,

    B00000000,	//_
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    B11111000,
    6,

    B10000000,	//`
    B01000000,
    B00100000,
    B00000000,
    B00000000,
    B00000000,
    B00000000,
    4,

    B00000000,	//a
    B00000000,
    B01110000,
    B00001000,
    B01111000,
    B10001000,
    B01111000,
    6,

    B10000000,	//b
    B10000000,
    B10110000,
    B11001000,
    B10001000,
    B10001000,
    B11110000,
    6,

    B00000000,	//c
    B00000000,
    B01110000,
    B10001000,
    B10000000,
    B10001000,
    B01110000,
    6,

    B00001000,	//d
    B00001000,
    B01101000,
    B10011000,
    B10001000,
    B10001000,
    B01111000,
    6,

    B00000000,	//e
    B00000000,
    B01110000,
    B10001000,
    B11111000,
    B10000000,
    B01110000,
    6,

    B00110000,	//f
    B01001000,
    B01000000,
    B11100000,
    B01000000,
    B01000000,
    B01000000,
    6,

    B00000000,	//g
    B01111000,
    B10001000,
    B10001000,
    B01111000,
    B00001000,
    B01110000,
    6,

    B10000000,	//h
    B10000000,
    B10110000,
    B11001000,
    B10001000,
    B10001000,
    B10001000,
    6,

    B01000000,	//i
    B00000000,
    B11000000,
    B01000000,
    B01000000,
    B01000000,
    B11100000,
    4,

    B00010000,	//j
    B00000000,
    B00110000,
    B00010000,
    B00010000,
    B10010000,
    B01100000,
    5,

    B10000000,	//k
    B10000000,
    B10010000,
    B10100000,
    B11000000,
    B10100000,
    B10010000,
    5,

    B11000000,	//l
    B01000000,
    B01000000,
    B01000000,
    B01000000,
    B01000000,
    B11100000,
    4,

    B00000000,	//m
    B00000000,
    B11010000,
    B10101000,
    B10101000,
    B10001000,
    B10001000,
    6,

    B00000000,	//n
    B00000000,
    B10110000,
    B11001000,
    B10001000,
    B10001000,
    B10001000,
    6,

    B00000000,	//o
    B00000000,
    B01110000,
    B10001000,
    B10001000,
    B10001000,
    B01110000,
    6,

    B00000000,	//p
    B00000000,
    B11110000,
    B10001000,
    B11110000,
    B10000000,
    B10000000,
    6,

    B00000000,	//q
    B00000000,
    B01101000,
    B10011000,
    B01111000,
    B00001000,
    B00001000,
    6,

    B00000000,	//r
    B00000000,
    B10110000,
    B11001000,
    B10000000,
    B10000000,
    B10000000,
    6,

    B00000000,	//s
    B00000000,
    B01110000,
    B10000000,
    B01110000,
    B00001000,
    B11110000,
    6,

    B01000000,	//t
    B01000000,
    B11100000,
    B01000000,
    B01000000,
    B01001000,
    B00110000,
    6,

    B00000000,	//u
    B00000000,
    B10001000,
    B10001000,
    B10001000,
    B10011000,
    B01101000,
    6,

    B00000000,	//v
    B00000000,
    B10001000,
    B10001000,
    B10001000,
    B01010000,
    B00100000,
    6,

    B00000000,	//w
    B00000000,
    B10001000,
    B10101000,
    B10101000,
    B10101000,
    B01010000,
    6,

    B00000000,	//x
    B00000000,
    B10001000,
    B01010000,
    B00100000,
    B01010000,
    B10001000,
    6,

    B00000000,	//y
    B00000000,
    B10001000,
    B10001000,
    B01111000,
    B00001000,
    B01110000,
    6,

    B00000000,	//z
    B00000000,
    B11111000,
    B00010000,
    B00100000,
    B01000000,
    B11111000,
    6,

    B00100000,	//{
    B01000000,
    B01000000,
    B10000000,
    B01000000,
    B01000000,
    B00100000,
    4,

    B10000000,	//|
    B10000000,
    B10000000,
    B10000000,
    B10000000,
    B10000000,
    B10000000,
    2,

    B10000000,	//}
    B01000000,
    B01000000,
    B00100000,
    B01000000,
    B01000000,
    B10000000,
    4,

    B00000000,	//~
    B00000000,
    B00000000,
    B01101000,
    B10010000,
    B00000000,
    B00000000,
    6,

    B01100000,	// (Char 0x7F)
    B10010000,
    B10010000,
    B01100000,
    B00000000,
    B00000000,
    B00000000,
    5
};

prog_uchar scrollText[] PROGMEM ={
    "  THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG 1234567890 the quick brown fox jumped over the lazy dog   \0"};

// * GLOBAL VARIABLES
unsigned long bufferLong [14] = {0};  //Buffer for scrolling text
LedControl lc=LedControl(DIN,CLK,LOAD,numDevices);

void setup(){
    for (int x=0; x<numDevices; x++){
        lc.shutdown(x,false);       //The MAX72XX is in power-saving mode on startup
        lc.setIntensity(x,8);       // Set the brightness to default value
        lc.clearDisplay(x);         // and clear the display
    }
}

void loop(){ 
    scrollMessage(scrollText);
    scrollFont();
}

void scrollFont() {
    for (int counter=0x20;counter<0x80;counter++){
        loadBufferLong(counter);
        delay(500);
    }
}

// Scroll Message
void scrollMessage(prog_uchar * messageString) {
    int counter = 0;
    int myChar=0;
    do {
        // read back a char 
        myChar =  pgm_read_byte_near(messageString + counter); 
        if (myChar != 0){
            loadBufferLong(myChar);
        }
        counter++;
    } 
    while (myChar != 0);
}
// Load character into scroll buffer
void loadBufferLong(int ascii){
    if (ascii >= 0x20 && ascii <=0x7f){
        for (int a=0;a<7;a++){                      // Loop 7 times for a 5x7 font
            unsigned long c = pgm_read_byte_near(font5x7 + ((ascii - 0x20) * 8) + a);     // Index into character table to get row data
            unsigned long x = bufferLong [a*2];     // Load current scroll buffer
            x = x | c;                              // OR the new character onto end of current
            bufferLong [a*2] = x;                   // Store in buffer
        }
        byte count = pgm_read_byte_near(font5x7 +((ascii - 0x20) * 8) + 7);     // Index into character table for kerning data
        for (byte x=0; x<count;x++){
            rotateBufferLong();
            printBufferLong();
            delay(scrollDelay);
        }
    }
}
// Rotate the buffer
void rotateBufferLong(){
    for (int a=0;a<7;a++){                      // Loop 7 times for a 5x7 font
        unsigned long x = bufferLong [a*2];     // Get low buffer entry
        byte b = bitRead(x,31);                 // Copy high order bit that gets lost in rotation
        x = x<<1;                               // Rotate left one bit
        bufferLong [a*2] = x;                   // Store new low buffer
        x = bufferLong [a*2+1];                 // Get high buffer entry
        x = x<<1;                               // Rotate left one bit
        bitWrite(x,0,b);                        // Store saved bit
        bufferLong [a*2+1] = x;                 // Store new high buffer
    }
}  
// Display Buffer on LED matrix
void printBufferLong(){
  for (int a=0;a<7;a++){                    // Loop 7 times for a 5x7 font
    unsigned long x = bufferLong [a*2+1];   // Get high buffer entry
    byte y = x;                             // Mask off first character
    lc.setRow(3,a,y);                       // Send row to relevent MAX7219 chip
    x = bufferLong [a*2];                   // Get low buffer entry
    y = (x>>24);                            // Mask off second character
    lc.setRow(2,a,y);                       // Send row to relevent MAX7219 chip
    y = (x>>16);                            // Mask off third character
    lc.setRow(1,a,y);                       // Send row to relevent MAX7219 chip
    y = (x>>8);                             // Mask off forth character
    lc.setRow(0,a,y);                       // Send row to relevent MAX7219 chip
  }
}

In the following video you can see the sketch in action with two and one matrix modules:

Where to from here? 

The matrix modules can find a wide range of uses, from simple fun and scrolling text to various LED matrix games, status displays and more. They also work well with the XOBXOB IoT USB-connected example. The design files are available for perusal on the friedcircuits github page. And don’t forget the matrix master board in itself is a tiny Arduino-compatible – with the full eight ADCs and digital I/O pins available. Thus you can embed this in another project if so desired.

Conclusion

The LED matrix modules are simple to use and work well together. Plus the matrix master board makes for a neat little Arduino-compatible as well. For more information and to order, visit the friedcircuits.us website. Full-sized images are on flickr. And if you made it this far – check out my new book “Arduino Workshop” from No Starch Press.

In the meanwhile 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? And join our friendly 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.

[Note - kits reviewed were a promotional consideration from friedcircuits]

The post Kit Review – FriedCircuits LED Matrix Link appeared first on tronixstuff.

Introduction

If you’re awake and an Internet user, sooner or later  you’ll come across the concept of the “Internet of Things”. It is the goal of many people and organisations to have everything connected to everything for the exchange of data and the ability to control things. And as time marches on, more systems (or “platforms”) are appearing on the market. Some can be quite complex, and some are very easy to use – and this is where our interests lay. In the past we’ve examined the teleduino system, watched the rise of Ninja Blocks, and other connected devices like the lifx bulb and more.

However the purpose of this article is to demonstrate a new platform – XOBXOB (pronounced “zob-zob”) that gives users (and Arduino users in particular) a method of having remote devices connect with each other and be controlled over the Internet. At the time of writing XOBXOB is still in alpha stage, however you’re free to give it a go. So let’s do that now with Arduino.

Getting Started

You’ll need an Arduino and Ethernet shield – or a combination board such as a Freetronics EtherTen, or a WiFly board from Sparkfun. If you don’t have any Ethernet hardware there is a small application you can download that gives your USB-connected Arduino a link to the XOBXOB service. However before that, visit the XOBXOB homepage and register for an account. From there you can visit the dashboard which has your unique API key and a few controls:

XOBXOB dashboard

Now download the Arduino libraries and copy them into the usual location. If you don’t have an Ethernet shield, also get the “connector” application (available for all three OSs). The connector application is used after uploading the XOBXOB-enabled sketches to your Arduino and links it to the XOBXOB service.

Testing with exanples

Moving on, we’ve started with the basic LED control Ethernet sketch which is included in the XOBXOB library. It’s a fast way to check the system is working and your Internet connection is suitable. When using the examples for the first time (or any other XOBXOB sketch, don’t forget to enter your API key and Ethernet MAC address, for example:

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0x12, 0x01 };
String APIKey = "cc6zzzzz-0494-4cd7-98a6-62cf21aqqqqq";

We have the EtherTen connected to the ADSL and control via a cellular phone. It’s set to control digital pin 8 so after inserting an LED it worked first time:

The LED is simply turned on and off by using the ON/OFF panel on the XOBXOB dashboard, and then clicking “SET”. You can also click “GET” to retrieve the status of the digital output. The GET function is useful if more than one person is logged into the dashboard controlling what’s at the other end.

Now for some more fun with the other included example, which controls a MAX7219 LED display driver IC. We used one of the boards from the MAX7219 test a while back, which worked fine with the XOBXOB example in the Arduino library:

If this example doesn’t compile for you, remove the line:

#include <"avr/pgmspace.h">

Once operating, this example is surprisingly fun, and could be built into a small enclosure for a simple remote-messaging system.

Controlling your own projects

The functions are explained in the Arduino library guide, which you should download and review. Going back to the LED blink example, you can see how the sketch gets and checks for a new on/off message in the following code:

if (!lastResponseReceived && XOB.loadStreamedResponse()) {

    lastResponseReceived = true;

    String LED = XOB.getMessage("switch");
    if (LED == "\"ON\"") {
      digitalWrite (8, HIGH);
    } 
    else {
      digitalWrite (8, LOW);
    }

So instead of the digitalWrite() functions, you can insert whatever you want to happen when the ON/OFF button is used on the XOBXOB dashboard.  For example with the use of a Powerswitch Tail you could control a house light or other device from afar.

If you want to control more than one device from the dashboard, you need to create another XOB. This is done by entering the “advanced” dashboard and clicking “New”. After entering a name for the new XOB it will then appear in the drop-down list in either dashboard page. To then assign that XOB to a new device, it needs to be told to request that XOB by name in the Arduino sketch.

For example, if you created a new XOB called “garagelight” you need to insert the XOB name in the XOB.requestXOB() function in the sketch:

XOB.requestXOB("garagelight");

and then it will respond to the dashboard when required. Later on we’ll return to XOBXOB and examine how to upload information from a device to the dashboard, to allow remote monitoring of temperature and other data.

Conclusion

Experimenting with XOBXOB was a lot of fun, and much easier than originally planned. Although only in the beginning stages, I’m sure it can find a use with your hardware and a little imagination. Note that XOBXOB is still in alpha stage and not a finished product. For more information, visit hte XOBXOB website. And if you made it this far – check out my new book “Arduino Workshop” from No Starch Press.

In the meanwhile 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? And join our friendly 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.

The post Arduino and the XOBXOB IoT Platform appeared first on tronixstuff.

Introduction

If you’re awake and an Internet user, sooner or later  you’ll come across the concept of the “Internet of Things”. It is the goal of many people and organisations to have everything connected to everything for the exchange of data and the ability to control things. And as time marches on, more systems (or “platforms”) are appearing on the market. Some can be quite complex, and some are very easy to use – and this is where our interests lay. In the past we’ve examined the teleduino system, watched the rise of Ninja Blocks, and other connected devices like the lifx bulb and more.

However the purpose of this article is to demonstrate a new platform – XOBXOB (pronounced “zob-zob”) that gives users (and Arduino users in particular) a method of having remote devices connect with each other and be controlled over the Internet. At the time of writing XOBXOB is still in alpha stage, however you’re free to give it a go. So let’s do that now with Arduino.

Getting Started

You’ll need an Arduino and Ethernet shield – or a combination board such as a Freetronics EtherTen, or a WiFly board from Sparkfun. If you don’t have any Ethernet hardware there is a small application you can download that gives your USB-connected Arduino a link to the XOBXOB service. However before that, visit the XOBXOB homepage and register for an account. From there you can visit the dashboard which has your unique API key and a few controls:

XOBXOB dashboard

Now download the Arduino libraries and copy them into the usual location. If you don’t have an Ethernet shield, also get the “connector” application (available for all three OSs). The connector application is used after uploading the XOBXOB-enabled sketches to your Arduino and links it to the XOBXOB service.

Testing with exanples

Moving on, we’ve started with the basic LED control Ethernet sketch which is included in the XOBXOB library. It’s a fast way to check the system is working and your Internet connection is suitable. When using the examples for the first time (or any other XOBXOB sketch, don’t forget to enter your API key and Ethernet MAC address, for example:

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0x12, 0x01 };
String APIKey = "cc6zzzzz-0494-4cd7-98a6-62cf21aqqqqq";

We have the EtherTen connected to the ADSL and control via a cellular phone. It’s set to control digital pin 8 so after inserting an LED it worked first time:

The LED is simply turned on and off by using the ON/OFF panel on the XOBXOB dashboard, and then clicking “SET”. You can also click “GET” to retrieve the status of the digital output. The GET function is useful if more than one person is logged into the dashboard controlling what’s at the other end.

Now for some more fun with the other included example, which controls a MAX7219 LED display driver IC. We used one of the boards from the MAX7219 test a while back, which worked fine with the XOBXOB example in the Arduino library:

If this example doesn’t compile for you, remove the line:

#include <"avr/pgmspace.h">

Once operating, this example is surprisingly fun, and could be built into a small enclosure for a simple remote-messaging system.

Controlling your own projects

The functions are explained in the Arduino library guide, which you should download and review. Going back to the LED blink example, you can see how the sketch gets and checks for a new on/off message in the following code:

if (!lastResponseReceived && XOB.loadStreamedResponse()) {

    lastResponseReceived = true;

    String LED = XOB.getMessage("switch");
    if (LED == "\"ON\"") {
      digitalWrite (8, HIGH);
    } 
    else {
      digitalWrite (8, LOW);
    }

So instead of the digitalWrite() functions, you can insert whatever you want to happen when the ON/OFF button is used on the XOBXOB dashboard.  For example with the use of a Powerswitch Tail you could control a house light or other device from afar.

If you want to control more than one device from the dashboard, you need to create another XOB. This is done by entering the “advanced” dashboard and clicking “New”. After entering a name for the new XOB it will then appear in the drop-down list in either dashboard page. To then assign that XOB to a new device, it needs to be told to request that XOB by name in the Arduino sketch.

For example, if you created a new XOB called “garagelight” you need to insert the XOB name in the XOB.requestXOB() function in the sketch:

XOB.requestXOB("garagelight");

and then it will respond to the dashboard when required. Later on we’ll return to XOBXOB and examine how to upload information from a device to the dashboard, to allow remote monitoring of temperature and other data.

Conclusion

Experimenting with XOBXOB was a lot of fun, and much easier than originally planned. Although only in the beginning stages, I’m sure it can find a use with your hardware and a little imagination. Note that XOBXOB is still in alpha stage and not a finished product. For more information, visit hte XOBXOB website. And if you made it this far – check out my new book “Arduino Workshop” from No Starch Press.

In the meanwhile 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? And join our friendly 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.

The post Arduino and the XOBXOB IoT Platform appeared first on tronixstuff.

Introduction

If you’re experimenting with various Arduino or other projects and working with LED matrices or lots of LEDs – you may have come across the Maxim MAX7219 “Serially Interfaced, 8-Digit, LED Display Driver” IC. It’s a great part that can drive an 8 x 8 LED matrix or eight digits of seven-segment LED displays very easily. However over the last few years the price has shot up considerably. Supply and demand doing their thing – and for a while there was also the Austria Microsystems AS1107 drop-in replacement, which could be had for a few dollars less. But no more.

So where does the budget-minded person go from here? Charlieplexing? Lots of shift registers? Or dig a little deeper to find some cheaper units. With a MAX7219 heading north of US$10 in single units, they may turn to ebay or other grey-market suppliers in the Far East. Everyone likes to save money – and who can blame them? However with the proliferation of counterfeiting, “third shift” operations and other shifty practices – is buying those cheaper examples worth it?

A few people have been asking me of late, and there’s only one way to find out … so over the last month I ordered eight random “MAX7219s” from different suppliers on ebay and will compare them to the real thing using somewhat unscientific methods, then see how they work. The funny thing was that after five weeks only six of the eight arrived – so there’s risk number one: if it doesn’t come from a reputable supplier, it might not come at all. Funny stuff. Anyhow, let’s get started by looking at the differences between the real MAX7219 and the others.

Pricing differences

The easiest hint is the price. The non-originals are always cheaper. And if you wonder how much the real ones are in bulk, the quickest indicator is to check the Maxim website and that of a few larger distributors  For example the Maxim “sticker price” for 1000 units is US$4.18 each:

maxpricing

How much at Digikey? Lots of 500 for US$4.67 each:

digikey

And you wouldn’t buy just one from element14 at this price:

aue14pricing

However in fairness to element14 they will price match if you’re buying in volume. So if you can get a “MAX7219″ delivered for US$1.50 – there’s something wrong. Moving on, let’s examine some of those cheap ones in more detail.

Visual differences

If you’ve never seen a real MAX7219 – here it is, top and bottom:

realtopss

realbottomss

And here’s our rogue’s gallery of test subjects:

testsubjectsss

In a few seconds the differences should be blindingly obvious – look at the positioning of the printed bar across the part, the printing of the logo, and the general quality and positioning of the printing. Next, those circles embedded in the top of the body at both ends of the part, and the semi-circle at the top end. And if you turn them over, there’s nothing on the bottom. Furthermore, there isn’t a divot indicating pin 1 on the fakes, as shown on the real part:

divot

Oh – did you notice the legs on the real one? Look closely again at the image above, then consider the legs on the others below:

fakelegsss

Finally, the non-originals are shorter. The Maxim width can fall between 28.96 and 32.13 mm – with our original test MAX7219 being 32 mm:

realwidthss

and all the test subjects are narrower, around 29.7 mm:

fakewidthss

Fascinating. Finally, I found the quality of the metal used for the legs to be worse than the original, they were easier to bend and had trouble going into an IC socket. You can find all the physical dimensions and other notes in the data sheet available from the Maxim website. Finally, this packaging made me laugh – knock-offs in knock-off tubes? (Maxim purchased Dallas Semiconductor a while ago)

faketubingss

Weight difference

Considering that they’re shorter, they must weigh less. In the following video I put the original on the scales, tare it to zero then place each test subject – you can see the difference in weigh. The scales are out a bit however the differences are still obvious:

However over time the manufacturers may go to the effort of making copies that match the weight, size and printing – so future copies may be much better. However you can still fall back to the price to determine a copy.

Do they actually work? 

After all that researching and measuring – did they work? One of the subjects came with a small LED matrix breakout board kit:

matrixassembledss

… so I used that with a simple Arduino sketch that turned on each matrix LED one at a time, then went through the PWM levels – then left them all on at maximum brightness.

#include "LedControl.h"
LedControl lc=LedControl(12,11,10,1); // data, clock, load, 1 MAX7219
void setup() 
{
 lc.shutdown(0,false);
 lc.setIntensity(0,15);
 lc.clearDisplay(0);
}
void single() {
 for(int row=0;row<8;row++) {
 for(int col=0;col<8;col++) {
 delay(25);
 lc.setLed(0,row,col,true);
 delay(25);
 for(int i=0;i
void loop() 
{ 
 single();
 for (int n=0; n<5; n++)
 {
 for (int z=0; z<16; z++)
 {
 lc.setIntensity(0,z);
 delay(100);
 }
 for (int z=15; z>-1; --z)
 {
 lc.setIntensity(0,z);
 delay(100);
 }
 }
 lc.setIntensity(0,15);
 do { }  while(1);
}

Here’s the real MAX7219 running through the test:

And test subjects one through to six running it as well:

And from a reader request, some current measurements. First the current used by the entire matrix module at full PWM brightness, then with LEDs off, then the MAX7219 in shutdown mode:

current

Well that was disheartening. I was hoping and preparing for some blue smoke, dodgy displays or other faults. However the little buggers all worked, didn’t overheat or play up at all.

Conclusion

Six random samples from ebay – and they all worked. However your experience may vary wildly. Does this tell us that copies are OK to use? From my own personal opinion – you do what you have to do with respect to your own work and that for others. In other words – if you’re making something for someone, whether it be a gift or a commercial product, or something you will rely on – use the real thing. You can’t risk a fault in those situations.  If you’re just experimenting, not in a hurry, or just don’t have the money – try the cheap option. But be prepared for the worst – and know you’re supporting an industry that ethically shouldn’t exist. And at the end – to be sure you’re getting a real one – choose from a Maxim authorised source.

I’m sure everyone will have an opinion on this, so let us know about it in the moderated comments section below.  And if you made it this far – check out my new book “Arduino Workshop” from No Starch Press.

In the meanwhile 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? And join our friendly 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.


Introduction

[Here's the Arduino tutorial]

If you’re experimenting with various Arduino or other projects and working with LED matrices or lots of LEDs – you may have come across the Maxim MAX7219 “Serially Interfaced, 8-Digit, LED Display Driver” IC. It’s a great part that can drive an 8 x 8 LED matrix or eight digits of seven-segment LED displays very easily. However over the last few years the price has shot up considerably. Supply and demand doing their thing – and for a while there was also the Austria Microsystems AS1107 drop-in replacement, which could be had for a few dollars less. But no more.

So where does the budget-minded person go from here? Charlieplexing? Lots of shift registers? Or dig a little deeper to find some cheaper units. With a MAX7219 heading north of US$10 in single units, they may turn to ebay or other grey-market suppliers in the Far East. Everyone likes to save money – and who can blame them? However with the proliferation of counterfeiting, “third shift” operations and other shifty practices – is buying those cheaper examples worth it?

A few people have been asking me of late, and there’s only one way to find out … so over the last month I ordered eight random “MAX7219s” from different suppliers on ebay and will compare them to the real thing using somewhat unscientific methods, then see how they work. The funny thing was that after five weeks only six of the eight arrived – so there’s risk number one: if it doesn’t come from a reputable supplier, it might not come at all. Funny stuff. Anyhow, let’s get started by looking at the differences between the real MAX7219 and the others. (Or if you want to learn how to use the MAX7219 with Arduino – click here).

Pricing differences

The easiest hint is the price. The non-originals are always cheaper. And if you wonder how much the real ones are in bulk, the quickest indicator is to check the Maxim website and that of a few larger distributors  For example the Maxim “sticker price” for 1000 units is US$4.18 each:

maxpricing

How much at Digikey? Lots of 500 for US$4.67 each:

digikey

And you wouldn’t buy just one from element14 at this price:

aue14pricing

However in fairness to element14 they will price match if you’re buying in volume. So if you can get a “MAX7219″ delivered for US$1.50 – there’s something wrong. Moving on, let’s examine some of those cheap ones in more detail.

Visual differences

If you’ve never seen a real MAX7219 – here it is, top and bottom:

realtopss

realbottomss

And here’s our rogue’s gallery of test subjects:

testsubjectsss

In a few seconds the differences should be blindingly obvious – look at the positioning of the printed bar across the part, the printing of the logo, and the general quality and positioning of the printing. Next, those circles embedded in the top of the body at both ends of the part, and the semi-circle at the top end. And if you turn them over, there’s nothing on the bottom. Furthermore, there isn’t a divot indicating pin 1 on the fakes, as shown on the real part:

divot

Oh – did you notice the legs on the real one? Look closely again at the image above, then consider the legs on the others below:

fakelegsss

Finally, the non-originals are shorter. The Maxim width can fall between 28.96 and 32.13 mm – with our original test MAX7219 being 32 mm:

realwidthss

and all the test subjects are narrower, around 29.7 mm:

fakewidthss

Fascinating. Finally, I found the quality of the metal used for the legs to be worse than the original, they were easier to bend and had trouble going into an IC socket. You can find all the physical dimensions and other notes in the data sheet available from the Maxim website. Finally, this packaging made me laugh – knock-offs in knock-off tubes? (Maxim purchased Dallas Semiconductor a while ago)

faketubingss

Weight difference

Considering that they’re shorter, they must weigh less. In the following video I put the original on the scales, tare it to zero then place each test subject – you can see the difference in weigh. The scales are out a bit however the differences are still obvious:

However over time the manufacturers may go to the effort of making copies that match the weight, size and printing – so future copies may be much better. However you can still fall back to the price to determine a copy.

Do they actually work? 

After all that researching and measuring – did they work? One of the subjects came with a small LED matrix breakout board kit:

matrixassembledss

… so I used that with a simple Arduino sketch that turned on each matrix LED one at a time, then went through the PWM levels – then left them all on at maximum brightness.

#include "LedControl.h"
LedControl lc=LedControl(12,11,10,1); // data, clock, load, 1 MAX7219
void setup() 
{
 lc.shutdown(0,false);
 lc.setIntensity(0,15);
 lc.clearDisplay(0);
}
void single() {
 for(int row=0;row<8;row++) {
 for(int col=0;col<8;col++) {
 delay(25);
 lc.setLed(0,row,col,true);
 delay(25);
 for(int i=0;i
void loop() 
{ 
 single();
 for (int n=0; n<5; n++)
 {
 for (int z=0; z<16; z++)
 {
 lc.setIntensity(0,z);
 delay(100);
 }
 for (int z=15; z>-1; --z)
 {
 lc.setIntensity(0,z);
 delay(100);
 }
 }
 lc.setIntensity(0,15);
 do { }  while(1);
}

Here’s the real MAX7219 running through the test:

And test subjects one through to six running it as well:

And from a reader request, some current measurements. First the current used by the entire matrix module at full PWM brightness, then with LEDs off, then the MAX7219 in shutdown mode:

current

Well that was disheartening. I was hoping and preparing for some blue smoke, dodgy displays or other faults. However the little buggers all worked, didn’t overheat or play up at all.

Conclusion

Six random samples from ebay – and they all worked. However your experience may vary wildly. Does this tell us that copies are OK to use? From my own personal opinion – you do what you have to do with respect to your own work and that for others. In other words – if you’re making something for someone, whether it be a gift or a commercial product, or something you will rely on – use the real thing. You can’t risk a fault in those situations.  If you’re just experimenting, not in a hurry, or just don’t have the money – try the cheap option. But be prepared for the worst – and know you’re supporting an industry that ethically shouldn’t exist. And at the end – to be sure you’re getting a real one – choose from a Maxim authorised source.

I’m sure everyone will have an opinion on this, so let us know about it in the moderated comments section below.  And if you made it this far – check out my new book “Arduino Workshop” from No Starch Press.

LEDborder

In the meanwhile 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? And join our friendly 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.

The post The MAX7219 LED display controller – real or fake? appeared first on tronixstuff.

Mar
18

Prototyping a modular LED matrix

arduino hacks, led hacks, matrix, MAX7219, module Comments Off on Prototyping a modular LED matrix 

led-matrix-modular-prototype

[Will] was toying with the idea of creating a scrolling LED marquee to display messages as his wedding in May. But you’ve got to crawl before you can walk so he decided to see what he could do with the MAX7219 LED driver chips. They do come in a DIP package, but the 24-pin 0.1″ pitch chip will end up being larger than the 8×8 LED modules he wanted to use. So he opted to go with a surface mount part and spun a PCB which makes the LEDs modular.

These drivers are great when you’re dealing with a lot of LEDs (like the motorcycle helmet of many blinking colors). Since they use SPI for communications it’s possible to chain the chips with a minimum of connections. [Will] designed his board to have a male header on one side and a female socket on the other. Not only does it make aligning and connecting each block simple, but it allows you to change your mind at any time about  which microcontroller to use to command them. For his first set of tests he plugged the male header into a breadboard and drove it with an Arduino. We hope to hear back from him with an update when gets the final device assembled in time for the big day.


Filed under: Arduino Hacks, led hacks
Feb
03

Netduino and MAX721 interfacing for driving seven segment LED displays

arduino, LED, MAX721, MAX7219, Netduino, SPI Comments Off on Netduino and MAX721 interfacing for driving seven segment LED displays 

Day4_SevenSegment_Top

Here’s a tutorial on interfacing MAX7219 LED driver chip to Netduino platform for driving 8 digits of seven segment LED displays. The .NET Micro FramWork provides a SPI class that is used to send display data to the MAX7219 chip through a SPI serial interface.

Netduino and MAX721 interfacing for driving seven segment LED displays - [Link]

Hello readers

Today we are going to examine the Maxim MAX7219 LED display driver IC. The reason for doing so is to show you how something that used to be quite complex can be made very simple – and that is what all this technology is for, isn’t it?

If you have ever tried to control lots of LEDs, or more than two or three 7-segment displays, or even an LED matrix, you realise that there is quite a lot of work to do on the software and hardware side of things. It usually involves lots of shift registers, switching transistors, and some nifty coding to get everything working. And then your code is too large, so the resulting display scans slow enough to see it flicker, etc.

Not any more! The MAX7219 combined with a great library (well for Arduino anyway) solves all the headaches in no time. After using it for the first time today I was briefly angry for not finding out about it sooner… better late than never.

First of all, let’s have a look:

Yes, at first glance you may think that it takes a lot of real estate, but it saves some as well. This chip can completely control 64 individual LEDs, including maintaining equal brightness, and allowing you to adjust the brightness of the LEDs either with hardware or software (or both). It can refresh the LEDs at around 800 Hz, so no more flickering, uneven LED displays. You can even switch the display off for power saving mode, and still send it data while it is off. And another good thing – when powered up, it keeps the LEDs off, so no wacky displays for the first seconds of operation.

Interfacing the MAX7219 is also very simple, you only need three digital output pins from a microncontroller, 5 volts and ground. Up to eight ICs can be cascaded to control up to 512 LEDs at once – from only three data pins. Wow. However, controlling all these LEDs will require a power supply that can allow 330 mA just for the IC, so you can’t just run this off your Ardiuino – you will need external power. Nothing an LM7805 regulator cannot fix.

For more technical information, here is the data sheet: MAX7219.pdf. Now to put it to work for us – this article will demonstrate using an 8 x 8 LED matrix, as well as 8 digits of 7-segment LED numbers. First of all, let’s examine the hardware side of things. Here is the pinout diagram for the IC:

At this point I should mention it is designed for common-cathode display systems.

One example would be an LED matrix, such as:

Normally you would have to program to switch on individual rows and columns, and repeat those commands in software, as well as using switching transistors or a 74HC4066 to control the cathodes.

Another example is a multi-digit 7-segment LED module – current flows in through the anode pins, and each digit is illuminated only when its cathode is connected to ground. Such as this unit:

It has input pins for each of the eight LED elements, and four cathode pins, one for each digit. We can use two of these displays with the MAX7219 very easily, as you will see below.

An example circuit to demonstrate using the matrix is below. Note the lack of resistors and transistors:

When using with (for example) an arduino-type board, you would connect serial data in, clock, and load to three digital pins. The resistor is the hardware control via limiting current to the LEDs. My examples use a 1k0 1/4-watt value. If you are going to experiment with this value, refer to page 10 of the data sheet first. Furthermore, ensure the ground of the MAX7219 is connected to the ground of the microcontroller. The capacitors are used to reduce supply current ripple. And here is the demonstration circuit on the breadboard:

In the above photo, the five wires on the left are connected to the Arduino board (5V, GND, load, clock, data). The two wires from the terminal block head to my DIY 5v power supply.

Now it is time to examine the software aspect, or how to control the MAX7219. My knowledge of microcontrollers is currently only Arduino, so we will use that for this review. Thankfully there is an excellent library that has been specifically written for the MAX7219 – the LedControl library. You will need to download and install the library from the LedControl page. If you need guidance on installing a library, please visit here.

The author has done a marvellous job of documenting his library, so I will briefly describe the basic functions you need to get things blinking. Here is a very basic demonstration sketch:

#include "LedControl.h" //  need the library
LedControl lc=LedControl(12,11,10,1); // lc is our object
// pin 12 is connected to the MAX7219 pin 1
// pin 11 is connected to the CLK pin 13
// pin 10 is connected to LOAD pin 12
// 1 as we are only using 1 MAX7219
void setup()
{
// the zero refers to the MAX7219 number, it is zero for 1 chip
lc.shutdown(0,false);// turn off power saving, enables display
lc.setIntensity(0,8);// sets brightness (0~15 possible values)
lc.clearDisplay(0);// clear screen
}
void loop()
{
for (int row=0; row<8; row++)
{
for (int col=0; col<8; col++)
{
lc.setLed(0,col,row,true); // turns on LED at col, row
delay(10);
lc.setLed(0,col,row,false); // turns off LED at col, row
delay(10);
}
}
}

Using the lc.setLed() saves a lot of code, as the chip will hold the display on until it is told otherwise, you don’t need to program in a delay loop. You can just enter X and Y coordinates for the LED to switch on.

To switch off the display to save power, use lc.shutdown(0, true); – replace true with false to switch it back on again.

The video clip below is more of a detailed demonstration, using the schematic above, and this sketch:

Notice how altering the brightness up and down causes a nice “breathing” affect. However, don’t run that type of thing for too long, the MAX7219 does warm up nicely after about ten minutes of running all LEDs at once at full brightness…

QuestionWhat was the manufacturing week and year for my MAX7219? :)

Now it is time to examine how the MAX7219 deals with seven-segment LED display modules. It can handle up to eight digits, so I have two four-digit display modules to use. The anodes will be connected, so they behave as one single eight -digit unit. Here is the schematic:

And here is the demonstration circuit on the breadboard:

Now to examine the functions to control these displays. Once again, be sure to have the LedControl library as used with the matrix. Here is another simple sketch:

#include "LedControl.h" //  need the library
LedControl lc=LedControl(12,11,10,1); // lc is our object
// pin 12 is connected to the MAX7219 pin 1
// pin 11 is connected to the CLK pin 13
// pin 10 is connected to LOAD pin 12
// 1 as we are only using 1 MAX7219
void setup()
{
  // the zero refers to the MAX7219 number, it is zero for 1 chip
  lc.shutdown(0,false);// turn off power saving, enables display
  lc.setIntensity(0,8);// sets brightness (0~15 possible values)
  lc.clearDisplay(0);// clear screen
}
void loop()
{
  for (int a=0; a<8; a++)
  {
    lc.setDigit(0,a,a,true);
    delay(100);
  }
  for (int a=0; a<8; a++)
  {
    lc.setDigit(0,a,8,1);
    delay(100);
  }
  for (int a=0; a<8; a++)
  {
    lc.setDigit(0,a,0,false);
    delay(100);
  }
  for (int a=0; a<8; a++)
  {
    lc.setChar(0,a,' ',false);
    delay(100);
  }
  for (int a=0; a<8; a++)
  {
    lc.setChar(0,a,'-',false);
    delay(100);
  }
  for (int a=0; a<8; a++)
  {
    lc.setChar(0,a,' ',false);
    delay(100);
  }
}

Once again, the use of the LedControl library certainly makes things easier. The difference between setChar() and setDigit is that the former can also write A~F, space, and a few other letters that are legible when used with a 7-segment display. Here is a video of the above sketch in action:

As you can see, driving all those LED digits is now a piece of cake. To think twenty years ago we used to muck about with various 4000-series ICs, decimal to BCD converters and so on. The MAX7219 just does it all. Now that I have learned how to make a nice huge display – there is only one thing to do… make another clock! It uses an arduino board, and my RTC shield. Here is the sketch: maxclock.pdf, and the clock in action:

Well that’s enough blinkiness for now, I could spend a week making displays with the MAX7219. In all honesty, I can say that it makes life exponentially easier when trying to control more than one LED with a microcontroller. Therefore it really is highly recommended. The only catch is the MAX7219 isn’t the cheapest IC out there. eBay seems to be full of counterfeit versions – just compare the Maxim Direct 1000+ price against the eBay price – so please avoid disappointment, support your local teams and buy from a reputable distributor. Living in Australia, mine came from Little Bird Electronics. So have fun!

If you have any questions at all please leave a comment (below). We also have a Google Group dedicated to the projects and related items on the website – please sign up, it’s free and we can all learn something. High resolution photos are available from flickr.

Otherwise, have fun, stay safe, be good to each other – and make something! :)

[Note – the MAX7219 was purchased by myself personally and reviewed without notifying the manufacturer or retailer]



  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook