I have a problem with my Arduino Nano ATmega328 and my ESP8266 01 module. I have connected the ESP8266 on my Arduino board without FTDI.
I have made the following connection:
I an using a 5V Arduino Nano which of course is 5V. The ESP8266 is a 3.3V device and so I am using a voltage divider to bring the Arduino's 5V down to 3.3V. If you are using a 3.3V Arduino then you do not need the voltage divider.
- The wiring is very similar to the FTDI.
- Arduino pin 3 to voltage divider and then to ESP8266 RX
- Arduino pin 2 to ESP8266 TX
- Arduino GND to ESP8266 GND
- Pull CH_PD HIGH with a 10K resistor to +3.3V
- +3.3V to Vcc
You only need the voltage divider on the Arduino TX pin. The 5V Arduino will read 3.3V as HIGH so you can connect the ESP8266 TX pin directly to the Arduino RX pin.
The problem I had and I can't handle is that when I start up the Arduino Tx and Rx LEDs work continuously so I can't have access to my serial monitor of the Arduino IDE. So with that problem I can't send or receive any command to/from the IDE. Also when I try to upload my program to the Arduino board, I have to disconnect the ESP. If I don't I can't upload it.
Any ideas guys? I would be grateful
I also try to implement code with AltSoftSerial
but I have library issues - my laptop does not recognize it (I downloaded it and I put it in the same folder with my code).
#include <SoftwareSerial.h>
SoftwareSerial ESPserial(2, 3); // RX | TX
void setup()
{ Serial.begin(9600); // communication with the host computer
// Start the software serial for communication with the ESP8266
ESPserial.begin(9600);
Serial.println("");
Serial.println("Remember to to set Both NL & CR in the serial monitor.");
Serial.println("Ready");
Serial.println("");}
void loop()
{
// listen for communication from the ESP8266 and then write it to the serial monitor
if ( ESPserial.available() ) { Serial.write( ESPserial.read();} / / listen for user input and send it to the ESP8266
if ( Serial.available() ) { ESPserial.write( Serial.read() ); }}
1 Answer 1
Arduino Nano has its tx-rx serial port shared with the FTDI chip used by downloading and serial console. See https://www.arduino.cc/en/uploads/Main/ArduinoNano30Schematic.pdf This means that if you drive these pins from ESP, it will flash leds, and all communication on these pins will interfere with serial monitor and board programming as well.
You may:
- disconnect ESP during program downloading
- pick a different board, which has a separate hardware serial port, such as Arduino Micro, Leonardo, or any Pololu A-star 32u4 boards, this way you have a dedicated serial port to control your ESP
- wire the tx-rx of ESP to two other pins of your Arduino micro, and use a software serial library to bit-bang serial communication. (Note that serial receiving in software mode may require clever programming - since while your code does something else it can not receive anything).
-
Basically I ve connected my esp8266 to an ftdi 3.3V logic and it helped my resolve my problems i had. I also use a command to change my esp baudrate to 9600 from 115200. Then i connect my esp back to arduino nano and everything works fine :) ( I think ftdi is the most easy way to get started with an esp module. )Μάριος Μιχαήλ– Μάριος Μιχαήλ2016年05月19日 08:50:40 +00:00Commented May 19, 2016 at 8:50
Explore related questions
See similar questions with these tags.
SoftwareSerial
a built-in library?