You are on page 1of 5

2018 2nd IEEE Advanced Information Management,Communicates,Electronic and Automation Control Conference(IMCEC 2018)

Design of music Toy car based on smart phone Via


Bluetooth remote control
Yunqiang Li1,2,3, Qingji Xue1, Jinzhi He1, Tianxiang Zhao1
1. College of Computer & Information Engineering, Nanyang Institute of Technology, Nanyang, China
2. National Maglev Transportation Engineering R˂D Center, Tongji University, Shanghai, China
3.Key Laboratory of Road and Traffic Engineering of the Ministry of Education, Tongji University, Shanghai, China
liyq_2003@163.com,13581030@qq.com,zhaotianxiang2008@126.com

Abstract—This design is based on the STM32F103C8T6 use Bluetooth as the medium to control terminal of intelligent
microcontroller and UCOS-II operating system. Including the toy.
microcontroller module, the MP3 player module, the motor drive
module and the Bluetooth transceiver module. Each sub-module The major smart phones coming to the market support
assigns different priorities through establishing different tasks, several features like various communication methods, e.g.
each task delivers messages through the message mailbox, in Bluetooth, Wi-Fi etc. and has very high storage capacities. It
order to achieve the coordination of the various sub-modules. The opens up new area of research for remarkable changes in the
design uses two AA batteries for the main control module and modern technologies. The technology for communication
other sub-modules for power supply. Controlling is based on the between digital devices is truly changed due to addition of
smart phone’s Bluetooth function, through the mobile App to send
the task instructions to achieve the smart car of different ways of Bluetooth wireless standard. It has transformed conventional
movement and music playing function. wired devices to wireless without any risk of data or intrusion.

Keywords—STM32; Smart toys; Bluetooth remote control ˗ In this paper, we study the music toy car based on smart
HC-05; MP3 phone Via Bluetooth remote control, and implementation
method. The structure is organized as follows: Section 1
I. INTRODUCTION presents the overall structure of system and Section 2
establishes system hardware design. Section 3 establishes
Nowadays, smart toys are rich and colorful, but the vast system software design. Section 4 establishes the system
majority of smart toys must be equipped with a dedicated Integration test. Finally, Section 5 concludes the paper and
remote control using dry batteries, while for modern people, points out the valuable of the work.
discarding the waste battery to the environment pollution and
destruction is a problem that cannot be neglected. With the Fig. 1. The hardware schematic diagram
rapid popularization of smartphones, it is an inevitable trend to

Power Source SVR, Power filtering BOOT


Constant Voltage

Indicator Light MCU Bluetooth Interface


JLINK Interface

USB Interface
Crystal Resonance circuit
Reset Circuit Digital Extended Interface

978-1-5386-1803-5/18/$31.00 ©2018 IEEE 1976


II. HARDWARE DESIGN The RS385 DC motor using 12V driving voltage, the
fastest speed can reach 3800 rpm. Using l298n module drive
A. schematic diagram motor, with a voltage conversion chip, the 12V voltage can be
According to the design requirements, the hardware converted 5V voltage, The l298n module can drive two RS385
schematic diagram, as shown in Figure 1. The main control DC motor. As shown in Figure 2.
chip will use STM32F103C8T6 microcontroller to complete The L298 is a high voltage, high current dual full-bridge
the whole control operation, select RS385 DC motor to realize driver designed to accept standard TTL logic levels and drive
the movement of the car, the car has forward, back, turn left, inductive loads such as relays, solenoids, DC and stepping
right turn, acceleration, deceleration and other six kinds of motors. Two enable inputs are provided to enable or disable the
operation. Select the Risym l298n to realize the motor drive device independently of the input signals. The emitters of the
and the power supply of the main control module, select the lower transistors of each bridge are connected together and the
HC-05 Bluetooth module to realize the receiving of the corresponding external terminal can be used for the connection
Handset app control instruction, select the player mini music of an external sensing resistor. An additional supply input is
player to realize the decoding conversion to the TF audio file, provided so that the logic works at a lower voltage. As shown
The SJ2038 power amplifier module is used to amplify the in Figure 3.
audio signal after decoding and to drive sound.
Car chassis is four-wheel structure with the front direct
wheels that play a supportive role and the rear driving wheels
each of which was independently driven by a DC motor.
Buttons of the Smartphone is achieved by matrix keyboard
which could realize multiple functions of forward, backward,
left and right turns, acceleration, deceleration, stop, etc.

