This tutorial refers to a product that has reached its end-of-life status.

Arduino MKR GSM 1400 and I2S

This tutorial aims to show you how to use the I2S bus to send audio over phone calls between the micro controller and the GSM module.

Components and Supplies

Apps and Online Services

About This Project

Introduction

The SAMD 21 (the microcontroller on your Arduino board) can communicate with the SARA U201 (the GSM module on your Arduino board) using the I2S bus. This means that you can send audio data from the micro controller to the module! In such a way you can reproduce for example a wav file over a phone call as we will show in this tutorial.

You have to consider that the I2S bus is the same that is present on the headers so if you use it to communicate with the module you can't use the same pins in your project. In particular you can't use:

  • A6: I2S serial data;
  • 2: I2S serial clock;
  • 3: I2S frame select;

How It Works

The operating principle of this tutorial is very simple: every time a phone call is received, the boards answers the call, plays the chosen .wav file and when it is finished it hangs the call.

Setup

The setup to use this code is very simple. You just have to:

  • format your SD card in FAT16 or FAT32 format;
  • load the .wav file on the SD card;
  • plug your MKR SD Proto Shield on top of your board;
  • plug the antenna into the board;
  • plug a micro SIM card into your board;
  • plug the battery into the board;
  • plug the micro USB cable and connect it to your PC;
  • load the code on the board using the Arduino Java or Web IDE;
  • open the Serial Monitor;
  • call the board and enjoy!

Code

See Also

This example is based on the Arduino Sound library and the Arduino GSM library.

Suggest changes

The content on docs.arduino.cc is facilitated through a public GitHub repository. If you see anything wrong, you can edit this page here.

License

The Arduino documentation is licensed under the Creative Commons Attribution-Share Alike 4.0 license.