Voice Sender and Receiver Board: SIM800 and Bluetooth, Call Control from MATLAB
A small board with a SIM800L and a Bluetooth module that dials and plays an audio file during a call from MATLAB, and answers and records incoming calls automatically; part of a larger project.
Overview
This board uses a SIM800 module and a Bluetooth module to control a phone call from a computer. The programs I wrote in MATLAB can use the board to play an audio file, dial a number, play the audio file during the call, and then end the call. The board can also wait for an incoming call, answer it automatically, record the received audio and save it to a file.
This board is part of a larger project for a specific use case, and only the board and its tools are described here. I made both the hardware (schematic and PCB) and the software myself.
What the board does
Caller (voice sender): dials the number, waits for the other side to answer, plays the audio file and ends the call.
Receiver: waits for an incoming call, answers it automatically, records the audio until the call ends and saves it with a name that contains the date and time.
Control from the computer: the commands (AT commands) go over the USB serial port, and the audio goes through the Bluetooth module.
The diagram below shows the parts of the board and the control and audio paths.
Hardware
SIM800L: the GSM module that makes the call and sends and receives the audio over the network.
JDY-67: a Bluetooth audio module. The audio of the computer comes into the board over Bluetooth, and the received audio goes back to the computer the same way.
USB to serial: a CH340N chip with a micro-USB connector, to send commands from the computer to the module.
Power: a DC jack input and an LM2596 step-down converter with an inductor and a diode, which gives the SIM800L a clean voltage and enough current. The SIM800L draws a lot of current while transmitting and needs a stable supply.
Switch and LEDs: a slide switch and several indicator LEDs.
PCB
I designed the board in Altium Designer and made two versions; the second one is a corrected version of the first and is the one you see in the pictures. The SIM800L and JDY-67 modules are mounted on the board, and the power converter and the connectors are around them. A large copper area for the power path and the GSM module is visible in the layout picture. Two boards were built and assembled.
Software (MATLAB)
I wrote all the MATLAB programs myself. They come in two groups: the call-control tools and the audio-quality measurement tools.
Call control:
callAndPlayVoice: opens the serial port, dials the number with an AT command, keeps checking the call status until the other side answers, then plays the audio file and ends the call when it finishes.
autoAnswerAndRecord: keeps reading the messages of the module. On "RING" it answers the call and starts recording, and on "NO CARRIER" it stops the recording and saves a WAV file with a name that contains the date and time. The recording comes from the Bluetooth sound device.
playAudioGUI: a small player with a waveform, a progress line, a time display and a stop button.
send_command: sends a command to the module, reads the answer and removes empty lines.
Helper tools: a list of sound devices and serial ports to find the right device, and a recorder at 8 kHz, 16 bit, mono.
Quality measurement: a set of programs that send a test signal through the call path and compare the received signal with the sent one. The received signal is aligned with the sent one using cross-correlation (because the delay of the path is different every time), and then MSE and SNR are calculated and plotted. Files are also converted to 8 kHz, mono and 16 bit for the module.
Simulation framework: I also wrote a MATLAB framework that simulates the voice path of a GSM call, together with several signal-processing scripts for trying out ideas. With it, an idea can be tried first in simulation and then run on the board.
Before MATLAB, I also tested the modules with a few Python scripts (calls and SMS with the SIM800, and commands to the Bluetooth module).
Specifications
GSM module: SIM800L, Bluetooth audio module: JDY-67
USB to serial: CH340N with micro-USB
Power: DC jack with an LM2596 step-down converter
Control: MATLAB, with AT commands over the serial port, with SNR and MSE measurement tools
Hardware design: Altium Designer, two PCB versions
Result
A small board that dials and plays an audio file from a computer, and answers and records incoming calls automatically; a tool made for a larger project.
Gallery
BLOG
Related posts
Questions about this project?
If you have questions about this project, or a similar one in mind, I would be glad to hear from you.