B. System Main Module


(1)The Core Controller
The processor adopted by the system which is the Fig. 3. The L298 Motor Driver
STM32F103 of STMicroelectronics Company. The processor
of the 32-bit kernel is the Cortex M3. The chips working (2) Bluetooth module HC-05
frequency up to 72 MHz and building in high speed memory
(flash memory is as high as 128k bytes and SRAM is as high as Bluetooth is fairly simple to use and can be used to connect
20k bytes) has the rich I/O port and peripherals connected to up to seven devices at a time. It is also easy to switch between
two APB bus. It has a variety of standard communication devices or find and connect to any new devices. Bluetooth
interface with three generic 16-bit timers, two I2C, SPI, three devices, such as mobile phones, computer mice, keyboards,
USART and a USB interface. The power consumption of the office and industrial automation devices operate in the
chip is low, with consumption under the jobs of 72 MHz clock authenticated frequency domain between 2.4 and 2.4835 GHz.
only 36 mA and standby current down to 2 uA. Using a frequency hop algorithm, the device uses a frequency
of 1600 hops per second, to avoid interference of devices
operating in the same zone. This device operates on a certain
frequency, called a time slot, and it lasts for 625 μs. The
piconet’s1 internal frequency based on the pseudo-random hop
Output port B
frequency is changed by the master unit. The frequency band is
divided into 79 channels in the area of 1 MHz, and the data is
transmitted in units of frames.
Channel B

logic input The HC-05 adopts master-slave bluetooth module, as


Channel A shown in Figure 3. The user does not need to delve into the
5v power supply Bluetooth module transmission protocol, use at instruction set
Power GND to complete the corresponding operation, and through the AT
12v power supply command to switch master-slave mode.

Plate 5V enable HC-05 Bluetooth module


Output port A

Fig. 2. RS385 Motor and Drive module 1298n

(2)Motor module (RS385) and Motor Drive (LN298N)


Fig. 4. Bluetooth module and wiring diagram

1977
The Bluetooth Module HC-05 is a wireless technology III. SYSTEM HARDWARE DESIGN
standard. It provides the medium to exchange information
wirelessly between two systems over approximately 10 meters A. Mobile app design
distances. The exchange of data takes place using short- The mobile phone app uses Java language programming,
wavelength ultra-high frequency (UHF) radio waves in the realizes control interface and key state monitoring. When you
Industrial Scientific and Medical (ISM) band from 2.4 t0 2.485 open the phone app first to monitor whether Bluetooth has
GHz from fixed as well as mobile devices and building been paired successfully, if not correctly paired, mobile app
personal area networks(PANs). will give the message. After the successful connection of the
The HC-05 Bluetooth slave module is used to connect with mobile phone app into the control of the main interface, began
Bluetooth master devices such as a Bluetooth dongle 2 or an to monitor the mobile phone screen triggered events, when
Android smartphone. When power is supplied to the master monitoring to press the button will start the data sending
module, it searches for the HC-05 Bluetooth slave module in program, the data encapsulation and processing in accordance
its neighborhood and the slave module connects directly to the with the standard Bluetooth protocol to send data. Once the
master module. send is complete, it will enter the listening mode again,
waiting for the next key to be triggered, as shown in Figure 7.
(3) MP3 Playback Module
Begin
Music playback module can directly decode the audio
signals in TF into analog signals through the data output port
The system initializes
for output, on the power of automatic playback, loop playback
with memory function, the next time after the last play from the N
track replay playback, with LED display. External power The Bluetooth setting˛
amplifier module on the output of the audio analog signal
amplification processing, but also left a music playback control
N
interface, can be directly through the high and low level pulse Data Monitoring˛
to control the music playback. As shown in Figure 5. Y
Send via serial port

Mp3 pin STM32


Fig. 7. Workng flow of the system

B. Bluetooth module software design


The Bluetooth module adopts the AT command to set the
working mode, baud rate of 9600, data bits of 8 bits, set up
after the success of the Bluetooth module into the data
Fig. 5. Mp3 player module and wiring diagram
monitoring mode, when the main module to monitor the data
sent, the Bluetooth module will be data capture received, Once
(4) The Amplifier module the HC-05 has received the data successfully, the data will be
sent to the main control module by the HC-05 serial port via a
Audio power amplifier module is TDA2030a, as shown in preset data format and baud rate. After the Bluetooth sends out
Figure 6. Channel maximum of 18W amplifier circuit design, the data instruction, it will continue to enter the listening mode,
while the onboard 10K adjustable resistor, can easily adjust the waiting for the next control instruction to send, the process is
volume, the onboard power led, direct access to audio signals, shown in Figure 8.
directly using 5V power supply.
Begin

