{"id":9255,"date":"2014-10-29T21:03:14","date_gmt":"2014-10-30T01:03:14","guid":{"rendered":"http:\/\/embedded-lab.com\/blog\/?p=9255"},"modified":"2016-11-18T11:19:06","modified_gmt":"2016-11-18T16:19:06","slug":"portable-bluetooth-enabled-scrolling-led-matrix-display-part-1","status":"publish","type":"post","link":"https:\/\/embedded-lab.com\/blog\/portable-bluetooth-enabled-scrolling-led-matrix-display-part-1\/","title":{"rendered":"Portable Bluetooth-enabled scrolling LED matrix display- Part 1"},"content":{"rendered":"<p>LED matrix displays are great fun. They are visually charming, and readable from a\u00a0far viewing\u00a0distance with a much wider angle of view as compared to many other types\u00a0of electronics displays. They can display all kinds of information, including text, graphics, and animation. This project is about making a portable Bluetooth-controlled 8&#215;64 monochromatic LED matrix (total 512 LEDs)\u00a0for displaying scrolling text message. I made this display to use at home parties or other occasions for displaying greeting messages. The text data to be displayed can be sent from a smartphone using the Bluetooth connection. The display is Arduino-controlled and uses the <a href=\"http:\/\/www.ebay.com\/itm\/Wireless-Bluetooth-RF-Transceiver-Module-serial-RS232-TTL-HC-06-for-Arduino-\/291087805062?pt=LH_DefaultDomain_0&amp;hash=item43c62f6a86\" target=\"_blank\">HC-06 Slave Bluetooth<\/a> transceiver module for receiving data from the smartphone. I am also using\u00a0the\u00a0<a href=\"https:\/\/play.google.com\/store\/apps\/details?id=mobi.dzs.android.BLE_SPP_PRO&amp;hl=en\">Bluetooth SPP Pro<\/a>\u00a0(freely downloadable) App (developed by\u00a0Jerry.Li)\u00a0on my HTC One Android smartphone for sending text message to the matrix display. The complete project has got a nice enclosure made by myself using furring strip boards bought from the Home Depot. We looked at a <a href=\"http:\/\/embedded-lab.com\/blog\/?p=7966\" target=\"_blank\">similar project<\/a> earlier made by <a href=\"http:\/\/www.instructables.com\/id\/7-Bi-color-LED-Matrix-Scrolling-Text-Display\/\" target=\"_blank\" rel=\"nofollow\">Jollyfactory<\/a>, who used bi-color LED matrices, which required two MAX7219 devices per 8&#215;8 matrix.<\/p>\n<div id=\"attachment_9463\" style=\"width: 595px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/portable-bluetooth-enabled-scrolling-led-matrix-display-part-1\/happyhalloween\/\" rel=\"attachment wp-att-9463\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-9463\" class=\"size-full wp-image-9463\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/10\/HappyHalloween.jpg\" alt=\"le\" width=\"585\" height=\"248\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/10\/HappyHalloween.jpg 585w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/10\/HappyHalloween-550x233.jpg 550w\" sizes=\"auto, (max-width: 585px) 100vw, 585px\" \/><\/a><p id=\"caption-attachment-9463\" class=\"wp-caption-text\">Bluetooth-enabled scrolling LED matrix display<\/p><\/div>\n<p><!--more--><\/p>\n<h3><strong>Hardware design<\/strong><\/h3>\n<p><span style=\"font-size: 0.95em; line-height: 1.6em;\">This project uses eight pieces of 60.5mm x 60.5mm (2.4&#8243; x 2.4&#8243;) monochromatic 8&#215;8 LED matrix modules with\u00a0A-type polarity, which means the rows are common-anodes and the columns are common-cathodes. The total size\u00a0of the display area thus becomes about 2.4&#8243; x 19&#8243; (60.5mm x 483mm). Making one big piece of PCB of that size usually costs more than making small and cascadable modules. So I designed 8&#215;8 LED matrix modules and daisy-chained eight of them to make the 8 rows x 64 columns matrix required for this project. Each module consists of an 8\u00d78 monochromatic LED dot matrix display with onboard MAX7219 driver chip. I have named this module <strong>Easy Matrix<\/strong>.\u00a0<\/span><span style=\"font-size: 0.95em; line-height: 1.6em;\">It consists of a 5-pin angled male header (J1) on the right side and a 5-pin angled female header (J2) on the left side of the board. Both the headers are precisely aligned along horizontal so that the male header of one module gets easily plugged onto the female header of second module, and so on. Two 1&#215;8 straight female headers are used as sockets to hold the LED matrix module.\u00a0One of the header socket is marked with a \u201c<em><strong>circle with 1<\/strong><\/em>\u201d to indicate where the pin number 1 of the LED matrix display should be inserted. Four\u00a03.5 mm mounting holes are also available at four corners of the PCB.\u00a0The MAX7219 data and control signals are fed from the J1 header of the first module (the right-most module) in the chain. The complete schematic and board files can be downloaded from a link provided at the end of this section. Here are some pictures of an Easy Matrix module below.<\/span><\/p>\n<div id=\"attachment_9213\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/introducing-easy-matrix-a-cascadable-8x8-led-dot-matrix-display-module\/easymatrix1\/\" rel=\"attachment wp-att-9213\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-9213\" class=\"size-full wp-image-9213\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/10\/EasyMatrix1.jpg\" alt=\"Easy Matrix module\" width=\"590\" height=\"353\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/10\/EasyMatrix1.jpg 590w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/10\/EasyMatrix1-550x329.jpg 550w\" sizes=\"auto, (max-width: 590px) 100vw, 590px\" \/><\/a><p id=\"caption-attachment-9213\" class=\"wp-caption-text\">Easy Matrix module<\/p><\/div>\n<div id=\"attachment_9203\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/introducing-easy-matrix-a-cascadable-8x8-led-dot-matrix-display-module\/easymatrixdim\/\" rel=\"attachment wp-att-9203\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-9203\" class=\"size-full wp-image-9203\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/10\/EasyMatrixDim.jpg\" alt=\"Dimensions of Easy Matrix board\" width=\"590\" height=\"648\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/10\/EasyMatrixDim.jpg 590w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/10\/EasyMatrixDim-550x604.jpg 550w\" sizes=\"auto, (max-width: 590px) 100vw, 590px\" \/><\/a><p id=\"caption-attachment-9203\" class=\"wp-caption-text\">Dimensions of Easy Matrix board<\/p><\/div>\n<div id=\"attachment_9199\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/introducing-easy-matrix-a-cascadable-8x8-led-dot-matrix-display-module\/easymatrixtitle\/\" rel=\"attachment wp-att-9199\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-9199\" class=\"size-full wp-image-9199\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/09\/EasyMatrixTitle.jpg\" alt=\"Easy Matrix: Cascadable LED matrix display module\" width=\"590\" height=\"268\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/09\/EasyMatrixTitle.jpg 590w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/09\/EasyMatrixTitle-550x249.jpg 550w\" sizes=\"auto, (max-width: 590px) 100vw, 590px\" \/><\/a><p id=\"caption-attachment-9199\" class=\"wp-caption-text\">Daisy-chaining three Easy Matrix modules<\/p><\/div>\n<h4><em><strong><span style=\"font-size: 0.95em; line-height: 1.6em;\">Features<\/span><\/strong><\/em><\/h4>\n<ul>\n<li>Operates at +5V<\/li>\n<li>16 brightness levels controlled through software<\/li>\n<li>Easily cascadable (recommended maximum 8 modules in a cascade)<\/li>\n<li>Supports both\u00a0<a href=\"https:\/\/github.com\/markruys\/arduino-Max72xxPanel\">Mark Ruys&#8217; Max72xxPanel<\/a> (<a href=\"https:\/\/github.com\/adafruit\/Adafruit-GFX-Library\" target=\"_blank\">Adafruit&#8217;s GFX library<\/a> is also required) and <a href=\"https:\/\/code.google.com\/p\/arudino-maxmatrix-library\/\" target=\"_blank\">MaxMatrix<\/a> libraries.<\/li>\n<\/ul>\n<h4><strong><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/10\/Easy_Matrix_V1.3.zip\">Download Eagle Design files<\/a><\/strong><\/h4>\n<p>If you are interested in getting all the parts for making Easy Matrix modules, look for their kits at my <a href=\"https:\/\/www.tindie.com\/products\/rajbex\/easy-matrix-a-cascadable-led-matrix-module-kit\/\" target=\"_blank\"><strong>Tindie store<\/strong><\/a>.<\/p>\n<h3><em style=\"font-size: 0.95em; line-height: 1.6em;\"><strong>Arduino connections<\/strong><\/em><\/h3>\n<p>Eight Easy Matrix modules are cascaded to construct the 8&#215;64 matrix display, which requires only three I\/O pins of Arduino to drive the data and signal lines. In this project, we will be using the hardware SPI module of Arduino to drive the <em>Data<\/em> and <em>CLK<\/em> signal lines of MAX7219. So, the MOSI (digital pin 11) and SCK (digital pin 13) pins of Arduino Uno are connected to the <em>DATA<\/em> and <em>CLK<\/em> pins of the J1 header (in the right-most Easy Matrix module), respectively. The <em>LOAD<\/em> pin can be driven with any arbitrary I\/O pin. We connect the Arduino digital I\/O pin 10 (defined as <em><strong>pinCS<\/strong><\/em> in the code below) to the <em>LOAD<\/em> pin. Besides, a 1K resistor is also required in this project, which is connected in between Arduino pins 0 (RX) and 2 (External Interrupt). This configuration generates an external hardware interrupt upon the arrival of any new serial data, and Arduino responds to it by immediately reading the data. This is important to prevent the overflow of data in the UART serial receive buffer, which has a capacity of storing only 64 bytes.<\/p>\n<div id=\"attachment_9278\" style=\"width: 595px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/portable-bluetooth-enabled-scrolling-led-matrix-display-part-1\/matrixsetup2\/\" rel=\"attachment wp-att-9278\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-9278\" class=\"size-full wp-image-9278\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/10\/MatrixSetup2.jpg\" alt=\"Connecting a resistor between the RX and Interrupt pin\" width=\"585\" height=\"478\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/10\/MatrixSetup2.jpg 585w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/10\/MatrixSetup2-550x449.jpg 550w\" sizes=\"auto, (max-width: 585px) 100vw, 585px\" \/><\/a><p id=\"caption-attachment-9278\" class=\"wp-caption-text\">Connecting a resistor between the RX (Pin 0) and Interrupt pin (Pin 2)<\/p><\/div>\n<p>The cascade of 8 Easy Matrix modules requires approximately 1Amp of current for full brightness. The 5V regulator on Arduino Uno board cannot provide this much amount of current. So an external +5V power supply is needed. We will discuss about this in more detail later. For now, let&#8217;s use a cascade of five Easy Matrix for developing and testing the Arduino firmware. This can be powered directly from the Arduino board 5V supply. We will first test the firmware directly from the Serial Monitor terminal window by connecting the Arduino to PC through USB-UART bridge. Later we will replace the USB-UART bridge with a serial Bluetooth adapter.<\/p>\n<div id=\"attachment_9277\" style=\"width: 595px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/portable-bluetooth-enabled-scrolling-led-matrix-display-part-1\/matrixsetup1\/\" rel=\"attachment wp-att-9277\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-9277\" class=\"size-full wp-image-9277\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/10\/MatrixSetup1.jpg\" alt=\"Complete test setup of the project\" width=\"585\" height=\"318\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/10\/MatrixSetup1.jpg 585w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/10\/MatrixSetup1-550x298.jpg 550w\" sizes=\"auto, (max-width: 585px) 100vw, 585px\" \/><\/a><p id=\"caption-attachment-9277\" class=\"wp-caption-text\">Complete test setup of the project<\/p><\/div>\n<h3><strong>Arduino Firmware<\/strong><\/h3>\n<p><a href=\"https:\/\/github.com\/markruys\/arduino-Max72xxPanel\">Mark Ruys&#8217; Max72xxPanel<\/a>\u00a0and <a href=\"https:\/\/github.com\/adafruit\/Adafruit-GFX-Library\" target=\"_blank\">Adafruit&#8217;s GFX libraries<\/a>\u00a0are required for this project. So install these libraries into your Arduino libraries directory, if you have not done it already. You can download the complete Arduino sketch that I have developed for this project from the link provided at the end of this section. The Arduino receives the display data and other commands, like scrolling speed control and brightness adjustment, through its serial port at 9600 baud rate. The text message to be displayed is sent by enclosing it inside a open and a closed parenthesis, whereas commands are sent by starting with a &#8216;\/&#8217; character. Here is a list of the commands implemented in the firmware.<\/p>\n<ul>\n<li><strong>(message)<\/strong> &#8211; The scrolling display message must be sent enclosed by parenthesis.<\/li>\n<li><strong>\/p<\/strong> to pause the scroll. Sending it again resumes the scroll.<\/li>\n<li><strong>\/&lt;<\/strong> to scroll faster<\/li>\n<li><strong>\/&gt;<\/strong> to scroll slower<\/li>\n<li><strong>\/+<\/strong> to increase brightness level<\/li>\n<li><strong>\/-<\/strong> \u00a0to decrease brightness level<\/li>\n<li><strong>\/e<\/strong> \u00a0to erase the display<\/li>\n<\/ul>\n<p>When we send data to Arduino through the serial port, it gets interrupted to respond to this event. It first reads the first character to recognize if the upcoming data is a string of text message (if the first character was &#8216;<strong>(<\/strong>&#8216;) or command (if the first character was &#8216;<strong>\/<\/strong>&#8216;), and act accordingly. Note that if the text scrolling is paused and a new display message is sent, it won&#8217;t show up on the display until the scrolling feature is resumed by sending &#8216;<strong>\/p<\/strong>&#8216;. The maximum buffer size defined for storing the incoming text message is 512 bytes (which is 512 characters).<\/p>\n<h4><strong><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/10\/Easy_Matrix_Demo1_Scrolling_Message_UART_With_Interrupt_on_Pin2.zip\">Download Arduino sketch <\/a><\/strong><\/h4>\n<p>(Note: You need to install the <a href=\"https:\/\/github.com\/markruys\/arduino-Max72xxPanel\">Mark Ruys&#8217; Max72xxPanel<\/a>\u00a0and\u00a0<a href=\"https:\/\/github.com\/adafruit\/Adafruit-GFX-Library\" target=\"_blank\">Adafruit&#8217;s GFX libraries<\/a>\u00a0first)<\/p>\n<h3><strong>Demonstration<\/strong><\/h3>\n<p>As I mentioned above, we will test the firmware first using the USB-UART connection between Arduino and PC, and later will replace the link with a Bluetooth adapter. For quick testing, I am using only five Easy Matrix modules (i.e. 8&#215;40 LED matrix). For this, connect the Arduino board to USB port of the PCB and upload the Arduino sketch. Once the upload is completed, open the Serial Monitor program. Set the baud rate to 9600. Then type in the string (HELLO) and hit the Send button. The Arduino receives the character string and displays it on the LED matrix scrolling from right to left.<\/p>\n<div id=\"attachment_9329\" style=\"width: 589px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/portable-bluetooth-enabled-scrolling-led-matrix-display-part-1\/matrixip\/\" rel=\"attachment wp-att-9329\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-9329\" class=\"size-full wp-image-9329\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/10\/MatrixIP.jpg\" alt=\"Sending text message from the Serial Monitor application\" width=\"579\" height=\"204\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/10\/MatrixIP.jpg 579w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/10\/MatrixIP-550x193.jpg 550w\" sizes=\"auto, (max-width: 579px) 100vw, 579px\" \/><\/a><p id=\"caption-attachment-9329\" class=\"wp-caption-text\">Sending text message from the Serial Monitor application<\/p><\/div>\n<div id=\"attachment_9276\" style=\"width: 595px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/portable-bluetooth-enabled-scrolling-led-matrix-display-part-1\/matrixop3\/\" rel=\"attachment wp-att-9276\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-9276\" class=\"size-full wp-image-9276\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/10\/MatrixOP3.jpg\" alt=\"Test output\" width=\"585\" height=\"314\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/10\/MatrixOP3.jpg 585w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/10\/MatrixOP3-550x295.jpg 550w\" sizes=\"auto, (max-width: 585px) 100vw, 585px\" \/><\/a><p id=\"caption-attachment-9276\" class=\"wp-caption-text\">Test output on LED matrix<\/p><\/div>\n<p>The following video illustrates the execution of other commands that were discussed earlier in the software section. Note that these commands begin with the character &#8216;\/&#8217;.<\/p>\n<p>In the <a href=\"http:\/\/embedded-lab.com\/blog\/?p=9331\"><strong>second part<\/strong><\/a> of this article, we will continue this project by cascading 8 Easy Matrix modules and making an external +5V supply with higher current rating to power the display. We will also discuss about implementing a Bluetooth adapter in the project for wireless transmission of text messages to the display through the\u00a0<a href=\"https:\/\/play.google.com\/store\/apps\/details?id=mobi.dzs.android.BLE_SPP_PRO&amp;hl=en\">Bluetooth SPP Pro<\/a>\u00a0App running on an Android phone.<\/p>\n<h4><a href=\"http:\/\/embedded-lab.com\/blog\/?p=9331\">Continue to second part &#8230;<\/a><\/h4>\n","protected":false},"excerpt":{"rendered":"<p>LED matrix displays are great fun. They are visually charming, and readable from a\u00a0far viewing\u00a0distance with a much wider angle of view as compared to many other types\u00a0of electronics displays. They can display all kinds of information, including text, graphics, and animation. This project is about making a portable Bluetooth-controlled 8&#215;64 monochromatic LED matrix (total 512 LEDs)\u00a0for displaying scrolling text message. I made this display to use at home parties or other occasions for displaying greeting messages. The text data to be displayed can be sent from a smartphone using the Bluetooth connection. The display is Arduino-controlled and uses the<\/p>\n","protected":false},"author":1,"featured_media":9436,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[150,245],"tags":[148,914,260,439],"class_list":["post-9255","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino-2","category-embedded-lab-projects","tag-arduino","tag-easy-matrix","tag-led-matrix","tag-max7219"],"_links":{"self":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/9255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/comments?post=9255"}],"version-history":[{"count":54,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/9255\/revisions"}],"predecessor-version":[{"id":11767,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/9255\/revisions\/11767"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media\/9436"}],"wp:attachment":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media?parent=9255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/categories?post=9255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/tags?post=9255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}