WiFi Microphone With ESP8266/ESP12 Arduino, Source code+schematic

Other projects from this group

WiFi Microphone With ESP8266/ESP12 Arduino, Source code+schematic

With this source code, an ESP8266 and a standard microphone module, build a 110kbps WiFi Spy microphone with audio recorder and live stream player..

ESP8266 WiFi Microphone Pre-Compiled Binary File (ESP12, NodeMcu...) - Rev 1.3



Other projects from this group


The “Ai Thinker ESP12” module (ESP8266MOD) and NodeMCU has an ACD pin (works in range of 0V to 3.3V) with 10 bits resolution (0-1023). The pin is between RST and EN. In the “WiFi Microphone” project, we have used this channel as the audio signal input.

Compatiple with ESP8266 modules which have ADC pin, like ESP-12-E and ESP8266 NodeMCU.

This project has a WebApp which is able to play the audio stream in up to 110Kbps. The module reads audio signal from ADC pin, then decode it to audio data and transmits it to the web browser. Web browser receives the data and stars recording it to a WAV file. Also the user can play the recorded audio live-ly.

This project contains two folders ESP8266WiFiMicrophone (the WiFi Microphone source code) and PHP Script (For non-static IP and saving the last used IP in a server use option).

The source code contains 4 files:

  1. ESP8266WiFiMicrophone.ino – the main program
  2. AC.ino (autoconnect handler)
  3. AC.h (configuration headerfile)
  4. MicPage.ino (Microphone’s page and decoder)

esp8266 wifi microphone

The circuit with "NodeMCU" and "Waveshare Sound Sensor":

nodemcu wifi microphone

First open one of the files with Arduino program, then set the settings as the following image (Board, CPU Frequency and Flash Frequency):

wifi microphone arduino

  • The compiler of software (board) must be set on the “Generic ESP8266 Module” (or similar) before doing anything.

Then put the ESP8266 module on the “download mode” and upload the program.

After upload, run the program in “normal mode”.

Then in case you are using ESP12, the blue LED on the board would be turned on for 1 second then turns off. Then you’ll be able to see the module’s hot spot ssid via the WiFi networks in your PC or smart phone.

The default SSID is WiCardAC and the default password is 12345678. Connect and go to with a web browser.

The WiFi autoconnect configuration page:

wifi microphone configuration

In the “Modem Configuration” section, you’re able to view/edit the SSID and password of WiFi modem/router and then click on “Save” after inserting. The module would connect to the modem after about 30 seconds in case of validity of ssid and password.

  • This page is also available via the DHCP IP of the module.

In the “Device Hot Spot Configuration” section, you can set the module hotspot’s SSID and password. Also you can set a password for the internal page with Secure Link section. (Example: the secure link is ABCD and the root page would be at address)

The “Hidden HotSpot” button will set the module’s hot spot as hidden hotspot and the “Disable HotSpot when is connected to the modem” would disable the module’s hotspot, when is connected to the modem.

under this section there's the audio file configuration:

audio wav file

The Audio Stream Page

This page is in the root address ( or the router’s given IP) and decodes the received data from module to the audio stream. This page records audio data to a .wav file automatically. Also you can play the audio and listen to the audio lively at the same time.

The preset time can be vary between 5, 10, 30 and 60 minutes. After this time spent, you can refresh the page and record again.

Also you can download the file directly with the file link (http://IP/s).

  • If you close the web page, recording will be aborted.

Microphone Calibration

There is a calibration page in “” which shows the audio signal. When there’s no noise and voice, the signal must be a straight horizontal line at the center of scope.

Also you can see the input audio signal shape in this page:

arduino esp8266 wifi microphone

The audio signal uses 8000Hz sample rate with 10 bits resolution which gives a fair quality souond.

  • The WiFi signal strength takes effect on the module capability and the audio streams.
  • The average voltage (silent voltage) is 1.65V (half of the 3.3V power source).

The Circuit

Better to use a standard 3.3V microphone module. like "WaveShare Sound Sensor":

waveshare sound sensor wifi

Here’s a suggested minimum circuit with a simple capacitive microphone, LM386, ESP8266 connections and voltage regulation to testing the program:

wifi microphone circuit

In the above schematic, LED1 shows the power is on, SW1 is the ESP8266 module reset button, H1 is the module’s UART connector (for flashing/programming) and H2 pin header needs a jumper to put the ESP12 module in the flash programming mode.

The microphone block has a potentiometer (P1) to calibrating the input audio signal.

  • Better to use a 5-12V power source with 2A output drain capability.
  • The module must only receive 3.3v (from the LF33 regulator). Higher voltage will hurt the module.

- Bitrate increased up to 110Kbps
- SecureLink bug fixed

- Schematic improvement
- The Web UI has been changed
- increasing the quality of the recorded sound
- Increasing the bitrate up to 100kbps
- reducing the noises
- Bugs fixed


- Schematic improvement

- Secure link debug

- ADC input improvement

- Output file improvement

- Selectable stream quality

- Adjustable stream time

- Adjustable software amplitude


-10:28 frame (increased)

-Audio stream recorder and player

-8KHz sample rate (increased)

-10 bits resolution (increased)

-Calibration page

-The stability and quality of audio stream increased

-Suggested test circuit updated

-Bugs fixed


-3300 miliseconds frames

-LOUD button

-7.5KHz sample rate

-8 bits resolution

-Internal pages secure link

-Show MAC and IP in config page

-Set module hotspot and modem’s ssid and password

-Automatically connection to the modem

-Config page

-Hidden hotspot button

-Disable hotspot button

i can not calibrate my microphone on esp8266

Similar Projects: