You may have seen a lot of typical digital LED boards where one has to manually change information using a keyboard or another tool to update the displayed information. However, these notice boards are easily transformable into Wireless led board. Bluetooth is one such method. The information on the LED panel may be remotely updated through our smartphone by adding Bluetooth. Here, an Arduino Uno is coupled with an HC05 Bluetooth module, which receives data given by the smartphone application. The information will then be processed by Arduino and shown on the LED board.
Arduino and Bluetooth are often utilized in the development of any IoT-based application; by following the link, you may find several helpful Arduino-based IoT projects.
Materials Used To Make Wireless LED Board
- Arduino UNO
- 32*16 P10 LED module
- HC05 Bluetooth module
- 5V,3 AMP SMPS
- 16 Pin FRC connector
- Connecting wires
- Jumpers
P10 LED Matrix Display Module
P10 is a 32*16 LED Matrix module that is commonly used to display large ads. Each unit of the P10 LED Module has 512 high-intensity LEDs, with 32 LEDs in each row and 16 LEDs in each column.
P10 LED modules can be multiplexed to create a larger display. A P10 module has two ports: an input port and an output port. An input port receives data from the Arduino side, while an output port connects the module to another LED P10 module.
Pin Description of P10 LED Module:
- Enable: By sending a PWM pulse to this pin, you may change the brightness of the LED panel.
- A, B: These are referred to as multiplex select pins. They use digital input to pick any number of multiplex rows.
- Shift clock (CLK), Store clock (SCLK), and Data: These are the normal shift register control pins. Here a shift register 74HC595 is used.
Connection Diagram
The following is a complete circuit diagram for the P10 module with Arduino and Bluetooth module:
Programming the Arduino for P10 Wireless LED Board
The whole code for this Wireless led board utilizing Bluetooth module and Arduino is provided after the tutorial, but we will discuss it in depth below.
Download and install the DMD.h and TimerOne.h libraries from the links provided, and then include all of the necessary libraries in your code. Include the “Arial Black font” library as well for the text font that will be shown on the LED board.
#include <SPI.h>
#include <DMD.h>
#include <TimerOne.h>
#include "SystemFont5x7.h"
#include "Arial_black_16.h"
In the following step, provide the number of rows and columns. Because we are just using one module, the ROW and COLUMN values will be 1.
#define ROW_MODULE 1
#define COLUMN_MODULE 1
DMD p10 (ROW_MODULE, COLUMN_MODULE);
Then declare all of the variables that will be utilized in the program. There are two Arrays here, one for storing LED board messages and the other for storing a welcome message (Welcome to IoT Design).
char message[200];
char char_read;
byte pos_index = 0;
int i;
char welcome_screen[] = "Welcome to IoT Design";
The function p10scan() is developed to validate the incoming data from the Arduino side via the SPI Terminals. If it gets any data, it will activate an interrupt pin to do particular actions.
void p10scan()
{
p10.scanDisplayBySPI();
}
We started the timer and connected the interrupt to the method p10scan() within setup(). To begin, use the function clearScreen(true) to turn off all the pixels on the LED board. Then, using the strcpy method, copy the welcome screen array to the message array to display the welcome message till we give any message via the Bluetooth program.
void setup()
{
Timer1.initialize(2000);
Timer1.attachInterrupt(p10scan);
p10.clearScreen( true );
Serial.begin(9600);
strcpy(message,welcome_screen);
}
Inside the endless loop, create code to receive the Bluetooth application's message. So, whenever the function Serial.available() returns a value larger than zero, it indicates that data is present at the serial port. The received message is then copied to the array.
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++;
}
}
To print the string “Welcome to IoT Design” on the LED matrix module in the specified font, use the selectFont() method and the drawMarquee() function.
p10.selectFont(Arial_Black_16);
p10.drawMarquee(message ,200,(32*ROW_MODULE)-1,0);
Finally, to make the text scroll, use a certain time period to shift the entire message from right to left.
long start=millis();
long timer_start=start;
boolean flag=false;
while(!flag)
{
if ((timer_start+30) < millis())
{
flag=p10.stepMarquee(-1,0);
timer_start=millis();
}
}
This is How to make a Wireless led board using Arduino and Bluetooth to show ads on a P10 LED display board.
Complete code and the demonstration video are given below.
Code wireless led board
#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[] = "Welcome to IoT Design";
void p10scan()
{
p10.scanDisplayBySPI();
}
void setup()
{
Timer1.initialize(2000);
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+30) < millis())
{
flag=p10.stepMarquee(-1,0);
timer_start=millis();
}
}
}