The system initializes


Power amplifier The loudspeaker
Mp3 module
module TDA2030A module N Error
Bluetooth pairing messages
Y
UI initializes

N
The key monitoring
Y
Fig. 6. Audio amplifier module and wiring diagram Send via serial port

Fig. 8. Bluetooth module software process

1978
C. MP3 module Software Design the serial port received control instructions, if not, will
MP3 module on the initialization after the power, MP3 maintain the original state, if the new control instructions, the
module will continuously monitor the pin on whether there is main control module will be to determine the control
a consistent pulse signal, according to the different control instructions to drive different IO pins to drive the motor driver
pins above the pulse signal control music playback, on a song, module, According to different IO state-driven motor in
the next song and pause. The process is shown in Figure 9. different directions of rotation to achieve the car according to
different ways of the effect of movement. The detailed process
as shown in Figure 10.
Begin

IV. SYSTEM INTEGRATION TEST


The system initializes
When the functions of each sub module have been
implemented, the system is integrated and the code is
Pulse Detection
debugged and the whole test is done. Make the whole system
Y
more reasonable and stable. System integration and processes
Last song are shown in Figure 11.
N
Y
Next song
N
Y Pause
)RUZDUG
Y
%DFN

Play music 7XUQOHIW %UDNLQJ 7XUQULJKW

6SHHGXS
Power amplifier module 6ORZGRZQ

Loudspeaker

3DXVH
Fig. 9. mp3 module software flow chart. /DVWVRQJ 1H[WVRQJ

D. Software design of trolley Motor Module

Begin

The system initializes Fig. 11. Integrated test plan

Monitoring instructions
N V. CONCLUSION
The system based on Bluetooth remote control realizes the
basic function of the system and achieves the expected results
N
Forward through experimental test.
N
Y Back
N
REFERENCES
Y turn left
[1] H.P. Luo, Li G.L., Peng W.F., et al. “Real-time remote monitoring
N system for aquaculture water quality”, Int J Agric & Biol Eng,Vol. 8
Y turn right
No.6,pp.136-141,2015.
N
Y Speed up [2] H.Zhang, W.ch. Tong, H. Yin, et al.“The " internet +" quality resource
N management system based on process,” Proc. SPIE 9903, Seventh
Y Slow down
International Symposium on Precision Mechanical Measurements,
N
Y braking [3] International Journal of Smart Home Vol.8, No.1, pp.303-310㸪2014.
Y [4] Y.D.Zhang, Q.X.Zhang, J.J.G. Zhao , et al. “The Controller
Development of Multi-layer Parking Equipment Based on
Driving motor STM32,”International Journal of Smart Home Vol.8, No.1 (2014),
pp.303-310
Car movement [5] Bao-qiang Xi,Cheng-hua Fu. “Design of Intelligent Toy Car Motion
Control System Based on the AT89C52”,pp.,2010.
[6] B N P Cooray㸪W S K Perera㸪S R D Kalingamudali.“Simultaneous
Fig. 10. Car module software flow chart. control of multiple line-loads each connected separately in series with a
designed unit Control using Radio Frequency and a Mobile
device㸪”pp.318-322,2016.
The system defaults to the stop state after the power
initialization. The main control will always listen to whether

1979
[7] Hae-Duck J. Jeong, Woojin Lee, Jiyoung Lim, et al. ͆ Utilizing a [9] Zhang D.N., Zhang D.L..“Environmental monitoring system in solar
Bluetooth remote lock system for a smartphone ,͇Pervasive and Mobile greenhouse based on STM32 and GPRS 㸪 ”Chemical Engineering
Computing ,24, pp.150–165㸪2015. Transactions, 51, 43-48㸪2016
[8] International Conference on Advances in Electrical, Electronic and [10] Hae-Duck J. Jeong, Jiyoung Lim ,WooSeok Hyun.“A Remote Lock
System Engineering, 14-16 Nov 2016, Putrajaya,Malaysia,pp.170-174㸪 System Using Bluetooth Communication”㸪 2014 Eighth International
2006. Conference on Innovative Mobile and Internet Services in Ubiquitous
Computing㸪pp.441-446,2014.

1980

You might also like