ESP8266 Module Intefering with Sound Sensor Module

Hello, I have an Arduino Uno and ESP8266-01 and I am sure there is something I am not quite understanding in how the ESP8266 works.

I have setup the ESP8266 with the ESP8266 board on the Arduino IDE using the ESP8266 library. Everything has been successful. On a different Arduino I have the sound sensor set up to collect values using digitalRead from its adequate pin and this is working as well. However, when I try to use the two together (the sound sensor and the ESP8266), the digitalRead outputs 0 at all times, and while it is outputting, the LED on the ESP8266 is flashing blue the whole time. Like the digital read is being read from it instead of from the Arduino. Plus, if the ESP8266 is not connected to the Arduino, the program doesn’t even run, not even the code in the setup that doesn’t have anything to do with the ESP. It seems like the sketch is running from the ESP8266 and not from the Arduino. Can someone explain to me what’s going on? Here’s my code for reference:

#include <ESP8266WiFi.h> // Include the Wi-Fi library

const int SOUND_SENSOR_PIN = 8;
// ommitted variables

void setup() {
Serial.begin(115200); // Start the Serial communication to send messages to the computer
pinMode(SOUND_SENSOR_PIN, INPUT);
delay(10);
Serial.println(“Initializing value members”);
for(int i = 0; i < 92; i++) {
values = -1;

  • }*

  • Serial.println(’\n’);*

  • WiFi.begin(ssid, password); // Connect to the network*

  • Serial.print("Connecting to ");*

  • Serial.print(ssid); Serial.println(" …");*

  • int i = 0;*

  • while (WiFi.status() != WL_CONNECTED) { // Wait for the Wi-Fi to connect*

  • delay(1000);*

  • Serial.print(++i); Serial.print(’ ');*

  • }*

  • Serial.println(’\n’);*

  • Serial.println(“Connection established!”); *

  • Serial.print(“IP address:\t”);*

  • Serial.println(WiFi.localIP());*

}
void loop() {

  • Serial.println(digitalRead(SOUND_SENSOR_PIN));*
    }
    I am running the same code twice, once with the ESP8266 board selected, which renders the wifi module to work but not the sound sensor, and once with the Arduino UNO board selected, which runs the sound sensor perfectly but of course without the Wifi functionality. Any help would be appreciated.

The ESP-01 is limited as to what you can do since it only has 8 pins.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.