Professional Documents
Culture Documents
REport Final
REport Final
IOT102-SE1825, Group 9
Ngo Khai Nguyen, Ngo Dang Khoa, Tran Tien Dat, Ngo Tran Quan, and Le The Dung
FPT University, Ho Chi Minh Campus, Vietnam
{nguyennkse150947, khoandse182731, datttse172487, quanntse160230}@fpt.edu.vn, dunglt96@fe.edu.vn
Abstract
In this project, we created a system that lets people control and display content on an LED matrix using Bluetooth connectivity.
Our setup includes an 8x32 LED matrix, a Bluetooth module, a DS1307 module to get the date and time, and an LM35 sensor
to measure the temperature. With this setup, users can connect their smartphones to the Bluetooth module through a specially
designed mobile app. This app allows them to manage and customize what is shown on the LED matrix from their phones, making
it very convenient and user-friendly.
The system continuously collects the latest date, time, and temperature from the DS1307 and LM35 modules. Users have the
option to display this information or to show custom text with various effects, making the display more engaging and personalized.
The system operates in two distinct modes: automatic and manual. In automatic mode, it cycles through displaying the date, time,
and temperature, ensuring that users always have the most up-to-date information. In manual mode, users can input and display
any custom text they want, providing a high level of customization.
I. I NTRODUCTION
This project focuses on developing a Bluetooth-controlled LED matrix system that allows people to control and display
various information on an LED screen. The system includes several important components, such as a Bluetooth module for
wireless communication, an 8x32 LED matrix for displaying content, a DS1307 real-time clock for getting the current date
and time, and an LM35 temperature sensor for measuring the temperature.
The main goals of this project are to accurately display the date, time, and temperature data and to give users the ability to
customize what appears on the LED matrix using a mobile app. This means that users can connect their smartphones to the
system via Bluetooth and use the app to change and control the display.
The system features two main modes of operation. In automatic mode, the LED matrix continuously shows real-time data,
including the current date, time, and temperature. This is useful for users who want to keep track of important information
without having to manually update it. In manual mode, users can display custom text with different visual effects, allowing
for greater personalization and creativity. This mode is perfect for displaying messages, names, or any other text that the user
wants.
II. M ETHODS AND M ATERIALS
A. System Model and Block Diagram
Fig. 2. Arduino.
Bluetooth Module
The Bluetooth module plays a crucial role in the project by establishing wireless connectivity between he LED matrix
system and external devices like smartphones. Through a dedicated mobile app, users can connect to the module to toggle
between automatic mode, which displays real-time date, time, and temperature, and manual mode, where custom text and
visual effects can be showcased on the LED matrix. This bidirectional communication allows users to send commands via
Bluetooth, providing remote control over what is displayed
TABLE I
I NTERFACING BETWEEN A RDUINO AND ITS COMPONENTS
C. Software Programming
Adruino, IDE Android app: Serial Bluetooth Terminal
CODE:
# include <Wire . h>
# include <RTClib . h>
# include <MD Parola . h>
# include <MD MAX72xx . h>
# include < S o f t w a r e S e r i a l . h>
/ / Pin d e f i n i t i o n s f o r LED m a t r i x
# define HARDWARE TYPE MD MAX72XX : : FC16 HW
# define MAX DEVICES 4
# define CLK PIN 13
# define DATA PIN 11
# define CS PIN 10
/ / B l u e t o o t h module p i n s
# d e f i n e BLUETOOTH RX 1
# d e f i n e BLUETOOTH TX 0
char r e c e i v e d D a t a [ 5 0 ] = ” ” ;
b o o l manualMode = f a l s e ;
void s e t u p ( ) {
S e r i a l . begin (9600);
Bluetooth . begin (9600);
Wire . b e g i n ( ) ;
r t c . begin ( ) ;
myDisplay . begin ( ) ;
myDisplay . setIntensity (3); / / S e t b r i g h t n e s s (0 −15)
myDisplay . s e t T e x t A l i g n m e n t ( PA CENTER ) ;
myDisplay . setPause (1000); / / Pause b e t w e e n e f f e c t s
void loop ( ) {
readBluetooth ( ) ;
i f ( manualMode ) {
displayManualMode ( ) ;
} else {
displayAutomaticMode ( ) ;
}
}
void r e a d B l u e t o o t h ( ) {
s t a t i c byte index = 0;
while ( Bluetooth . a v a i l a b l e ( ) > 0) {
char r e c e i v e d C h a r = B l u e t o o t h . r e a d ( ) ;
i f ( r e c e i v e d C h a r == ’ \ n ’ ) {
r e c e i v e d D a t a [ i n d e x ] = ’ \0 ’ ; / / N u l l − t e r m i n a t e t h e s t r i n g
processCommand ( r e c e i v e d D a t a ) ;
index = 0;
} else {
r e c e i v e d D a t a [ i n d e x ++] = r e c e i v e d C h a r ;
i f ( i n d e x >= s i z e o f ( r e c e i v e d D a t a ) ) {
index = s i z e o f ( receivedData ) − 1;
}
}
}
}
void displayDateTime ( ) {
now = r t c . now ( ) ;
char d a t e T i m e S t r i n g [ 2 0 ] ;
s p r i n t f ( d a t e T i m e S t r i n g , ”%02d :%02 d %02d−%02d−%04d ” , now . h o u r ( ) , now . m i n u t e ( ) , now . day ( ) , now
m y D i s p l a y . d i s p l a y T e x t ( d a t e T i m e S t r i n g , PA CENTER , 0 , 0 , PA SCROLL LEFT , PA SCROLL LEFT ) ;
}
void d i s p l a y T e m p e r a t u r e ( ) {
i n t rawADC = a n a l o g R e a d ( A0 ) ;
f l o a t t e m p e r a t u r e = ( rawADC / 1 0 2 3 . 0 ) * 5 0 0 . 0 ; / / LM35 c a l i b r a t i o n f o r 10mV p e r d e g r e e C e l s i u
char t e m p S t r i n g [ 1 0 ] ;
s p r i n t f ( t e m p S t r i n g , ” %.2 fC ” , t e m p e r a t u r e ) ;
m y D i s p l a y . d i s p l a y T e x t ( t e m p S t r i n g , PA CENTER , 0 , 0 , PA SCROLL LEFT , PA SCROLL LEFT ) ;
}
v o i d d i s p l a y C u s t o m T e x t ( char * t e x t ) {
m y D i s p l a y . d i s p l a y T e x t ( t e x t , PA CENTER , 0 , 0 , PA SCROLL LEFT , PA SCROLL LEFT ) ;
}
void displayManualMode ( ) {
/ / Display custom t e x t r e c e i v e d v i a B l u e t o o t h
displayCustomText ( receivedData ) ;
}
void displayAutomaticMode ( ) {
/ / D i s p l a y d a t e / t i m e and t e m p e r a t u r e i n s e q u e n c e
displayDateTime ( ) ;
delay (3000); / / Display date / time for 3 seconds
displayTemperature ( ) ;
delay (3000); / / Display temperature for 3 seconds
}
D. Programming Flowchart
In the Bluetooth-controlled LED matrix system, data input is received via Bluetooth from a smartphone. It connects to
retrieve either current date, time, and temperature automatically or custom text input manually. The system initializes modules
and attempts connection retries until successful. Depending on the mode chosen—Automatic or Manual—it processes data
from DS1307 and LM35 or custom text input. Data is then displayed on the LED matrix accordingly, providing real-time
information or user-defined messages with dynamic visual effects
Fig. 7. Flowchart