091713_0526_InterfaceDo29.png

Interface Dot Matrix Display with SK40C and BBFUINO (Arduino)

Introduction

LED dot-matrix display is a good medium of displaying information in terms of text or image. More interestingly, texts or images displayed can be made animated instead static in place only. Some related applications are displaying advertisements, time, price of product and scoring.

Before we start, let’s have a short introduction on how an 8×8 single color LED dot-matrix display works. According to the schematic shown below, dot-matrix display is an array of LEDs arranged in rows and column. Anodes of LEDs in the same column connected together while cathodes of LEDs in the same row connected together (it can be in the opposite way as well).


Figure 1: Schematic of an 8×8 single color dot-matrix display

In order to turn on a LED (or a dot) of the dot-matrix display, the row (cathode) and the column (anode) where the LED located are pulled to LOW and HIGH respectively. This concept is same applied to an 8×8 dual color LED dot-matrix display where the only difference is we can choose to display a dot in one color out of two colors provided.



Figure 2: Schematic of an 8×8 dual color LED dot-matrix display

In this tutorial, users will be guided to construct a circuit board with an 8×8 dual color LED dot-matrix display (green and red) and consequently interface it with SK40C board (Enhanced 40 pins PIC Start-Up Kit) with PIC18F887 and BBFUINO board(Breadboard Friendly-Arduino Compatible). This tutorial is divided into 2 parts, which are:

Part I    : Interface with SK40C + PIC16F887

Part II    : Interface with BBFUINO

Hardware Required:

Electronics Components:

Part I: Interface with SK40C + PIC16F887

        

                SK40C                           IC-PIC-16F887                                   UIC00B

Part II: Interface with BBFUINO

        

              BBFUINO                               UC00A                                WR-USB-M


             BD-BB-0617

Applicable to Part I and Part II

  • Male to Male Jumper Wire (WR-JW-MM65) – 1 pack
  • Donut Board (Small) 6x15cm (BD-DB-PP-0615) – 1
  • Matrix Display (Red and Green) (DS-MAT-6060-RG) – 1
  • IC ULN2803 (IC-ULN-2803) with 18-pin IC socket – 2 sets
  • IC 74HC237N (IC-74HC-237) with 16-pin IC socket – 2 sets
  • Straight Female Header 1×40 Ways (CN-PH-F140S) – 1
  • Resistor 0.25W 5% (220R) (RS-025W-220R) – 8
  • Wrapping Wire AWG30 (WR-WR) – 2 meter
  • Adapter 12V 2A (AD-12-2) – 1

        

             WR-JW-MM65                      BD-DB-PP-0615                    DS-MAT-6060-RG

        

            IC-ULN-2803                          IC-74HC-237                             CN-PH-F140S

        

         RS-025W-220R                           WR-WR                            AD-12-2

Tools and Equipment:

Applicable to Part I and Part II

  • Soldering Iron
  • Solder Lead
  • Solder Paste (optional)
  • Wire cutter
  • Wire stripper

Software required:

Part I: Interface with SK40C + PIC16F887

Part II: Interface with BBFUINO

Related Reference:

Part I: Interface with SK40C + PIC16F887

Part II: Interface with BBFUINO

Applicable to Part I and Part II

*Users are encouraged to gone through user manuals of products stated above for better understanding on how to use them.

Procedure:

Part I: Interface with SK40C + PIC16F887

A) Construct the circuit board of the dot-matrix display

  1. The circuit board of the 8×8 dual color LED dot-matrix display is constructed separately and the connections for the interface between this board and the SK40C board are established using male-to-male jumpers.
  2. Construct the LED dot matrix circuit board based on the schematics shown in Figure 3 and Figure 4 below.


Figure 3: Pin diagram of the 8×8 dual color LED dot-matrix display


Figure 4: Schematic of the LED dot-matrix display board

*Please click the picture to enlarge it for better viewing

