Home > Optoelectronic Circuits >Optoelectronic Display Circuits > Build a Bluetooth-controlled wireless scoreboard

Build a Bluetooth-controlled wireless scoreboard

Source: InternetPublisher:消失的歌 Keywords: LED display Arduino Bluetooth control Updated: 2024/12/19

An electronic scoreboard is one of the most important gadgets that anyone can have at any sports event. The old manual scoreboards using traditional methods are time consuming and prone to errors, so in situations where the display unit needs to be changed in real time, a computer scoreboard must be used. That is why in this project, we will build a Bluetooth controlled wireless scoreboard where we can change the score on the board by using an android app. The brain of this project is an Arduino Nano, and for the display part, we will use a P10 LED Matrix to remotely display the score in real time.

P10 LED Display Matrix

The P10 LED Matrix Display is the best way to make outdoor or indoor LED advertising boards. This panel has a total of 512 high-brightness LEDs mounted on a plastic housing designed for optimal display. It also has an IP65 waterproof rating, making it perfect for outdoor use. With this, you can make large LED signs by combining any number of these panels in any row and column structure.

pYYBAGLuJ5uAXldVAAqE9AInKko062.png

Our module size is 32*16, which means 32 LEDs per row and 16 LEDs per column. Therefore, there are a total of 512 LEDs in each LED sign. In addition to this, it is IP65 waterproof, can be powered by a single 5V power supply , has a very wide viewing angle, and can reach a brightness of 4500 nits. Therefore, you will be able to see it clearly in daylight. We have also used this P10 display and Arduino to build a simple LED board before.

P10 LED Matrix Pin Description:

This LED display board uses a 10-pin header for input and output connections, in this section, we have described all the necessary pins of this module. Also, you can see there is an external 5V connector in the middle of the module which is used to connect an external power supply to the board.

poYBAGLuJ5eAOFDRAAWvo_5j6Y0003.png

Enable: This pin is used to control the brightness of the LED panel by giving it a PWM pulse.

A, B: These are called Multiplexer Select pins. They take digital input to select any of the multiplexer rows.

Shift Clock (CLK), Store Clock (SCLK) and Data: These are the normal shift register control pins. Here a shift register 74HC595 is used.

Connect the P10 LED display module to the Arduino:

Connecting the P10 Matrix Display Module to Arduino is a very simple process, in our circuit, we have configured Pin 9 of the Arduino as the Enable pin, Pin 6 as Pin A, Pin 7 as Pin B, Pin 13 as CLK, Pin 8 as SCLK, Pin 11 is DATA and lastly Pin GND is the GND pin of both the module and the Arduino, the complete table below clearly explains the pin configuration.

P10 LED Module for Arduino UNO

poYBAGLuKDGAa1o9AAAxwKC-__o236.png

Note: Connect the power supply of the P10 module to an external 5V power supply, because 512 LEDs will consume a lot of power. It is recommended to connect a 5V, 3 Amp DC power supply to a single P10 LED module. If you plan to connect more number modules, please increase your S MPS capacity accordingly.

Components Required for the Arduino Scoreboard

Since this is a very simple project, the component requirements are very generic, the list of components needed is shown below, you should be able to find all of the materials listed at your local hobby store.

Arduino Nano

P10 LED Matrix Display

Breadboard

5V, 3A Switching Power Supply

HC-05 Bluetooth Module

Connect the wires

Arduino Scoreboard Circuit Diagram

The schematic for the Arduino LED Scoreboard is shown below. Since this project is very simple, I used the popular software Fritzing to develop the schematic.

poYBAGLuJ5GAHS6IAAE80TeiHOQ597.png

The working of the circuit is very simple, we have an android app and a bluetooth module, to successfully communicate with the bluetooth module you have to pair the HC-05 module with the android app. Once connected it is time to send the string we want to display, once the string is sent the Arduino processes the string and converts it into a signal that the internal 74HC595 shift resistor can understand , the data is sent to the shift resistor and after that it is ready to be displayed.

Arduino Scoreboard Code Explanation

After successfully completing the hardware setup, now it is time to program the Arduino Nano. Given below is the step by step description of the code. Also, you can get the complete Arduino Scoreboard code at the bottom of this tutorial.

