Home > Make > Information Display System using WeMOS and MAX7219

Information Display System using WeMOS and MAX7219

This tutorial is all about making a WiFi based information display system using WeMOS

This tutorial is all about making a WiFi based information display system. This system is built around ESP8266 but not the standalone ESP8266 instead WeMOS is used and programmed using Arduino IDE. So In this video, we will check out how to make an information display system like that using Wemos and MAX7219 based dot matrix display modules. The display system fetches data from the local/online server and displays the received. In this system, u can display any data that you want and that’s up to you however over here I am using this to display my YouTube subscribers and twitter followers count.

 

 
Code:

#include <ESP8266WiFi.h>
#include <SPI.h>
#include <bitBangedSPI.h>
#include <MAX7219_Dot_Matrix.h>

const byte chips = 4; //No of MAX7219 Dpt Matrix Display
unsigned long lastMoved = 0;
unsigned long MOVE_INTERVAL = 100;  // mS
int  messageOffset;

MAX7219_Dot_Matrix display (chips, 2);  // Chips / LOAD 
char message [90] = "WeArGenius                       "; //String to be displayed

const char* ssid = "weargenius"; // SSID Of the Router
const char* password = "omisoksbwn";// Access point Password
const char* host = "192.168.0.1"; //Server IP or URL
int requestTime=0;
int exitT=1;

void updateDisplay ()
{
  display.sendSmooth (message, messageOffset); //Display commands for the Matrix
  // next time show one pixel onwards
  if (messageOffset++ >= (int) (strlen (message) * 8))
    messageOffset = - chips * 8;
}  // end of updateDisplay

void setup() {
  display.begin (); //Initialize teh displays
  Serial.begin(115200); 
  delay(100);
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);
  WiFi.begin(ssid, password); // Initiate connection to the Wi-Fi network
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");  
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP()); //Printout the IP assigned to the module in DHCP
  display.setIntensity(15); // Intensity of the Dot Matrix module can be 0-15
}

void loop() {
  if(millis()-requestTime>120000){ // Request data from the Srever after every 2 Minutes
    requestTime=millis();
    Serial.print("connecting to ");
    Serial.println(host);
    
    WiFiClient client;
    const int httpPort = 80;
    if (!client.connect(host, httpPort)) { //Connect to SERVER
      Serial.println("connection failed");
    }
    
    String url = "/test/index.php"; //Path of the webpage in the server to request
    Serial.print("Requesting URL: ");
    Serial.println(url);
    client.print(String("GET ") + url + " HTTP/1.0\r\n" +
        "Host: " + host + "\r\n" + 
        "Connection: close\r\n\r\n");

    while (client.available() == 0) { // check Response from server
    if (millis() - requestTime >30000) { // 30 seconds to wait for response before timeout
      Serial.println(">>> Client Timeout !");
      client.stop();
      exitT=0;
      break;
    }
    }
    String line="";
    while(client.available()){ // Read response from Server
      line += client.readStringUntil('\r');
    }
    line=line.substring(line.indexOf('[')+1,line.indexOf(']')); // Process the response
    Serial.println(line);
    int i;
    for (i=0;i<line.length();i++) // Put response  to char array to display
      message[i]=line[i]; 
    if(exitT==1){ 
      exitT=1;
      Serial.println("closing connection");
      client.stop();
    }
  }
  for(int i=0;i<5000;i++){ // Display the content
    if (millis () - lastMoved >= MOVE_INTERVAL){
      updateDisplay ();
      lastMoved = millis ();
    }
    delay(1);
  }
}

 

Links:

 

MAX7219 Library for WeMOS: bit.ly/2oTtoty
Arduino HTTP Call (ESP8266): bit.ly/2r8yKBp
Fetch data using XPATH and PHP: bit.ly/2pGB0zC
Programming Esp8266 using Arduino IDE: bit.ly/2hdARij
Github Repository: bit.ly/2r8GFhX
Schematic: bit.ly/2pG6ogI

More Videos on ESP8266: bit.ly/2ijh6qX
Projects Like This: bit.ly/2r8x8rr
======================================================
Related VIdeos:

Getting started with ESP8266 : bit.ly/2fchgTc
ESP8266 with Raspberry Pi : bit.ly/2fchHgb

********************************************************************
Subscribe on YouTube : goo.gl/FhfdL7

Guys Subscribe to my channel for latest contents into your inbox.
Support me to keep going.

Support me on Patreon : bit.ly/2jcjTSo
___________________________________________

Website: www.weargenius.in
Twitter: twitter.com/geekybikash
YouTube: www.youtube.com/weargenius
Instagram: www.instagram.com/weargenius/
GIT : github.com/oksbwn
Facebook: www.facebook.com/geekybikash

Bikash Panda
Catch Me On

Bikash Panda

Blogger / Embedded System Developer at WeArGenius
A techie, tinkerer and tech lover, who loves to blog and feels everyone can learn tech provided they have the right attitude towards learning and passion. By profession, I am an IOT developer working in Smart Home/ Smart Grid domain.
Bikash Panda
Catch Me On
  1. No comments yet.
  1. No trackbacks yet.