IoT Based P10 LED Display Controller

by N-08 Labs in Circuits > Arduino

75 Views, 1 Favorites, 0 Comments

IoT Based P10 LED Display Controller

49c26e3b-bef7-44fe-b134-14920878ec89.jpg
49c26e3b-bef7-44fe-b134-14920878ec89.jpg
P10 LED Display #electronics #arduino #wifi #diyelectronics #shorts #iot
P10 LED Display #electronics #arduino #wifi #diyelectronics #shorts #iot
P10 LED Display WiFi Controller Board

Control a P10 Display Using Arduino & ESP8266 via Telegram Bot


Introduction:


In this project, we will control a P10 LED display using an Arduino Nano and an ESP8266 module. The text displayed on the P10 module is sent via a Telegram bot, making it easy to update remotely. The ESP8266 receives messages from Telegram, forwards them to the Arduino Nano via serial communication, and the Nano then displays the text on the P10 module. The text will scroll automatically for better visibility.


Full video of the project https://youtu.be/WQDSzZuawzE


visit my YouTube channel for more such projects www.youtube.com/@N08labs


visit my Instagram

Supplies

68782136-578b-4469-9eb2-04c7fa012840.jpg
5836de01-ad01-4dae-a9b7-436d68aec869.jpg

Components Required:


  1. Arduino Nano
  2. ESP8266 (ESP-01 or NodeMCU)
  3. P10 LED Display Module
  4. 5V Power Supply (2A or more)
  5. Male Header Pins
  6. Jumper Wires
  7. Soldering Equipment

Circuit Diagram & Connections:

5a42c812-0ce6-4bc7-85b3-b286529387fe.jpg
f4332467-f4ae-4028-a67a-582d36800a7c.jpg
4b6b9123-ff58-4b36-9aeb-afbf9abdd6ca.jpg
7b7d8f56-c07b-4981-8dcd-e6834e2952c7.jpg
94d10275-60f6-4841-b95b-97f26d6a6300.jpg
bbead68b-5efc-480a-9e31-4d2a30cb2ad7.jpg
d49c862a-4685-4cdf-9cc2-81b474ddcee3.jpg
56ffc3ea-f32e-44fb-b131-39c1befd160d.jpg
ebf77fe1-354a-4cd1-8939-e62414768f70.jpg
fa4d5000-e369-4ca5-bc01-4d6c174e2602.jpg
6f2c89f1-f693-455f-874c-2d536b559f94.jpg
871b3c66-5b21-4502-9717-df7ecfe4e9b5.jpg
00bc7b64-4b89-4100-9e27-55d77204868a.jpg
16134d6e-4a66-4a86-af7f-3f4368f74f30.jpg
4b821a40-bba9-4c61-8387-86cef21652a2.jpg
96dbf12a-606a-485c-9b9b-f8cedff3dc50.jpg

ESP8266 to Arduino Nano:

  1. ESP8266 TX → Arduino Nano RX (Pin 0)
  2. ESP8266 GND → Arduino Nano GND
  3. ESP8266 VCC → 3.3V Power Supply
  4. ESP8266 CH_PD → 3.3V (Enable Pin)

P10 Display to Arduino Nano:

  1. P10 Module CLK → Arduino Nano Pin X
  2. P10 Module DATA → Arduino Nano Pin Y
  3. P10 Module OE → Arduino Nano Pin Z
  4. P10 Module A/B → Arduino Nano Pin W
  5. P10 Module GND → Common GND


How It Works:

  1. The Telegram bot is set up to receive text messages.
  2. The ESP8266 connects to Wi-Fi and listens for new messages.
  3. When a message is received, the ESP8266 prints it on the serial monitor.
  4. The Arduino Nano reads the serial data and sends it to the P10 display.
  5. The text automatically scrolls across the display.

Code:

Libraries Used:

  1. UniversalTelegramBot.h – For Telegram bot integration
  2. DMD.h – For controlling the P10 LED display
  3. TimerOne.h – For timer-based operations
  4. SystemFont5x7.h & Arial_black_16.h – For text fonts



Code for ESO8266

Enter your own Wi-Fi and Teligram credentials

#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <UniversalTelegramBot.h>
#include <ArduinoJson.h>

const char* ssid = "N-08 LABS "; //your wifi id
const char* password = "n08labs"; //your wifi password

const int nw = 2;



#define CHAT_ID1 "685XXXXXXXX" //your Telegarm chat ID
#define BOTtoken "752XXXXXXXXXXXXXXXXXXXxXXXXXXXX" //your bot token