First, we need to include all the libraries. We are using DMD.h library to control the P10 LED display. You can download and include it from the given GitHub link . After that, you need to include TimerOne.h library which will be used for interrupt programming in our code.

There are many front ends available in this repository, we used "Arial_bl ack_16" in this project.

#include

In the next step, define the number of rows and columns for our LED matrix board. We are using only one module in this project, so both ROW value and COLUMN value can be defined as 1.

#define ROW 1 
#define COLUMN 1 
#define FONT Arial_Black_16 
DMD led_module (ROW, COLUMN);

After that, all the variables used in the code are defined. A character variable is used to receive the serial data from the Android App, two integer values ​​are used to store the scores, and an array is defined to store the data that will eventually be displayed on the Matrix.

Character input;
Integers a = 0, b = 0;
integer flag = 0;
char cstr1[50];

A function s can_module() is defined which keeps checking for any incoming data from Arduino Nano through SPI. If yes then it will trigger an interrupt to execute certain events defined by the user in the program.

void scan_module() 
{ 
  led_module.scanDisplayBySPI(); 
}

Inside setup(), the timer is initialized and the interrupt is attached to the function scan_module, which has been discussed earlier. Initially, the screen is cleared using the function clear screen(true), which means that all pixels are defined as OFF.

In the setup, serial communication is also enabled using the function Serial.begin(9600), where 9600 is the baud rate for Bluetooth communication.

void setup()
{
  Serial.Start(9600);
  Timer1.initialize(2000); 
  Timer1.attachIn

Here, the availability of serial data is checked, whether there is valid data from Arduino. The data received from the App is stored in a variable.

if(Serial.av

Then, the received value is compared with the predefined variable. Here, in the Android application, two buttons are used to select the scores of the two teams. When button 1 is pressed, the character "a" is transmitted to the Arduino, and when button 2 is pressed, the character "b" is transmitted to the Arduino. Therefore, in this section, this data is matched, and if it matches, the corresponding score value is increased as shown in the code.

if (input == 'a' && flag == 0) 
  { 
    flag = 1; 
    A++;
  } 
  else if (input == 'b' && flag == 0) 
  { 
    flag = 1; 
    b++; 
  }
  other;

Then, the received data is converted into a character array, because the P10 matrix function can only display character data types. That is why all variables are converted and concatenated into a character array.

(String("HOME:")+String(a) + String(" - ") + String("AWAY:")+String(b)).toCharArray(cstr1, 50);

Then, to display the information in the module , the font is selected using the selection() function. Then the drawMarquee() function is used to display the required information on the P10 board.

led_module.selec

Finally, since we need to scroll the message display, I wrote a code to move the entire message from right to left using a specific period.

long start = milliseconds();
    Long time timing = start;
    bool flag = false;
    while (!flag) 
    { 
      if ((timming + 30) < millis()) 
      { 
        flag = led_module.stepMarquee(-1, 0); 
        timing = milliseconds();
      } 
    }

This marks the end of our encoding process. Now it is ready to upload.

Smartphone controlled scoreboard - Test

After uploading the code to Arduino, it is time to test the project. Before that, it is necessary to install the android application on our smartphone . You can download the P10 Score Board app from the given link. After installation, open the app and the home screen should look like the image below.

poYBAGLuJ4qAZ7h7AADvhanjNGU489.png

Click the SCAN button to add the Bluetooth module with the App. This will display the phone's list of paired Bluetooth devices. If you have not paired the HC-05 Bluetooth module before, pair the module using your phone's Bluetooth settings before performing this step. The screen will look like this:

poYBAGLuJ4aAPdQ3AABmWC8c5zw573.png

Then, click on "HC-05" from the list as this is the name of the Bluetooth module we are using here. Once you click it, it will say on the screen that it is connected. We can then proceed with using the scoreboard.

Click any button between Home and Away as shown in the app. If the Home button is selected, the score for Home will increment in the P10 display. Similarly, if the Away button is selected, the score for Away will increment. The following image shows how the final screen will look like.

pYYBAGLuJ4OAQsSKAAhgwuy2FLY749.png

#include

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号