1488

ESP8266 controlled. Text, scroll delay and brightness can be changed with your smartphone or any other mobile device

This design is was triggered by a project presented on the French maker site www.fabriqueurs.com, where an Arduino ATmega board and an Ethernet shield were used to build a scrolling text display.
 
Pascal Rondane built this scrolling display, but he found the network cable attached to it was not really practical. That’s why he decided to port the design to an ESP8266 (based) module, using most of the software originally designed by Everett Robinson, and improved by Pierre of the Fabriqueurs.com site. He also implemented a web server to connect to the display as a client using any smartphone, tablet, PC, MAC etc.
 
We decided to build Pascal’s prototype in the Elektor Lab, but when we ordered the MAX72xx-based LED matrix modules we fell into the trap he already warned us about: there are many different makes of these modules available, the most important difference being the orientation of the dot matrix. In most cases, when you buy the modules in a (web)shop, it is hard to tell (if not: impossible to know) exactly what displays you are buying. When we put ‘our’ displays on Pascal’s PCB, the text was scrolling from top to bottom on the first display, continuing at the top of the second 8 x 8 block and so on. Quite entertaining, but not exactly the effect we had in mind. Definitely not the same modules Pascal used, although they looked exactly the same on pictures we saw. Our modules are marked ‘FC-16’on the silkscreen and this appeared to be a common type of display.
Unfortunately, the Arduino library used in the original software to control the displays (MaxMatrix) does not allow the user to change the orientation of the displays. We decided to rewrite the Arduino sketch to use the MD_MAX72xx library, that does support different makes of MAX7219-based LED displays.
In addition, the physical rotation of the display modules on the original PCB (and in most other similar projects found on the internet) doesn’t seem to make sense. The modules are designed to be daisy chained with the data-out of the first display next to the data-in of the second (transferring data from one module to the other), whereas in most designs the data-out and data-in signals are connected in a zigzag pattern on the breadboards/PCBs. On our new PCB, the output and input of two neighboring modules are next to each other, allowing very simple routing and short connections between the matrices, leaving enough space for other hardware under the displays.
For the rest we left the hardware untouched, we even kept the optional part of the circuitry for future developments Pascal is working on, but we’ll leave it up to him to tell you more about that ;-)
 
Hardware
Figure 1 shows the schematic of the scrolling text display.
A 5V/2A power supply is connected to K2. D1 is the polarity protection, tripping fuse F1 if the power accidentally is reversed. This 5V directly powers the display modules, whereas IC1 regulates the 3.3V for the ESP-12 (ESP8266) module. Although the output pins of the ESP have 3.3V levels and the displays are 5V powered, the logic HIGH levels are sufficient to reliably control the LED modules.
LED1 is the power LED, indicating that the 3.3V power for the ESP module is present.
 
The MAX7219 used in the dot matrix modules is a serial input/output (SPI) display driver that interfaces microprocessors (µPs) to 64 individual LEDs. The display module has two connectors with the following signals: +5V, 0V, Din and Dout (serial in- and output), data CLK and CS/LOAD (latching the last received 16 data bits on a raising edge). The data out- and input of adjacent modules are connected to shift data from one display to another.
 
JP1 and JP2 must be closed on power up to program the firmware in the ESP8266. During normal operation JP1 must be open on power up. A 3.3V USB -> UART interface (e.g. a 3.3V FTDI cable) is connected between K1 and your computer. JP3 is reserved for future developments and has no function at this stage of the project.
 
Assembling the PCB
Although many components are SMD types, soldering will not be too difficult if you use a smaller soldering iron. There are parts on both sides of the PCB, through-hole components must be mounted on the side indicated on the white silkscreen.
Start with soldering the ESP-12 module, carefully align this module with its footprint and solder one corner pad. Recheck the alignment, correct it if necessary and then solder the opposing corner, followed by the other fourteen pads. Continue with the other SMD components, then the TH parts and finally the dot matrix displays.
There are also display modules available that are four blocks wide, using two of these PCBs next to each other instead of eight separate modules will also work. Just make connections between two of these PCB using short jumper wires (see picture), and connect the ‘IN’ of this whole unit to the five pins of MOD2 at the edge of the main PCB. In this setup decoupling capacitors C10...C16 hardly make any sense, as the power supply lines for the displays will be routed on the display PCBs rather than on our Elektor Labs PCB. However, these capacitors can also be soldered on the interconnecting VCC and GND pads of the display PCB, even though these pads were not designed or intended for mounting SMD capacitors. Of course you can use through hole decoupling capacitors too, caps with a lead spacing of 100 mil (2.54mm) will fit exactly into the holes of the interconnections, which makes soldering a bit easier.
We ordered both the single and quadruple display modules, the latter came in handy to see how the single units must be assembled. As opposed to the quadruple units, the single ones are shipped as semi-kit, with the SMD parts already soldered on the PCB, a 8 x 8 dot LED display, two machined socket strips to connect the display, and two angled 5-pin I/O pinheaders (that we will not use on our scrolling display). First we will solder two 5-way pinheaders (indicated in the BOM as ‘Board-to-Board connector’, MOD2..MOD9, i.e. NOT included in the dot matrix package) on the bottom side of the display unit PCB. On one side these headers have thinner round pins that fit into machined socket strips on our main PCB, the thicker round pins on the other side will be soldered to the MAX7219 PCB.
Next the dot matrix display will be mounted on the top side of the unit PCB, covering the SMD parts. The orientation of the display is important of course, but there’s no clear ‘pin 1 marking’ on the PCB or display. The type number of the display is printed on one of its sides and there is a protrusion of the plastic case in the middle of this side, this should face the top side of the display PCB (see picture 2). The display units must be mounted into socket strips to gain enough space (height) for the higher parts (the electrolytic capacitors) that are placed underneath them. Machined socket strips will provide enough mechanical stability to keep the display modules in place, but it won’t harm to use some bolts and stand offs to secure the display units to our main PCB.
Solder the socket strips for the displays on the main PCB, plug in the eight display units and the project is ready for programming.
 