Notes regarding the schematic of the LED dot-matrix board:

  • All electronics components in the schematic are soldered on a donut board.
  • 3-to-8 decoder (IC 74HC237) is used to expand the I/Os of the PIC16F887 plugged on the SK40C board. IC 74HC237 controls the activation of outputs of IC ULN2803 which are connected to cathodes of LEDs of the dot-matrix display. If there is no IC 74HC237, to control outputs of an IC ULN2803, 8 I/O pins from PIC16F887 are required. Now, with the presence of IC 74HC237, only 4 I/O pins are required.
  • The VCC pin and GND pin of the IC 74HC237 are not indicated in the schematic. Please connect them to VCC and GND from SK40C board. Besides, please connect a 0.1uF capacitor across the VCC pin and GND pin of each IC 74HC237 for voltage regulation of 5V supply to it.
  • Darlington transistor array (IC ULN2803) is used to sink currents from multiple LEDs of the dot-matrix display. In this case, the maximum current need to be sustained is the resulted current from 8 LEDs when anodes of all columns of the dot-matrix displayed is pulled HIGH and the cathode of particular row is pulled LOW. Hence, it is not advisable to sink currents directly using I/O pins of PIC16F887 as this might damage the microcontroller.
  • The 1×2, 1×4 and 1×8 headers are cut out from a 1×40 female header.
  • Sometimes, jumpers are inevitable in the circuit connection. For low-current connections (control signals from microcontroller and activation signals to IC in this case), wrapping wire (WR-WR) can be used. For high-current connections (voltage supply – VCC or GND and connections between IC ULN2803 and cathodes of dot-display in this case), thicker multicore wire can be used.
  1. The resulted circuit board of the 8×8 dual color LED dot-matrix display is shown in Figure 5 below.


    Figure 5: 8×8 dual color LED dot-matrix display circuit board

    *74HC237(#1) and ULN 2803(#1) are for controlling activation of cathodes of green LEDs of the dot matrix display.

    *74HC237(#2) and ULN 2803(#2) are for controlling activation of cathodes of red LEDs of the dot matrix display.

  1. Next, make the interfacing connections between the SK40C board (with PIC16F887 plugged in ready) and the LED dot-matrix display circuit board using male-to-male jumpers by referring to schematics shown in Figure 4 and Figure 6.


Figure 6: I/Os of PIC16F887 on SK40C board connected to the dot-matrix circuit board

Notes regarding SK40C schematic in Figure 6:

  • The I/O pins of the PIC16F887 are carefully selected for facilitating the programming

    *PORTD controls the anodes activation of the dot-matrix display

    *PORTA controls the cathodes activation of green LEDs of the dot-matrix display.

    *PORTC controls the cathodes activation of red LEDs of the dot-matrix display.

    *PORTB controls the inputs from the built-in buttons (SW1 and SW2) on SK40C board.

  1. The resulted combination circuit is shown in Figure 7 below.


Figure 7: The combination circuit formed by SK40C board with PIC16F887 and the LED dot-matrix display circuit board

*The SK40C board used in this demonstration is pre-installed with a LCD. Somehow, the LCD is not involved in this project.

  1. The hardware part is considered done here. Now, it’s time to program the PIC16F887 on the SK40C board to make the LED dot-matrix display works.

B) Program the PIC16F887 on SK40C board

  1.  Download the source code, Dot Matrix (SK40C).zip file from the “Attachments” section at the bottom of this tutorial page.
  2. Unzip the file downloaded. The resulted folder contains MPLAB project files and well as hex file. The hex file’s name is Dot Matrix.hex.
  3. Load the Dot Matrix.hex file into the PIC16F887 on SK40C board using UIC00B programmer and software, PICKit2. Please refer to user manuals of SK40C and UIC00B for information on how to load program into microchip through using software, PICKit2.
  4. After the program is successfully loaded, detach the UIC00B programmer from the SK40C board. Then, connect the AC-to-DC adapter (12V) to the DC jack socket of the SK40C board.
  5. Turn on the adapter to power up the SK40C board and the dot-matrix display circuit board as well.
  6. The appearance as the resulted circuit is powered up will be similar as shown in Figure 8 below.
  7. Figure 8: The appearance of the resulted circuit is powered up
  8. There is total of 7 modes integrated in the program of interfacing 8×8 dual color LED dot-matrix display (green and red) with SK40C + PIC16F887, which are:
  • Mode 0: Running Dot
  • Mode 1: Running Line
  • Mode 2: Light up pattern in single color
  • Mode 3: Light up pattern as orange (combination of red light and green light)
  • Mode 4: Light up pattern in two colors
  • Mode 5: Running string
  • Mode 6: Expanding and Shrinking Box

    *Regarding the interfacing circuit, SW1 is used to select which mode is going to be executed while SW2 is used to execute the mode selected.

    *The SK40C board need to be reset each time the user select different modes for execution.

    *Please refer to comments in PIC program of interfacing 8×8 dual color LED dot-matrix display (green and red) with SK40C + PIC16F887 for more information.

9. The video below demonstrates the interfacing of 8×8 dual color LED dot-matrix display (green and red) with SK40C + PIC16F887. Please enjoy it

Part II: Interface with BBFUINO

A) Construct the circuit board of the dot-matrix display

  1. Basically, the steps in this section are the same as Section A in Part I (Interface with SK40C) except the SK40C board is replaced with the BBFUINO board.
  2. The connections between the BBFUINO board and the dot-matrix display circuit board are based on the schematics shown in Figure 9 and Figure 10 below.


