Help connecting a ESP8266-01 to a Arduino Mega 2560 and multiple sensors

After overcoming issues connecting the ESP8266-01 with the Arduino Mega 2560 there are now problems with connecting other sensors to my set up. This is the guide I followed for programming the ESP8266 to the Mega 2560 build: Most easiest & simple way to program ESP8266 01 Module via Arduino Firmware | ESP8266 projects - YouTube
In order to make as much room for all data connections I am going to create nodes on my breadboard for: +5V, GND, TX, RX, SCL, SDA.

--> I am connecting at the moment a CQRobot liquid level sensor: Amazon.com
The demo code found on their product's wikipedia page uses an UNO R3 instead of a Mega 2560 build. The data pin for the liquid level sensor is attached to pin 7 of the Mega 2560 build. The pictures underneath show the current set up:



---> After the ESP8266-01 made connection with the Arduino Mega 2560. I opened another Arduino IDE window where I have my liquid level sensor demo code. I now have 2 IDE windows: one for the ESP8266 and another for the liquid level sensor. The ESP8266 IDE window requieres the board to select the Generic ESP8266 module. The liquid level sensor requires the board to select the Arduino Mega 2560. If one board selection changes it changes for all IDE windows. If I upload the liquid level sensor demo code to the Arduino Mega 2560 it times out even though I have the serial monitor closed for the ESP8266. This is my current issue regarding this project. I would appreciate all help I can get. Thank you!


what connects the yellow wire?
do you power the esp-01 with 5V?

What you need to do is not 2 windows IDE, but 2 instances of the IDE, if you want to connect 2 boards and not want to switch settings, but since you are actually connecting to the ESP through the Mega, this is not going to work.

you may need to disconnect the ESP from TX & RX (for UART 0) And depending if you have RST on the Mega connected to GND, you will have remove that.
With regards to what Juraj is saying already, let's be clear, sometimes a picture says a thousand words, but your pictures don't. Please provide a schematic of how you have connected everything.

I don't look youtube instructions. but you describe what you have done one by one.

I doubt you will need to Mega for just connecting the sensor, and you can just use one of the ESP-01's GPIO pins if it is sending a digital signal. Please share the example code for the Mega so we can have a look at what is required. (since you are connecting it to Pin 7 of the Mega i am confident that it is a digital signal)

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