ESP8266-To-LED Matrix (Look Ma No Arduino)

by aapicella in Circuits > Wireless

16564 Views, 53 Favorites, 0 Comments

ESP8266-To-LED Matrix (Look Ma No Arduino)

ESP8266 Matrix

This project came about when I created this instructional: https://www.instructables.com/id/WIFI-Enabled-LED-...

I received comments from people that it could be accomplished without the Arduino. I took that as a challenge.

The purpose of this project is to program an ESP8266-12 to service up a web page with a form, then take the text loaded into the form and display it on a LED Matrix.

The ESP8266-12 (NodeMCU)

  • Connects to your Wifi (you supply SSID and password)
  • Starts a web server on port 80
  • Display IP Address on the LED Matrix until Text is entered.
  • Remove URL tags from text enter on webpage and send to LED Matrix
  • On your home internet router you may forward port 80 on that IP to enable it on the internet.

Parts Needed

ESP8266-Matrix.jpg
hello.png

You will need....

  1. Wifi Development board (esp8266-12 NodeMCU) for about $5 on Amazon here.
  2. 7219 LED Matrix 4 - 8x8 modules for about $8 on Amazon here
  3. Programmer for WIFI module, I used this one from Tayda Electronics for about $2 (make sure it has 3.3v option.
  4. Enclosure. I use a cigar box
  5. Power supply. I cut the end off an old 5v phone charger.
  6. Wires. Female to Female

Overview of the ESP8266 Development Board.

esp8266-12_mod.png
load_json.PNG
pick the board.png

I used the ESP8266-12e development board. One advantage this board has is the voltage regulator so I can power both the ESP8266 and LED Matrix with the same 5v line. This board is also tolerant of 5v inputs. If you want to be very careful you could attach the pins to bi directional level shifts. I did that originally but found it worked fine without them.

Add Support for the ESP8266 NodeMCU to the Arduino IDE:

  • In the Arduino IDE go to File menu, under preferences
  • Enter the following in the "Additional Board Managers URLs" 'http://arduino.esp8266.com/stable/package_esp8266com_index.json'
  • The in the Tools menu, click on "Board" and then "boards Manager'
    • "Install the ESP8266 by the ESP8266 Community

Add the LED Matrix Library

Include Library.png
Include Library-LEDMatrixDriver.png

The LED Matrix Library:

I was unable to compile the library I used on the Arduino so I had to switch to a different one. I picked the "LEDMatrixDriver"

To install this LEDMatrixDriver library:

  • In the top menu bar click "Sketch"
  • Then click "Include Library"
  • Then click "Manage Libraries..."
  • You will be given a list of libraries. Use search and find the LEDMatrixDriver
  • Click "Install"

Program the ESP8266

esp8266-12_mod.png

Programming the ESP8266:

  1. Connect the programmer to your PC or Laptop
  2. Connect he GPIO0 jumper before powering on the ESP8266
  3. Connect TX (transmit) and RX(receive)
  4. Connect Ground to Ground
  5. Connect 3.3v from programmer to ESP8266

Upload the program:

  • Change SSID and Password for your WiFi router.
  • Click on Sketch menu then Upload. (Ctrl+u) shortcut.
  • The program will upload to the ESP8266.
  • Once complete remove jumper from GPIO0

Connecting It Together

Connect the ESP8266 to the LED Matrix.

Connect pins with Female/Female wires:

  • DIN (data in) on Matrix ---> 13 or MOSI on ESP8266
  • Clock(CLK) on Matrix --> 14 or SCK on ESP8266
  • CS pin on Matrix define below --->( picked 15 on ESP8266)
  • Ground on Matrix --> Ground on ESP8266
  • +5v to Matrix
  • +5v to ESP8266 if you have a built in voltage regulator.
    • If not you can just a LM1117 and pull the 3.3v from it.

Programming Notes

Notes:

This program differed from having an Arduino because delays were in the original code. The ESP8266 could loop and wait for a web client to submit data and the Arduino could wait for serial traffic. Since the two were combined it wasn't possible to wait.

In order to move the characters smoothly across the screen I setup it up like this and put in the displayText() any time the code was in a loop waiting for something that it checks to see if the time to move the text.

const int ANIM_DELAY = 75; //speed of animation or text
unsigned long myTime=millis();  //Now

void displayText ( char * theText)
{
   if ( myTime + ANIM_DELAY < millis()) 
   {
        myTime=millis(); //now
        // Draw the text to the current position
        drawString(theText, len, x, 0);
        lmd.display();  
        // Advance to next coordinate
        if( --x < len * -8 )
            x = LEDMATRIX_WIDTH;
   }  
}

I hope you enjoy this Instructable.