1. Project introduction
In order to improve the real-time and accuracy of bus stop information, it is convenient for passengers to know the bus arrival information in time, thereby improving the convenience and comfort of bus travel. Traditional bus arrival information is achieved through manual announcements or static stop signs. This method has problems such as untimely, inaccurate, and inconvenient information. The current design is based on the STC89C52 microcontroller and the MAX7219 dot matrix LED driver module. The bus LED screen uses SYN6288 to broadcast the arrival information via voice, which can display the arrival information more accurately and improve the efficiency and convenience of bus travel.
The MAX7219 dot matrix LED driver module is controlled by the STC89C52 microcontroller to convert the information to be displayed into a dot matrix image, and then the MAX7219 dot matrix LED driver module controls the 2*8 LED display to be displayed. At the same time, through the SYN6288 voice module, the arrival information is converted into voice announcements for the convenience of passengers. In this way, passengers can not only see the arrival information, but also hear the voice announcement, which improves the real-time and accuracy of the information and facilitates passengers to understand the bus arrival information in a timely manner.
2. Design ideas
2.1 Hardware design
This design uses STC89C52 microcontroller as the main control chip, the MAX7219 dot matrix LED driver module controls the 2*8 LED display, and the SYN6288 voice module performs voice broadcasting.
Specific hardware design:
(1) STC89C52 microcontroller
STC89C52 microcontroller is a high-performance, low-power 8-bit microcontroller with rich peripheral resources, supports ISP download and online simulation debugging, and is suitable for various applications.
(2) MAX7219 dot matrix LED driver module
MAX7219 is an integrated circuit that can drive an 8×8 dot matrix LED display. It has the characteristics of serial input and parallel output, and can easily control multiple LED displays. This design uses the MAX7219 dot matrix LED driver module to control a 2*8 LED display to display bus stop information.
(3) SYN6288 voice module
SYN6288 is a speech synthesis chip that can convert text into speech output. This design uses the SYN6288 voice module for voice broadcasting to realize voice prompts for bus arrival information.
2.2 Software design
This design uses the Keil C51 compiler for software development. The specific software design is as follows:
(1)LED display control program
The LED display control program mainly implements the MAX7219 dot matrix LED driver module to control a 2*8 LED display to display bus stop information.
Specific implementation process:
① Initialize the MAX7219 dot matrix LED driver module and set parameters such as display mode, scan limit, and brightness.
② Convert the information to be displayed into dot matrix data and store it in the array.
③ Send the dot matrix data to the MAX7219 dot matrix LED driver module through the SPI bus to realize the display of the LED display.
(2) Voice broadcast program
The voice broadcast program mainly implements the SYN6288 voice module for voice broadcast and realizes the voice prompt of bus arrival information.
Specific implementation process:
① Initialize the SYN6288 voice module and set parameters such as baud rate, voice speed, and volume.
② Convert the information to be broadcast into voice data and store it in the array.
③ Send the voice data to the SYN6288 voice module through the serial port to realize voice broadcast.
2.3 Design implementation
This design uses STC89C52 microcontroller as the main control chip, the MAX7219 dot matrix LED driver module controls the 2*8 LED display, and the SYN6288 voice module performs voice broadcasting.
Code design ideas:
(1)LED display control program
① Initialize the MAX7219 dot matrix LED driver module
void Init_MAX7219(void)
{
Send_Max7219(0x09, 0x00); //Decoding method: BCD code
Send_Max7219(0x0a, 0x03); //Brightness
Send_Max7219(0x0b, 0x07); //Scan limit: 8 digital tubes
Send_Max7219(0x0c, 0x01); // Turn off display test
Send_Max7219(0x0f, 0x00); //Normal working mode
}
② Convert the information to be displayed into dot matrix data and store it in the array
unsigned char code LED_Data[16][8] = {
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // empty
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // empty
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // empty
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // empty
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // empty
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // empty
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // empty
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // empty
{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}, // All on
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // empty
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // empty
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // empty
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // empty
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // empty
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, // empty
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00} // empty
};
③ Send the dot matrix data to the MAX7219 dot matrix LED driver module through the SPI bus to realize the display of the LED display
void Display_LED(unsigned char *LED_Data)
{
unsigned char i;
for(i=1; i<=8; i++)
{
Send_Max7219(i, LED_Data[i-1]);
}
}
(2) Voice broadcast program
① Initialize SYN6288 voice module
void Init_SYN6288(void)
{
SCON = 0x50; // Serial port working mode 1
TMOD &= 0x0f; // Timer 1 working mode 0
TMOD |= 0x20;
TH1 = 0xfd; // Baud rate: 9600
TL1 = 0xfd;
TR1 = 1; // Start timer 1
P1 = 0xff; // Turn off the SYN6288 voice module
}
② Convert the information to be broadcast into voice data and store it in the array
unsigned char code Voice_Data[10][10] = {
"Please note that the bus is about to arrive at the station, please be ready to get on the bus",
"Passengers please pay attention to safety and ride in a civilized manner. Thank you for your cooperation.",
"Passengers are requested not to smoke on the bus and keep the air in the carriage fresh",
"Please do not make loud noises on the bus and keep the carriage quiet",
"Passengers are requested not to litter on the bus and keep the carriage clean",
"Please do not occupy seats on the bus and give up your seat to those who need it",
"Passengers please do not talk on the phone on the bus and respect others",
"Passengers are requested not to eat on the bus and keep the carriage clean and tidy",
"Passengers are requested not to crowd the bus and keep the compartments clear",
"Passengers please do not take photos on the bus and respect other people's privacy."
};
③ Send the voice data to the SYN6288 voice module through the serial port to realize voice broadcasting
void Play_Voice(unsigned char *Voice_Data)
{
unsigned char i;
P1 = 0xfe; //Open SYN6288 voice module
for(i=0; i< strlen(Voice_Data); i++)
{
SBUF = Voice_Data[i];
while(!TI); // Wait for sending to complete
TI = 0;
}
P1 = 0xff; // Turn off the SYN6288 voice module
}
3. Code design
3.1 Max7219 control code
#include #include #define uchar unsigned char #define uint unsigned int //Define Max7219 port sbit Max7219_pinCLK = P2^2; sbit Max7219_pinCS = P2^1; sbit Max7219_pinDIN = P2^0; uchar code disp1[38][8]={ {0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C},//0 {0x10,0x18,0x14,0x10,0x10,0x10,0x10,0x10},//1 {0x7E,0x2,0x2,0x7E,0x40,0x40,0x40,0x7E},//2 {0x3E,0x2,0x2,0x3E,0x2,0x2,0x3E,0x0},//3 {0x8,0x18,0x28,0x48,0xFE,0x8,0x8,0x8},//4 {0x3C,0x20,0x20,0x3C,0x4,0x4,0x3C,0x0},//5 {0x3C,0x20,0x20,0x3C,0x24,0x24,0x3C,0x0},//6 {0x3E,0x22,0x4,0x8,0x8,0x8,0x8,0x8},//7 {0x0,0x3E,0x22,0x22,0x3E,0x22,0x22,0x3E},//8 {0x3E,0x22,0x22,0x3E,0x2,0x2,0x2,0x3E},//9 {0x8,0x14,0x22,0x3E,0x22,0x22,0x22,0x22},//A {0x3C,0x22,0x22,0x3E,0x22,0x22,0x3C,0x0},//B {0x3C,0x40,0x40,0x40,0x40,0x40,0x3C,0x0},//C {0x7C,0x42,0x42,0x42,0x42,0x42,0x7C,0x0},//D {0x7C,0x40,0x40,0x7C,0x40,0x40,0x40,0x7C},//E {0x7C,0x40,0x40,0x7C,0x40,0x40,0x40,0x40},//F {0x3C,0x40,0x40,0x40,0x40,0x44,0x44,0x3C},//G {0x44,0x44,0x44,0x7C,0x44,0x44,0x44,0x44},//H {0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x7C},//I {0x3C,0x8,0x8,0x8,0x8,0x8,0x48,0x30},//J {0x0,0x24,0x28,0x30,0x20,0x30,0x28,0x24},//K {0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7C},//L {0x81,0xC3,0xA5,0x99,0x81,0x81,0x81,0x81},//M {0x0,0x42,0x62,0x52,0x4A,0x46,0x42,0x0},//N {0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C},//O {0x3C,0x22,0x22,0x22,0x3C,0x20,0x20,0x20},//P {0x1C,0x22,0x22,0x22,0x22,0x26,0x22,0x1D},//Q {0x3C,0x22,0x22,0x22,0x3C,0x24,0x22,0x21},//R {0x0,0x1E,0x20,0x20,0x3E,0x2,0x2,0x3C},//S {0x0,0x3E,0x8,0x8,0x8,0x8,0x8,0x8},//T {0x42,0x42,0x42,0x42,0x42,0x42,0x22,0x1C},//U {0x42,0x42,0x42,0x42,0x42,0x42,0x24,0x18},//V {0x0,0x49,0x49,0x49,0x49,0x2A,0x1C,0x0},//W {0x0,0x41,0x22,0x14,0x8,0x14,0x22,0x41},//X {0x41,0x22,0x14,0x8,0x8,0x8,0x8,0x8},//Y {0x0,0x7F,0x2,0x4,0x8,0x10,0x20,0x7F},//Z {0x8,0x7F,0x49,0x49,0x7F,0x8,0x8,0x8},//中 {0xFE,0xBA,0x92,0xBA,0x92,0x9A,0xBA,0xFE},//Country }; void Delay_xms(uint x) { uint i,j; for(i=0;i< x;i++) for(j=0;j< 112;j++); } //--------------------------------------------- //Function: Write bytes to MAX7219(U3) //Entry parameters: DATA //Export parameters: none //illustrate: void Wri_Max7219_bytete(uchar DATA) { uchar i; Max7219_pinCS=0; for(i=8;i >=1;i--) { Max7219_pinCLK=0; Max7219_pinDIN=DATA&0x80; DATA=DATA< < 1; Max7219_pinCLK=1; } } //------------------------------------------------ //Function: Write data to MAX7219 //Entry parameters: dress, datad //Export parameters: none //illustrate:
Previous article:Design of frequency measurement module circuit using microcontroller as core
Next article:Design of intelligent clothes drying rack based on STC89C52 microcontroller
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- EEWORLD University Hall----Live Replay: Introduction to Keysight's New Optical Communication Test Solution
- A complete list of filter circuits, save it for future use!
- How to choose FPGA development board
- Let’s discuss: When you make PPT, do you make the template yourself or download it from the Internet?
- TI points exchanged for E coins, but not received
- EEWORLD University Hall ---- Data Structure and Algorithm Peking University Zhang Ming
- NUCLEO_G431RB Review: Get G431
- Thank you for having you +EE @【chat, laugh, make noise】
- Op amp basics: DC biasing of active circuits
- Two Application Examples of EPROM in Single Chip Microcomputer Development