Introduction: Spy Microphone Connected

About: Ngo active in the field of digital mediation, based in Toulouse, France

In this tutorial we will talk about how to make a connected spy microphone and to show the capabilities of the Esp32 while showing some sides effects of the connected objects.

It work by recording the audio when the target press a button. The file recorded is then sent to a Ftp server over the Wifi of the Esp32. You should have a server ready, setting up a ftp will not be goal of this tutorial. You can still do it without but you'll need to take the SD card out of the device to read it in your computer.

Supplies

Prototype:

Server:

  • Ftp server to receive the files

You need to have it configured already, you can rent one on OVH or any others servers providers.

Download the .ino file for Arduino here :

https://drive.google.com/file/d/1ZcAQK1bhi0muKuX-Bhj8LFjqadVW7-Dh/view?usp=sharing

Step 1: Code

When your prototype is ready you can open the previously downloaded file in Arduino IDE. Make sure you select the DOIT ESP32 DEVKIT and then upload (Follow this tutorial if you never upload to an ESP card).

You'll need to download and install the following libraries :

SD, FS, Wifi, WifiUdp, Time, AsyncTCP, ESPAsyncWebServer, ESP32_FTPClient

You'll find most of them through Arduino IDE library. Go to Sketch-> Include library -> Manage libraries then search the name of the library and click install. For the other simply google the name to download a ready .zip to install in Sketch -> Include library -> Add .zip Library

Find the lines 22 to 24 and change it with your own Ftp access, create a folder name "upload".

You also need to change the variables ssid and password to the one of your own wifi.

Upload the code to the board. If you don't have any problems with Wifi credentials, microphone and your SD card, the program should launch.

To try it, click the button and the led should turn red. Click again to finish the recording. The recording is sent then to your Ftp Server and saved in the SD card.

You can use your computer now to hear the recordings.

The code is commented to help out the understanding. But basically the button start a recording of a .wav file to the SD card, then we use the FTP library to send the file to our server.