//#define CHAT_ID1 "1231230123" //your Telegarm chat ID
//#define BOTtoken "6330218641:AAEds1kjfGaeA-7oX48ghCfNdFM-9joOEvY" // your Bot Token (Get from Botfather)

#ifdef ESP8266
X509List cert(TELEGRAM_CERTIFICATE_ROOT);
#endif


WiFiClientSecure client;
UniversalTelegramBot bot(BOTtoken, client);

int botRequestDelay = 1000;
unsigned long lastTimeBotRan;

void handleNewMessages(int numNewMessages) {
for (int i = 0; i < numNewMessages; i++) {
String chat_id = String(bot.messages[i].chat_id);
if (chat_id != CHAT_ID1) {
bot.sendMessage(chat_id, "Unauthorized user", "");
continue;
}
String text = bot.messages[i].text;
Serial.println(text);
String from_name = bot.messages[i].from_name;
delay(1000);
}
}

void setup() {
Serial.begin(9600);
pinMode(nw, OUTPUT);
digitalWrite(nw, LOW);

#ifdef ESP8266
configTime(0, 0, "pool.ntp.org"); // get UTC time via NTP
client.setTrustAnchors(&cert); // Add root certificate for api.telegram.org
#endif

WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
delay(1000);
}
delay(500);
digitalWrite(nw, HIGH);
delay(500);
digitalWrite(nw, LOW);
delay(500);
digitalWrite(nw, HIGH);
delay(500);
digitalWrite(nw, LOW);
delay(1000);
}

void loop() {
if (millis() > lastTimeBotRan + botRequestDelay) {
int numNewMessages = bot.getUpdates(bot.last_message_received + 1);

while (numNewMessages) {
handleNewMessages(numNewMessages);
numNewMessages = bot.getUpdates(bot.last_message_received + 1);
}
lastTimeBotRan = millis();
}
}


Code for Arduino

#include <SPI.h>
#include <DMD.h>
#include <TimerOne.h>
#include "SystemFont5x7.h"
#include "Arial_black_16.h"
#define ROW_MODULE 1

#define COLUMN_MODULE 1

DMD p10(ROW_MODULE, COLUMN_MODULE);

char message[200];
char char_read;
byte pos_index = 0;
int i;
char welcome_screen[] = "N-08 LABS @n08labs";

void p10scan()
{
p10.scanDisplayBySPI();
}

void setup()
{
Timer1.initialize(1000);
Timer1.attachInterrupt(p10scan);
p10.clearScreen( true );
Serial.begin(9600);
strcpy(message,welcome_screen);
}
void loop()
{

if(Serial.available())
{
for(i=0; i<199; i++)
{
message[i] = '\0';
Serial.print(message[i]);
}
pos_index=0;
}

while(Serial.available() > 0)
{
p10.clearScreen( true );
if(pos_index < (199))
{
char_read = Serial.read();
message[pos_index] = char_read;
pos_index++;
}
}
p10.selectFont(Arial_Black_16);
p10.drawMarquee(message ,200,(32*ROW_MODULE)-1,0);
long start=millis();
long timer_start=start;
boolean flag=false;
while(!flag)
{
if ((timer_start+50) < millis())
{
flag=p10.stepMarquee(-1,0);
timer_start=millis();
}
}
}

Setting Up the Telegram Bot:

da751ff6-b17a-4a9a-8af2-37783a2ce646.jpg
ea8397e2-c97e-413e-811b-e14a838e1a03.jpg
293ca4b6-a4fe-4054-b8ba-49e11f5f9dcd.jpg
902a4538-83f2-4f85-89d2-a570236a5bbc.jpg
  1. Open Telegram and search for @BotFather.
  2. Create a new bot using the /newbot command.
  3. Copy the bot token provided.
  4. Use this token in the ESP8266 code for communication.


Uploading the Code:

  1. First, upload the ESP8266 code to establish Wi-Fi and Telegram bot communication.
  2. Then, upload the Arduino Nano code to handle the P10 display output.
  3. Ensure both are correctly wired and powered.

NOTE: Programming the ESP8266 after connecting to Arduino nano may not possibe


Final Testing

P10 LED Display #electronics #arduino #wifi #diyelectronics #shorts #iot
P10 LED Display WiFi Controller Board
  1. Power on the setup.
  2. Default message will appear.
  3. Send a message to your Telegram bot.
  4. The text should appear on the P10 display and start scrolling.

Watch my full video of this project https://youtu.be/WQDSzZuawzE