Sunday, August 2, 2015

Introducing the "6-character alphanumeric LED Arduino shield"

This shield offers a quick way to add alphanumeric display capabilities to your Arduino project. It is based on the 14-segment 6-character LED display driven by two multiplexed MAX7221 drivers, through a method described in this application note.

 US$ 26 - free shipping to North America

The kit includes:
  • PCB
  • 2 x MAX7221 + 2 x 24-pin sockets
  • 6-character 14-segment common cathode LED display
  • 2 x 33k resistor
  • 2 x 100nF capacitor
  • machined header (as socket for the display)
  • male header (for the shield)

The board has a small prototyping area for adding project-specific parts, for example buttons and buzzer if you want to build an alarm clock (basic clock code for this shield here). Assembled, showing the time (from wsduino):

or, displaying text:

The shield uses Arduino pins D3, D4 and D5.

Sunday, July 12, 2015

Experimenting with MAX6955

MAX6955 is an interesting LED driver chip. It is the primordial charlieplexing device, being the materialization of a technique invented by Charlie Allen of Maxim Integrated. Without understanding how charelieplexing works, it is actually counter-intuitive to wire multiple (up to 8) 16-segment displays to such a driver chip. Fortunately, Maxim has great documentation on how to do it.

My experimenting actually started with MAX6954. After many failed tries due to SPI issues (Maxim uses a special interpretation of the protocol, I read), I switched to MAX6955.

MAX6955 is the I2C sibling of MAX6954 (which uses SPI). They both have identical LED driving abilities, only the microcontroller interface part of the chips differ. Once, both chips were available in DIP-40 package. Now, MAX6955 only comes in SSOP-36 (MAX6954 is still available in DIP-40). Luckily, the pin configurations for the two chips are compatible, which allows for easy swap. For this reason, I designed a breakout board (shared at oshpark), so I can use the same setup I built for MAX6954.

Beside Maxim's, there isn't much documentation on how to control these chips. One of the reasons they are rarely used by hobbyists is probably their price (about $20 at digikey), although in the same range as the wildly popular MAX72xx LED driver (available at around $10 from digikey). In "reality", for some reason, MAX72xx could be had for $1 or less on ebay, unlike MAX6954/6955. Therefore, a hobby kit designed around MAX6955 would be "extremely" expensive compared with others using different LED driving chips (e.g. MAX72xx).

MAX6954/6955 was designed to drive common cathode LED displays, like MAX72xx. But unlike MAX72xx, it cannot be used for displays with common segments (which require multiplexing), like the ones below (and used here). MAX6954/6955 requires the 14/16-segment displays to be single digit/character, because not all segments will be wired together.

Below is the Arduino sketch I wrote that works very well with MAX6955. Although it uses a minimal set of commands, it is capable of displaying a character at a given position, light up the dot, and even scroll a long message.

A nice feature of the chip is that the fonts are predefined, this making it an "intelligent" display driver, like Avago's HDSP-2534. To display a character, only its ASCII code needs to be supplied.

#include "Wire.h"

#define ID_MAX6955 B1100000 
#define NUM_DISPLAYS 6

#define max6955_reg_decodeMode      0x01
#define max6955_reg_globalIntensity 0x02
#define max6955_reg_scanLimit       0x03
#define max6955_reg_configuration   0x04
#define max6955_reg_displayTest     0x07
#define max6955_reg_digitType       0x0C

int writeMAX6955(char command, char data)

void initMAX6955()
    // ascii decoding for all digits;
    writeMAX6955(max6955_reg_decodeMode, 0xFF);
    // brightness: 0x00 =  1/16 (min on)  2.5 mA/seg;
    // 0x0F = 15/16 (max on) 37.5 mA/segment
    writeMAX6955(max6955_reg_globalIntensity, 0x07);
    // active displays: 0x07 -> all;
    writeMAX6955(max6955_reg_scanLimit, 0x07);
    // set normal operation;
    writeMAX6955(max6955_reg_configuration, 0x01);
    // segments/display: 0xFF=14-seg; 0=16 or 7-seg;
    writeMAX6955(max6955_reg_digitType, 0x00);
    // display test off;
    writeMAX6955(max6955_reg_displayTest, 0x00);

