Project tutorial
Interfacing Arduino UNO with SURE Electronics LED Dot Matrix

Interfacing Arduino UNO with SURE Electronics LED Dot Matrix © GPL3+

This tutorial shows you an easier way to control an LED dot Matrix from an Arduino board.

  • 3,486 views
  • 1 comment
  • 3 respects

Components and supplies

About this project

1. Overview

The LED dot matrix that we are going to use, is composed by four 8x8 LEDs mono colour matrix positioned close to form a 32x8 row. Under the hood, we find the HT1632C IC that is capable to drive this huge quantity of LED. The HT1632C is both a controller and a LED driver, because it has an on board RAM memory for the mapping LED display and because provide to give the enough power to the LEDs. The device allows you to vary the brightness of the LEDs integrating a 16 steps PWM control. The matrix provides to communicate with the host controller through a serial interface that behaves like a SPI-like protocol. So, on the Arduino side we have to provide the wiring with the LED dot matrix and to install the library that contains the dedicated communication protocol and the utilities for easy write on the matrix.

2. How to install the library

The library for Arduino was written by Guarav Manek and you can find it in his Github. Download it, then follow these instructions:

  • Once you have downloaded the library, decompress the archive, and you will obtain a directory called  "gauravmm-HT1632-for-Arduino-13dc18c" that contains some things. It's not ready to be recognized from Arduino IDE.
  • Go in your sketchbook folder and open the "libraries" directory. If you don't already have, create it.
  • Follow this path to copy the library: "/gauravmm-HT1632-for-Arduino-13dc18c/Arduino" and copy the HT1632 directory to the "libraries" directory in your sketchbook.
  • Now copy the "Samples" directory (/gauravmm-HT1632-for-Arduino-13dc18c/Arduino/Samples) inside the library directory (/sketchbook/libraries/HT1632) and rename it to "examples".
  • Open the IDE and you'll find the example under this path: Files  >  Examples > HT1632 > sketch_HT1632_sample_code.

Now your Arduino environment is capable to read the library, and you can use it in your sketches.

3. Wiring the LED matrix

The socket placed behind the LED matrix allow you to plug the 16 pin IDC cable. To work with Arduino UNO you need to connect only five pins, these are:

  • Pin 11  to GND
  • Pin 12 to VCC
  • Pin 3 (CS1)  to Arduino Digital pin 9
  • Pin 5 (WR) to Arduino Digital pin 10
  • Pin 7 (DATA) to Arduino Digital pin 11

4. Power up and run the first example

The words "Hello, how are you?" with the specified font created in the "font_5x4.h" file, will scroll on the matrix. Enjoy!

On Playground you can find another project that use a different SURE electronics LED matrix and an Arduino Mega2560 for making a clock. This guys uses the same library but they modified it a little.

#include "ht1632c.h"
#include "font1.h"
#include <avr/pgmspace.h>
int i = 0;
int wd;
void setup () {
  // Setup and begin the matrix
  // HT1632.begin(CS1,WR,DATA)
  HT1632.begin( 9, 10, 11);
  
  // Give the width, in columns, of the assigned string
  // FONT_5x4_WIDTH and FONT_5x4_HEIGHT are parameter specified in the "font_5x4.h" file
  wd = HT1632.getTextWidth("Hello, how are you?", FONT_5X4_WIDTH, FONT_5X4_HEIGHT);
}
void loop () {
  
  // Font rendering example
  HT1632.drawTarget(BUFFER_BOARD(1));
  HT1632.clear();
  HT1632.drawText("Hello, how are you?", 2*OUT_SIZE - i, 2, FONT_5X4, FONT_5X4_WIDTH, FONT_5X4_HEIGHT, FONT_5X4_STEP_GLYPH);
  HT1632.render();  
  
  i = (i+1)%(wd + OUT_SIZE * 2);  
  delay(200);
}

Code

Code snippet #1Arduino
#include "ht1632c.h"
#include "font1.h"
#include <Wire.h>
#include <avr/pgmspace.h>

int i = 0;
int wd;

void setup () {
  // Setup and begin the matrix
  // HT1632.begin(CS1,WR,DATA)
  HT1632.begin( 9, 10, 11);
  
  // Give the width, in columns, of the assigned string
  // FONT_5x4_WIDTH and FONT_5x4_HEIGHT are parameter specified in the "font_5x4.h" file
  wd = HT1632.getTextWidth("Hello, how are you?", FONT_5X4_WIDTH, FONT_5X4_HEIGHT);
}

void loop () {
  
  // Font rendering example
  HT1632.drawTarget(BUFFER_BOARD(1));
  HT1632.clear();
  HT1632.drawText("Hello, how are you?", 2*OUT_SIZE - i, 2, FONT_5X4, FONT_5X4_WIDTH, FONT_5X4_HEIGHT, FONT_5X4_STEP_GLYPH);
  HT1632.render();  
  
  i = (i+1)%(wd + OUT_SIZE * 2);  
  delay(200);
}
Github
https://github.com/gauravmm/HT1632-for-Arduino

Comments

Similar projects you might like

Controlling an LED Matrix with Arduino Uno

Project tutorial by Igor Fonseca Albuquerque

  • 33,115 views
  • 5 comments
  • 28 respects

48 x 8 Scrolling LED Matrix using Arduino.

Project tutorial by Prasanth K S

  • 18,911 views
  • 4 comments
  • 24 respects

4x4x4 LED cube with Arduino Uno and 1sheeld

Project tutorial by Hassan Ibrahim

  • 29,722 views
  • 6 comments
  • 60 respects

Current Temperature on 8*8 LED Dot Matrix

Project showcase by Nekhil ravi

  • 10,157 views
  • 13 comments
  • 34 respects

Arduino Dot Matrix Game Console

Project tutorial by Md. Khairul Alam

  • 9,638 views
  • 1 comment
  • 30 respects

How to show text in a LED matrix with your browser

Project tutorial by Arduino_Scuola

  • 3,433 views
  • 0 comments
  • 2 respects
Add projectSign up / Login