mBed Numitron Ticker



Thanks hackaday!

This quick mbed test project took just a couple of hours to complete… a battery powered web based numitron ticker!

I had some numitrons lying around left over from a another half finished project. These nixie look-a-like 7 segment displays run on < 5V and can be wired directly to the mbed. No additional electronics to drive huge numbers of displays here. Just quick and dirty hackery with each segment of each of the three displays directly connected to an mbed digital-out pin (there’s 30 of them, just enough for 3 numitrons). Simple.

IV9 Numitron

pin-out numitron
 

The mbed Pin-outs

mbed pin outs

Coding was fairly trivial, after initial success at turning outputs on & off and then displaying characters (well, as best I could with a numeric 7 seg display). I thought I’d try to expand it a little.

The mbed’s online compiler made it really easy to add an http client from their repository. I gave it a try and attempted to read a string from a web server. Worked first time. On the web side of things some basic PHP handled a web form and saved the posted text string to a web accessable file to be grabbed by the mbed and scrolled across the 3 numitrons.

ethernet wired directly

Ethernet connects directly to the mbed.

 

Here’s my code

 
#include "mbed.h"
#include "HTTPClient.h"

HTTPClient http;

DigitalOut numitron[3][7] ={
                        {p5,p6,p7,p8,p9,p10,p11},  // output pins
                        {p12,p13,p14,p15,p16,p17,p18},
                        {p19,p20,p21,p22,p23,p24,p25}
                    };

void show(int display, int letter)
{

int charac[26][7]={
       // SEGMENTS:  A B C D E F G
                    {1,1,1,0,1,1,1},  // 0 : A
                    {1,1,1,1,1,1,1},  // 1 : B 
                    {1,0,0,1,1,1,0},  // 2 : C
                    {1,1,1,1,1,1,0},  // 3 : D
                    {1,0,0,1,1,1,1},  // 4 : E
                    {1,0,0,0,1,1,1},  // 5 : F
                    {1,0,1,1,1,1,0},  // 6 : G
                    {0,1,1,0,1,1,1},  // 7 : H
                    {0,0,0,0,1,1,0},  // 8 : I
                    {0,1,1,1,1,0,0},  // 9 : J    
                    {0,1,1,0,1,1,1},  //10 : K
                    {0,0,0,1,1,1,0},  //11 : L
                    {1,1,1,0,1,1,0},  //12 : M
                    {1,1,1,0,1,1,0},  //13 : N
                    {1,1,1,1,1,1,0},  //14 : O
                    {1,1,0,0,1,1,1},  //15 : P
                    {1,1,1,1,1,1,0},  //16 : Q
                    {1,1,1,0,1,1,1},  //17 : R
                    {1,0,1,1,0,1,1},  //18 : S
                    {0,0,0,1,1,1,1},  //19 : T
                    {0,1,1,1,1,1,0},  //20 : U
                    {0,1,1,1,1,1,0},  //21 : V
                    {0,0,0,0,0,0,0},  //22 : W
                    {0,0,0,0,0,0,0},  //23 : X
                    {0,1,1,1,0,1,1},  //24 : Y
                    {1,1,0,1,1,0,1}   //25 : Z

                  };

    for(int i=0;i<7;i++)
    {
       numitron[display][i]=charac[letter][i];
    }

}
int main(void) 
{
  char s[64];

  int strlength;

  while(1) 
    {

    for (int j=0;j<64;j++)
    {
    s[j] = '\\0';
    }

    http.get("http://192.168.0.1/test/text.txt", s);

    strlength =  strlen(s);

    //pad with blanks    
    s[strlength+1]="X";
    s[strlength+2]="X";
    s[strlength+3]="X";

    for (int j=0;j<strlength;j++)
    {

        show( 2, s[j]-65);
        show( 1, s[j+1]-65);
        show( 0, s[j+2]-65);  

        wait(0.36);
    }

    }
}

There we have it, all running from a 9v battery. It took next to no time to complete. Lots of room for improvement, I know. Maybe I’ll add more numitrons, then there’s the almost obligatory Twitter hookup. More likely I’ll ditch it and try something else completely

Leave a Reply

Your email address will not be published. Required fields are marked *