void setup()
  // set D8 and D9 to GND (for I2C address);
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  digitalWrite(8, LOW);
  digitalWrite(9, LOW);

//  writeDisplay("HI");
//  writeChar(0, 'A', true);
//  scrollDisplay("     HELLO WORLD", 300);
  writeTime(15, 24, 39);

void loop()

void writeDisplay(char* msg)
  for (byte i=0; i < NUM_DISPLAYS; i++)
    if (i < strlen(msg))
      writeMAX6955(0x25-i, msg[i]);
      writeMAX6955(0x25-i, ' ');

void writeChar(byte pos, char letter, boolean dotLit)
  writeMAX6955(0x25-pos, (dotLit? 0x80 : 0) | letter);

void clear()
  for (byte i=0; i < NUM_DISPLAYS; i++)
    writeMAX6955(0x25-i, ' ');

void scrollDisplay(char* msg, int delayMs)
  for (int i=0; i<=strlen(msg); i++)

void writeTime(int hours, int minutes, int seconds)
  char h1 = (hours/10)? '0' + hours/10 : ' ';
  writeChar(0, h1, false);
  char h2 = '0' + (hours%10);
  writeChar(1, h2, true);
  char m1 = '0' + (minutes/10);
  writeChar(2, m1, false);
  char m2 = '0' + (minutes%10);
  writeChar(3, m2, true);
  char s1 = '0' + (seconds/10);
  writeChar(4, s1, false);
  char s2 = '0' + (seconds%10);
  writeChar(5, s2, false);

The I2C address of B1100000 was set by grounding AD0 and AD1 (see table 5 in the datasheet on how to change that address). In my setup, these 2 pins are connected to D8 and D9. Don't forget to pull-up SDA and SCL with 4k7-10k resistors.

The left-most digit is at position 0, accessible at address 0x25. "Digit 1" is the second from left, accessible at address 0x24, and so on. This is determined by the wiring. In my case, "CC0" (in the table 1 of this application note) represents the right-most display, and it is accessible at address 0x20.

Wednesday, July 8, 2015

LED driver chips

After looking at the many options for driving LED displays (5x7/8x8 matrix, 7/14/16/25 segment, common anode/cathode, single/bi-color/RGB), I put together this list of commonly used LED driver chips, to have a better picture of possible combinations, and use it as reference for future projects.

The bottom 5 rows are not actually LED drivers, just substitutes (require current limiting resistors).

Some of the driver chips (e.g. "8x8" in the "channels" column) provide internal multiplexing, being designed specifically for driving array of LEDs. The others, where "channels" is just one number, would require extra circuitry (e.g. transistors) and logic (micro controller code) for multiplexing.

The "CA" column indicates "common anode", "CC" stands for common cathode.

There seem to be more options for driving common anode LED displays, probably because sinking current (by the chips' LED outputs) allows for higher currents and also for using a separate power source (usually higher voltage) for the LEDs.

Tuesday, July 7, 2015

Wise Clock 4 with the new 3mm 3216 LED display from Sure

My inventory of "old" 3216 3mm displays from Sure Electronics is now depleted. As everybody already knows by now, Sure redesigned the display to be powered with 12V instead of 5V (plus a few other cosmetic changes).
The Wise Clock 4 board cannot be plugged into the new display's connectors anymore, since they are now different (10 pins instead of 16), and the assignment of signals to pins has changed as well.

Making a seamless Wise Clock 4 with the new display is still possible, with a little more soldering work. The board will be connected to the display using the ribbon cable provided. To do this, cut one connector off the ribbon cable, then solder 5 wires (4 signal + ground) from the cut end of the ribbon, in the place of the header, as shown in the photo below.

The 5V power line from the clock's board (red wire in the photo) will be soldered separately from the ribbon cable, bypassing the display's 5V regulator, as shown in the next photo.

The new display is "top heavy", that is, it has the connectors and the 5V regulator (with large capacitors and inductors) at the top. These may interfere with the clock's buttons and the SD card. To avoid touching them accidentally, it is better to position the display upside down, as shown in the next photo.

For this reason, the sketch needs a little tweaking: all pixel-related functions in HT1632.cpp file will have to change the coordinates, like this:

void ht1632_plot (coord_t x, int8_t y, byte color)
  x = X_MAX-1 - x;
  y = Y_MAX-1 - y;

The macro WANT_UPSIDE_DOWN is defined in UserConf.h.

Also notice that the Wise Clock 4 board is now mechanically  fixed to the back panel (because it's not plugged in the display's connectors anymore).
Needless to say that the laser-cut plates for the two version of the displays are not compatible, since the displays' dimensions are different.

I will continue to provide a "complete kit" that includes the new display, the 2 plates, and the screws + standoffs. The back plate won't have the 2 holes (for the board) drilled though. This "complete kit" may not have the two 2x8 female headers (since they are not needed, and will even be detrimental). In case the headers are in the kit, DO NOT SOLDER THEM if you use the new display.
The processor in the "complete kit" will be loaded with the sketch for the new display, with the software modification mentioned above.

Monday, July 6, 2015

My impression of Akafugu Nixie Modular Clock

You are reading the first ever "review" of the Akafugu Nixie Modular Clock, a product yet to be released at the time of writing. Per, of Akafugu, generously offered to sell me the PCBs for this Nixie clock; the parts were sourced by myself.

The Nixie Modular Clock shares a big chunk of the schematic with its older sibling, the Akafugu Nixie Clock. The goal of this latest design is, I assume from the name, the "modularity". Similar to the VFD Modular Clock, "shields" for various types and numbers of Nixie tubes will probably be developed soon.

The hardware
This Nixie Modular Clock is an Arduino-based, open source project, designed around ATmega328 running on internal oscillator at 8MHz. Like the Akafugu Nixie mk3, the high voltage source (180-200V) uses the MC34063 DC-DC converter, and the driver for Nixies is HV5812. There are 3 buttons: 2 in the back, for setting up the time and alarm time, and another long-stem, protruding through the top board, for enabling/disabling the alarm. An orange LED in the front indicates if the alarm is active or not.
The PCB for the commercial version will be red, I was told (as shown below :).

Building the clock is straightforward (as long as all parts are in hand, which will be the case when the kit becomes available). The assembly instructions are easy to follow and very clear, with lots of details and helpful photos. Some of the parts I picked (electrolytic capacitors, inductor) were a little too high, so I had an issue with the clearance between the 2 boards. I was able to "correct" that (meaning increase the distance between boards) by using long-legged headers lifted on male-headers plastic insulators (see the photo below).

I did not install the lamp between the hours and minutes. I was surprised to see that the unit-hours tube (second from left) blinks its decimal point!
The clock has also support for "background" LEDs (blue recommended), but I did not solder those either.

The software.. also open source and available here. A nice feature that every programmer will love is that it covers both Nixie Clock and Nixie Modular Clock (plus variants of the latter, like 6-tube clock) by using macro definitions. Not to mention that the code compiles and works without a glitch. It also has support for GPS.

Although I like the elaborate enclosure that Akafugu designed, I tried my own, by using simple plates to cover the exposed soldered pins, on both top and bottom. To me, the open sides are ok as long as small children don't stick their fingers (or grownups screwdrivers) in there :)
My suggestion is to make the top plastic plate of the enclosure (shown in akafugu's photo of the clock) transparent, rather than opaque black, which hides the elaborate design/silkscreen of the tube PCB.

I think that the Modular Nixie Clock will be another success. Its aesthetics, compact size and feature-rich software set a new standard in the world of Nixie clocks. Remember, most of the Nixie clocks one can buy on etsy, ebay or other sites, are non hack-able hardware or software. If you want one to tinker with, then Akafugu Modular Clock is for you.