A lcd display monitored Arduino news ticker based on MAX7219 dot led matrix devices

Introduction
In a previous paper I described wiring up three MAX7219 8×8 dot led matrix devices with an Arduino microboard to create a news ticker running the latest headlines. Although being successful from the point of creating a news ticker device, that ticker is a static device, that is that the ticker headlines are embedded as a text string in the Arduino sketch. To change the ticker headlines one needs to edit the sketch.
I envisage that in the real world a news ticker operator sits behind a desk with a keyboard and a display in front of him. From this comfortable position the operator launches to the crowds sensational headlines displayed on the big news ticker mounted on the outside of the newspaper building.
In other words: is it possible to construct an interactive news ticker. It should run a fixed introductory text followed by a few dots and next by the big news headlines that do matter. For this purpose we need a computer running the Arduino Serial Monitor, a news ticker based on MAX7219 dot led matrix devices, and a display that shows the current headline being run on the big news ticker.

Necessary parts
An Arduino Uno or Nano microcontroller board and three (or more, up to eight) MAX7219 controller 8×8 dot led matrix displays (shorthand: ‘8×8 dot matrix device’), and a lcd display. Prices in various internet shops of these devices are in the range of US$ 2-10 a piece. Further needed are jumper wires and three breadboards, a 220Ω resistor and a 10 kΩ potentiometer.

fig_01_lcd_max_newsticker_96_dpi

figure 1: wiring scheme of the MAX7219 8×8 dot matrix devices, Arduino and 20×4 lcd display

I made my news ticker by daisy-chaining three 8×8 dot matrix devices (Figure 1), and connecting this chain to an Arduino Nano. Each 8×8 dot matrix device operates under a SPI controller protocol. The entire chain is powered and controlled via five wires: 5V, GND, DIN, CS and CLK. 5V and GND are connected with the 5CV and GND pins of the Arduino; the pins DIN, CS and CLK are connected with digital pins 10, 8 and 9 of the Arduino, respectively. Note that the connectivity presented here of DIN, CS and CLK is different from the usual connectivity (12-10-11) because pins 11 and 12 are necessary to wire the lcd display.
The lcd display is connected to the Arduino in the standard way: pin 1 is connected to GND, pin 2 to 5V. Pin 3 is connected to the wiper of a 10 kΩ potentiometer (other pins of the potmeter connected to 5V and GND). Pins 4, 5 and 6 are connected to the Arduino pins 12, GND and 11, respectively. Data runs to the lcd via the lcd’s pins 11 through 14 which are connected to, respectively, pins 5, 4, 3 and 2 of the Arduino. Background light in the lcd is powered via pin 15 (either connected to 3,3V or via a 220Ω resistor to 5V. Don’t forget to connect pin 16 of the lcd display with GND.

I applied a 20×4 lcd display simply because it was available. A 16×2 lcd display can do the job as well. The display shows two lines: a fixed line “News ticker text:” and a line in the lower portion of the lcd display showing the actually running headline news. The characters for this headline need to be typed into the Serial Monitor  interface on the computer after starting the sketch. The lcd thus acts as a simple monitor.

Procedure
1.    Connect all the wires and hook up the Arduino with your computer,
2.    Start the Arduino IDE,
3.    Load the sketch,
4.    Compile the sketch to the microcontroller board. After successful compilation the lcd will display on row 1, “News ticker text:” and on row two a continuous line,
5.    Open a Serial Monitor screen on the computer (hot keys: Ctrl+Shift+M),
6.    A text will pop up in the Serial Monitor screen ” Please enter inputs and press enter at the end:”,
7.    Type in the upper window the news headline you have in mind,
8.    Send the text to the Arduino by clicking “Send” or by hitting the Enter key on the keyboard.

fig_03_lcd_max_newsticker_96_dpi

igure 2: Serial Monitor in action

The lcd will display on lines 3 and 4 the ticker headline text, cut off at 35 characters in order to keep the display tidy. This action does not affect the headline running on the news ticker.

fig_02_lcd_max_newsticker_96_dpi

figure 3: news ticker doing its job

Discussion

True interactivity needs multiple microcontroller boards
In the present sketch the news ticker is instructed to display a text string  “News Ticker . . .” followed by the news headline. To introduce a new running headline on the news ticker the sketch needs to be recompiled. It is possible to write a sketch for interactive, continuously running ticker where the running news headline can be replaced by a fresh headline while the ticker keeps running all the time. The challenge here is that the Arduino is a system that does not support multiple processes running simultaneously. It either runs the news ticker while Serial Monitor is silent, or it runs the Serial Monitor while the news ticker is silent. While text is being typed into the Serial Monitor window the news ticker runs slower or its running  ‘hiccups’. One solution is to ‘feed’ the Arduino’s working memory slowly by adding one character of a string at a time while the news ticker keeps running, at the cost of ticker running speed. The microprocessor in the Arduino platform is powerful enough to support this solution, although the response times between hitting the Enter key to send the typed-in text to the Arduino and the actual start of the headline being displayed in the running news ticker will be disappointingly long. I am inclined to research a solution that involves running each separate process on a separate, dedicated Arduino. Both Arduino’s are then connected via a serial or master-slave protocol: the master listens for headline text, the slave runs the news ticker.

four text scrolling directions:
http://www.best-microcontroller-projects.com/max7219.html

Acknowledgements
Thanks to the folks at Brainy Bits with their perfect description of how to work with the MAX7219 LED dot matrix module:
https://brainy-bits.com/tutorials/scroll-text-using-the-max7219-led-dot-matrix/

 

The sketch (lcd_monitored_MAX7219_dotmatrix_news_ticker.zip) can be downloaded here

Leave a comment

Blog at WordPress.com.

Up ↑