Figure 9: Schematic of the LED dot-matrix display board

*Please click the picture to enlarge it for better viewing


Figure 10: I/Os of BBFUINO board connected to the dot-matrix circuit board

Notes regarding the schematic of BBFUINO in Figure 10:

  • The BBFUINO is plugged into the breadboard to extend its I/Os for external connections.
  • Two external buttons are added to BBFUINO as inputs for mode selection and execution of the mode selected.
  • External buttons are unnecessary for SK40C board in Part I as it has two on-board buttons as inputs to the PIC16F887.
  • The I/O pins of the BBFUINO are carefully selected based on the I/O pins mapping of the ATmega328 microcontroller in Arduino as shown in figure below for facilitating the programming process.


    Figure 11: I/O pins mapping of ATmega328 of BBFUINO in Arduino

*PORTD controls the anodes activation of the dot-matrix display

*PORTB controls the cathodes activation of green LEDs of the dot-matrix display and

input of button (Button 1).

*PORTC controls the cathodes activation of red LEDs of the dot-matrix display and

input of button (Button 2).

  1. The combination circuit formed from connections between the BBFUINO board and the LED dot-matrix display circuit board using male-to-male jumpers is shown in Figure 12 below.


    Figure 12: The combination circuit formed by BBFUINO board and the LED dot-matrix display circuit board

B) Program the BBFUINO board

  1. Unzip the file downloaded. The resulted folder contains Dot_Matrix_BBFUINO.ino file.
  2. Open the Dot_Matrix_BBFUINO.ino file in the Arduino IDE. Compile and load the program into the BBFUINO board using UC00A programmer. Please refer to user manuals of BBFUINO and UC00A for information on how to load program into BBFUINO through using software, Arduino IDE.
  3. After the program is successfully loaded, detach the UC00A programmer from the BBFUINO board. Then, connect the AC-to-DC adapter (12V) to the DC jack socket of the BBFUINO board.
  4. Turn on the adapter to power up the BBFUINO board and the dot-matrix display circuit board as well.
  5. The appearance as the resulted circuit is powered up will be similar as shown in Figure 13 below.
  6. Download the source code, Dot_Matrix_BBFUINO.zip file from the “Attachments” section at the bottom of this tutorial page.


Figure 13: The appearance of the resulted circuit is powered up

7.There is total of 7 modes integrated in the program of interfacing 8×8 dual color LED dot-matrix display (green and red) with BBFUINO. They are exactly same as listed in Part I (Interface with SK40C).

*Regarding the interfacing circuit, Button 1 is used to select which mode is going to be executed while Button 2 is used to execute the mode selected.

    *The BBFUINO board need to be reset each time the user select different modes for execution.

    *Please refer to comments in Arduino program of interfacing 8×8 dual color LED dot-matrix display (green and red) with BBFUINO for more information.

8. The video below demonstrates the interfacing of 8×8 dual color LED dot-matrix display (green and red) with BBFUINO. Please enjoy it.

[youtube]http://www.youtube.com/watch?v=3t1p2NPyipY[/youtube]

Attachments:

Buy

2 thoughts on “Interface Dot Matrix Display with SK40C and BBFUINO (Arduino)

  1. can u show me how to interface with 2 or more dot matrix…i have buy this and need to connect with 2 dot matrix

Leave a Reply

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