My setup consists of an Arduino Mega as the master, and the ESP8266 as a slave. The ESP8266 is merely acting as a WiFi adapter in my project. My ESP8266 has AT firmware installed. The interface I am using to control my project is the Blynk app.
I am trying to control a robotic arm with a total of 4 servos installed as joints. The only connections between the mega and esp:
MEGA <----------> ESP8266
RX1(19) <-----> TX
TX1(18) <-----> RX
5V <-----> V+
GND <-----> GND
The arduino is powering the esp itself, which I know is a bad idea if I want a stable connection. It works fine if I have nothing else being powered through the arduino, but I do. I have four servos also being powered through the Arduino. This system works for a while, until the servos start sucking up all the current. Then the esp disconnects from the access point, therefore disconnecting from Blynk. So, I can't use too many motions before the esp disconnects.
After realizing this, I have tried giving the esp its own power supply. I connected a 12V battery with 9800 mAh to the Arduino, with another lead going to a buck converter that steps down that voltage to a safe 5V. The esp I have can take 5V. The 12V battery is able to turn on the ESP, but it's not able to connect to the access point any longer. I also tried a separate battery for it, but that didn't work either.
Now I am wondering if the issue I have is the Arduino and the esp not communicating well when they're not powered on at the same exact moment. Maybe that is why the esp can't connect. I have tried having the Arduino powered first, then powering the esp after the arduino was already on. I then tried powering both the arduino and esp at approximately the same time.
In short, my problem lies when connecting a external power supply to my esp. It no longer attempts to connect to an access point, regardless of having the serial pins connected. It does connect when powered by the Arduino, but needs more current to stay connected.
WuTechRover.ino (4.07 KB)