Hobby Projects‎ > ‎Projects‎ > ‎Arduino Projects‎ > ‎

Digital Name Plate

Inspiration: This is a very special project that I made because I saw a dearth of a digitized version of a name plate that exists on virtually everyone's office desk.

****  I will share the procedure and library modifications I did (and small code snippets) while building the project ****


Here's how it looks all done.

Digital Name Plate




Key Features:

  • Display Person's Information on a LED Matrix as a scrolling display.
  • The content are read from a sd card and hence can be easily modified by changing content of the file or using the pc software provided
  • User selectable font sizes (5X8, 5x5, 3x5)
  • The display can also be used as a clock with time and  date display
  • The user can update the time using Up/Down buttons
  • Display animations on the screen (the idea being to entertain the user when he/she is bored)
Bill of Materials:
Libraries Used:

  • Matrix Display Library by Miles Burton
  • SD Card library by Ladyada
  • RTClibrary by Ladyada (I modified it to update time from user which can be found here)
  • EEPROM (standard Arduino Library)
  • fonts 3x5, 5x5, 5x8 ( You can download them here)
  • Wire (Standard Arduino Library)

Displaying Random Animations on LED Matrix Display:

Animations



You can download the source code for displaying animations here

Here are some picture of the final product:

 IMG_0274  IMG_0266
 IMG_0261  IMG_0258


More Pics can be found here

Key things to remember while doing a project similar to this:

  • Matrix Display Library is build for 8X32 and 16X24 displays and hence you have to programmatically adjust it for 16X32 display that I built using 2 8X32 displays
  • Clearing the entire display and updating it to show small changes in display for ex. while updating time only second's spot change every second till the end of minute is not a good idea. It is advisable to update just those two spots with new value then changing the entire display as the later is highly time consuming and creates a noticeable flicker on the screen
  • RTC does not like to be polled every few msec, hence a clock must be run on the Arduino to update the clock display using millis() while the RTC should be used to sync the time at regular intervals
  • Text on LED Matrix display is more legible at an angle ( distance also helps). Hence, I created a small wedge using a wooden piece and stuck it to the base of the enclosure

Code snippet :

// Using the font libraries to display text on LED Matrix Display
// www.kunaldoshi.com


void drawString(uint8_t x, uint8_t y, char* c,uint8_t font_size,boolean update_s)
{
// x & y are positions, c-> pointer to string to disp, update_s: false(write to mem), true: write to disp
//font_size : 51(ascii value for 3), 53(5) and 56(8)
    for(char i=0; i< strlen(c); i++)
    {
            drawChar(x, y, c[i],font_size,update_s);
        x+=calc_font_displacement(font_size); // Width of each glyph
    }
}

int calc_font_displacement(uint8_t font_size)
{
  switch(font_size)
  {
    case 51:
    return 4;  //5x3 hence occupies 4 columns ( 3 + 1(space btw two characters))
    break;
   
    case 53:
    return 6;
    break;
   
    case 56:
    return 6;
    break;
   
    default:
    return 6;
    break;
  }
}

void drawChar(uint8_t x, uint8_t y, char c, uint8_t font_size,boolean update_s)  // Display the data depending on the font size mentioned in the font_size variable
{
 
  uint8_t dots;
  if (c >= 'A' && c <= 'Z' ||
    (c >= 'a' && c <= 'z') ) {
    c &= 0x1F;   // A-Z maps to 1-26
  }
  else if (c >= '0' && c <= '9') {
    c = (c - '0') + 27;
  }
  else if (c == ' ') {
    c = 0; // space
  }
  else if (c == '#'){
    c=37;
  }
  else if (c=='/'){
    c=37;
  }
  switch(font_size)
  {
    case 51:  // font size 3x5  ascii value of 3: 51
  for (char row=0; row< 5; row++) {
    dots = pgm_read_byte_near(&font3x5[c][row]);
    for (char col=0; col < 3; col++) {
     uint8_t x1=x;
      uint8_t y1=y;
      if (dots & (4>>col))
        toolbox.setPixel(x1+col, y1+row, 1,update_s);
      else    
        toolbox.setPixel(x1+col, y1+row, 0,update_s);
        //Serial.println(x1,y1);
      }
  }
      break;
     
      case 53:  // font size 5x5   ascii value of 5: 53
      for (char row=0; row< 5; row++) {
    dots = pgm_read_byte_near(&font5x5[c][row]);
    for (char col=0; col < 5; col++) {
     uint8_t x1=x;
      uint8_t y1=y;
      if (dots & (64>>col))  // For some wierd reason I have the 5x5 font in such a way that.. last two bits are zero..
      // dots &64(10000000) gives info regarding the first bit...
      // dots &32(01000000) gives info regarding second bit and so on...
        toolbox.setPixel(x1+col, y1+row, 1,update_s);
      else
        toolbox.setPixel(x1+col, y1+row, 0,update_s);
       
      }
      }
      break;
     
    case 56:     // font size 5x8  ascii value of 3: 56
  for (char col=0; col< 5; col++) {
    dots = pgm_read_byte_near(&font5x8[c][col]);
    for (char row=0; row < 8; row++) {
     uint8_t x1=x;
      uint8_t y1=y;
      if (dots & (64>>row)) 
      // dots &64(10000000) gives info regarding the first bit...
      // dots &32(01000000) gives info regarding second bit and so on...
        toolbox.setPixel(x1+col, y1+row, 1,update_s);
     else
      toolbox.setPixel(x1+col, y1+row, 0,update_s);
    }
  }
  break;
 
      default:
      break;
}
}






Subpages (1): test page
Comments