{"id":7136,"date":"2013-02-20T23:23:24","date_gmt":"2013-02-21T04:23:24","guid":{"rendered":"http:\/\/embedded-lab.com\/blog\/?p=7136"},"modified":"2014-04-01T22:10:59","modified_gmt":"2014-04-02T02:10:59","slug":"new-version-of-max7219-based-4-digit-serial-seven-segment-led-display","status":"publish","type":"post","link":"https:\/\/embedded-lab.com\/blog\/new-version-of-max7219-based-4-digit-serial-seven-segment-led-display\/","title":{"rendered":"New version of MAX7219 based 4-digit serial seven segment LED display"},"content":{"rendered":"<p>This (SPI7SEGDISP4.40-1R) is a revised version of the <strong><a href=\"http:\/\/embedded-lab.com\/blog\/?p=4935\" target=\"_blank\">previous SPI seven segment LED display<\/a><\/strong> (4 digit) board that displayed numerals and decimal points. The new version has a better quality seven segment LED display (<strong>LTC-4727JS<\/strong>)\u00a0with three extra LED segments, as shown below. The additional colon segments are useful in projects where you need to display time (HH:MM or MM:SS).<\/p>\n<div id=\"attachment_7137\" style=\"width: 575px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/SPI7SEGDISP4.40-1R.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7137\" class=\"size-full wp-image-7137\" title=\"SPI7SEGDISP4.40-1R\" alt=\"\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/SPI7SEGDISP4.40-1R.jpg\" width=\"565\" height=\"419\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/SPI7SEGDISP4.40-1R.jpg 565w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/SPI7SEGDISP4.40-1R-550x407.jpg 550w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/a><p id=\"caption-attachment-7137\" class=\"wp-caption-text\">Newer version of 4-digit SPI seven segment LED display<\/p><\/div>\n<p><!--more--><\/p>\n<p>The digits layout and internal circuit diagram of <strong>LTC-4727JS is shown here.<\/strong><\/p>\n<div id=\"attachment_7139\" style=\"width: 432px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/LTC-4727JSLEDsegments.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7139\" class=\"size-full wp-image-7139\" title=\"LTC-4727JSLEDsegments\" alt=\"\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/LTC-4727JSLEDsegments.jpg\" width=\"422\" height=\"199\" \/><\/a><p id=\"caption-attachment-7139\" class=\"wp-caption-text\">Digits layout of LTC-4727 JS<\/p><\/div>\n<div id=\"attachment_7138\" style=\"width: 580px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/LTC-4727JS_IC.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7138\" class=\"size-full wp-image-7138\" title=\"LTC-4727JS_IC\" alt=\"\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/LTC-4727JS_IC.jpg\" width=\"570\" height=\"294\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/LTC-4727JS_IC.jpg 570w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/LTC-4727JS_IC-550x283.jpg 550w\" sizes=\"auto, (max-width: 570px) 100vw, 570px\" \/><\/a><p id=\"caption-attachment-7138\" class=\"wp-caption-text\">Internal circuit diagram<\/p><\/div>\n<p>The common cathode terminals (Digit 1, Digit 2, Digit 3, and Digit 4) of the four seven segment digits are connected to D3, D2, D1, and D0 pins of MAX7219 driver chip. The common cathode pin 4 of LTC-4727 goes to D4 pin of MAX7219. So, in order to turn on L1, L2, and L3 segments, D4 digit select pin of MAX7219 should be active. Here&#8217;s an example that shows how to interface this module with an Arduino board using the LedControl library.<\/p>\n\n<div class=\"wp_syntax\"><table><tr><td class=\"code\"><pre class=\"c\" style=\"font-family:monospace;\"><span style=\"color: #339933;\">#include &quot;LedControl.h&quot;<\/span>\n<span style=\"color: #666666; font-style: italic;\">\/\/ Arduino Pin 7 to DIN, 6 to Clk, 5 to LOAD, no.of devices is 1<\/span>\nLedControl lc<span style=\"color: #339933;\">=<\/span>LedControl<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">7<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">6<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">5<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">1<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n<span style=\"color: #993333;\">void<\/span> setup<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span>\n<span style=\"color: #009900;\">&#123;<\/span>\n <span style=\"color: #666666; font-style: italic;\">\/\/ Initialize the MAX7219 device<\/span>\n  lc.<span style=\"color: #202020;\">shutdown<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #000000; font-weight: bold;\">false<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>   <span style=\"color: #666666; font-style: italic;\">\/\/ Enable display<\/span>\n  lc.<span style=\"color: #202020;\">setIntensity<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">10<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>  <span style=\"color: #666666; font-style: italic;\">\/\/ Set brightness level (0 is min, 15 is max)<\/span>\n  lc.<span style=\"color: #202020;\">clearDisplay<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>     <span style=\"color: #666666; font-style: italic;\">\/\/ Clear display register<\/span>\n<span style=\"color: #009900;\">&#125;<\/span>\n<span style=\"color: #993333;\">void<\/span> loop<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span>\n<span style=\"color: #009900;\">&#123;<\/span>\n  lc.<span style=\"color: #202020;\">setDigit<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">4<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #000000; font-weight: bold;\">true<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span> <span style=\"color: #666666; font-style: italic;\">\/\/ Display 4 to Digit 4, and turn DP on<\/span>\n  lc.<span style=\"color: #202020;\">setDigit<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">1<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">3<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #000000; font-weight: bold;\">true<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span> <span style=\"color: #666666; font-style: italic;\">\/\/ Display 3 to Digit 3, &quot; &quot;<\/span>\n  lc.<span style=\"color: #202020;\">setDigit<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">2<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">2<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #000000; font-weight: bold;\">true<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span> <span style=\"color: #666666; font-style: italic;\">\/\/ Display 2 to Digit 2, &quot; &quot;<\/span>\n  lc.<span style=\"color: #202020;\">setDigit<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">3<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">1<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #000000; font-weight: bold;\">true<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span> <span style=\"color: #666666; font-style: italic;\">\/\/ Display 1 to Digit 1, &quot; &quot;<\/span>\n  lc.<span style=\"color: #202020;\">setDigit<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">4<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #0000dd;\">7<\/span><span style=\"color: #339933;\">,<\/span><span style=\"color: #000000; font-weight: bold;\">true<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span> <span style=\"color: #666666; font-style: italic;\">\/\/ Turns L1, L2, and L3 on<\/span>\n  delay<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">1000<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n<span style=\"color: #009900;\">&#125;<\/span><\/pre><\/td><\/tr><\/table><\/div>\n\n<p>Note that the DIN, CLK, and LOAD pins of the display are connected to Arduino pins 7, 6, and 5, respectively.<span style=\"font-size: 13px; line-height: 19px;\">\u00a0For more details on MAX7219 device, see the <strong><a href=\"http:\/\/embedded-lab.com\/blog\/?p=4935\" target=\"_blank\">original article<\/a><\/strong>.<\/span><\/p>\n<div id=\"attachment_7140\" style=\"width: 575px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/SPI7SEGDISP4.40-1RArduino.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7140\" class=\"size-full wp-image-7140\" title=\"SPI7SEGDISP4.40-1RArduino\" alt=\"\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/SPI7SEGDISP4.40-1RArduino.jpg\" width=\"565\" height=\"410\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/SPI7SEGDISP4.40-1RArduino.jpg 565w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/SPI7SEGDISP4.40-1RArduino-550x399.jpg 550w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/a><p id=\"caption-attachment-7140\" class=\"wp-caption-text\">Arduino and MAX7219 LED display board<\/p><\/div>\n<p>You can get an assembled SPI7SEGDISP4.40-1R LED display board for $12.50 on <strong><a href=\"https:\/\/www.tindie.com\/products\/rajbex\/spi-4-digit-seven-segment-led-display\/\" target=\"_blank\">Tindie<\/a><\/strong>.<\/p>\n<div id=\"attachment_7146\" style=\"width: 570px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/SPI7SEGDISP4.40-1R2.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7146\" class=\"size-full wp-image-7146\" title=\"SPI7SEGDISP4.40-1R2\" alt=\"\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/SPI7SEGDISP4.40-1R2.jpg\" width=\"560\" height=\"449\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/SPI7SEGDISP4.40-1R2.jpg 560w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2013\/02\/SPI7SEGDISP4.40-1R2-550x440.jpg 550w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><p id=\"caption-attachment-7146\" class=\"wp-caption-text\">SPI7SEGDISP4.40-1R board is on sale for $12.00 on Tindie<\/p><\/div>\n<p><strong>Where to buy?<\/strong><\/p>\n<p><a href=\"https:\/\/www.tindie.com\/products\/rajbex\/spi-4-digit-seven-segment-led-display\/\"><strong>USA buyers<\/strong><\/a><\/p>\n<p><a href=\"http:\/\/www.elecrow.com\/display-c-77\/leds-c-77_100\/spi7segdisp4401r-p-562.html\" target=\"_blank\"><strong>Other countries buyers\u00a0<\/strong><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This (SPI7SEGDISP4.40-1R) is a revised version of the previous SPI seven segment LED display (4 digit) board that displayed numerals and decimal points. The new version has a better quality seven segment LED display (LTC-4727JS)\u00a0with three extra LED segments, as shown below. The additional colon segments are useful in projects where you need to display time (HH:MM or MM:SS).<\/p>\n","protected":false},"author":1,"featured_media":7137,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[245,437],"tags":[439,468,438],"class_list":["post-7136","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-embedded-lab-projects","category-products","tag-max7219","tag-serial-seven-segment","tag-spi-led-display"],"_links":{"self":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/7136","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=7136"}],"version-history":[{"count":12,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/7136\/revisions"}],"predecessor-version":[{"id":8405,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/7136\/revisions\/8405"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media\/7137"}],"wp:attachment":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media?parent=7136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/categories?post=7136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/tags?post=7136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}