Programming the ESP-module
After you have finished soldering, we need the firmware to get our scrolling display up and running. Close jumpers JP1 and JP2, connect a USB -> 3.3V UART interface between K1 and your computer, then power up the circuit by connecting a 5V/2A power supply to K2. Note that our PCB is not powered via K1 to avoid accidental short circuit of the power supply when K2 is also connected. On top of that, if for some reason one or more displays light up when powered via K1, your programming interface may be overloaded and damaged.
For the firmware you need to download the ZIP file 140491-11 from our website. It contains the complete Portable folder of the Arduino IDE, especially made for this project, including the MD_MAX72xx with the modifications needed to make our display work:
  • In file MD_MAX72xx.h: there is a collection of defines (starting from line 217, with #define       USE_PAROLA_HW 0) to select the correct type/brand of display. All defines are ‘0’, except for #define       USE_FC16_HW  1
  • In file  MD_MAX72xx_lib.h, starting at line 498, the following constants are set for the orientation of the display:
#if USE_FC16_HW           // tested MC 23 Feb 2015
//#pragma message "FC16 HW selected"
#define      HW_DIG_ROWS  1 ///< MAX72xx digits are mapped to rows in on the matrix
#define      HW_REV_COLS  0 ///< Normal orientation is col 0 on the right. Set to 1 if reversed
#define      HW_REV_ROWS  1 ///< Normal orientation is row 0 at the top. Set to 1 if reversed
#endif
 
 
Make sure that the file ‘fontdata.h’ (also part of the download) resides in the same folder as the sketch ‘140491-11_V3.0.INO’ after unpacking the ZIP file! Open this sketch in the Arduino IDE.
The sketch creates a webpage you can open on your mobile device to control the display. The original designer of this project is French, so there’s also a French webpage available. You can select this in line 41 of the sketch by redefining constant LANGUAGE to ‘0’, compiling and uploading the sketch to the scrolling display. Feel free to translate the texts on the webpage to any other language you like.
 
In the Tools menu, select ‘NodeMCU 1.0 (ESP-12E Module)’ as the target Board and don’t forget to choose the correct COM Port for your programming interface! Compile and upload the sketch to the ESP module, open jumper JP1, power cycle the board and your scrolling display is ready for use.
 
Changing the message on your display
The ESP8266 will act as an access point (AP) and will setup a WiFi-network with SSID (network name) ‘Scroll 8 Matrix Elektor’ and password ‘Elektor2017’. You can change these credentials in lines 71 and 72 of the sketch. Login on this network with your mobile phone, tablet or any other portable device to this network, open your browser and search for IP address 192.168.4.1. The ESP will show its webpage, enabling you to enter a new text to be displayed, the scroll delay and brightness of the display (both in three steps). Clicking/pressing the ‘Apply’ button on the screen will send the new message and/or settings to the display. Buzzer Bz1 will beep to acknowledge reception.
 
Software
The original software for this project was changed to use the MD_MAX72xx library, which supports different brands/types/makes of MAX7219-based dot matrix LED displays. This library is well documented and in the download you’ll find many useful examples, even one that is (almost) exactly the application we need for our display, however it has a somewhat different approach for the network connectivity.
In this example the ESP8266 runs in station mode, which means that it connects to your local WiFi and that any other user on this network can change the message or settings, without a password or any other protection. We prefer the Access Point mode, where a password is needed to get access to the display.
Furthermore, we did like the character font from the original software more, a bit more elegant than the standard font provided with the MD_MAX72xx library. In addition, this character set lacks the special characters and accents that our German and French readers would surely miss. In the original software many (but not all) characters used in French were supported, and we added the missing characters.
The font data is stored in file ‘fontdata.h’. Every line in this file contains the definition of one character and the comment at the end of each line begins with the index of the character in this table just for your own reference, the sketch automatically calculates the index of the character to be displayed.
The webpage returns the message for our scrolling display in ISO-8859-1 codes that must be converted to the indices of the character definition in ‘fontdata.h’. For ‘normal’ characters this is quite straight forward with subsequent (ASCII) codes, for translation of the special characters a SELECT…CASE statement is used. Although this is maybe not the most elegant solution, it is quite easy to add (or change) special characters to the scrolling display.
 
 
 
 
 
 
See https://www.fabriqueurs.com/arduino-et-matrices-de-leds-un-afficheur-pilote-depuis-internet-v2/

https://github.com/MajicDesigns/MD_MAX72XX

https://majicdesigns.github.io/MD_MAX72XX/index.html