Hello,
to connect my Arduino Leonardo to a W-LAN, I bought a ESP8266 (ESP-01 or also referred to as V090) Module.
I hooked the ESP8266 to an external power source as it requires up to 200mA, and as far as I know, the Arduino only offers 50mA on it's 3.3V out. The external Power source offers 5.2V and 2250mA. I used a voltage devider to get 3.3V (3.23V to be precise).
I hooked the external power source to the VCC and CH_PD pins of the ESP8266 as described in many tutorials.
I also connected the UTXD (TX) pin of the ESP8266 to the RX1 of my Arduino.
To get a 3.3V signal on the URXD (RX) pin of the ESP8266, I put another voltage devider (1k/2k) between the TX1 of the Arduino and the URXD (RX) pin of the ESP8266.
I tried to send/recieve commands to the ESP8266 module using the following sketch:
void setup() {
Serial.begin(9600);
while (!Serial); // wait for serial port to connect. Needed for Leonardo only
Serial.println("Serial ready");
Serial1.begin(9600);
Serial.println("Serial 1 ready");
}
void loop() {
if (Serial.available()) {
String str = Serial.readStringUntil('\n');
Serial.println("");
Serial.println("You sent: " + str);
Serial1.println(str);
}
if (Serial1.available()) {
char chr = Serial1.read();
if(chr != 0) Serial.print(chr);
}
}
When I connect everything, the blue LED of the ESP8266 starts flashing rapidly, but all I get on the serial monitor is jibberish. I also tried different baud rates for the Serial1 connection.
So can anyone help me and explain what I might have done wrong? And please excuse me if I did something stupid, but I'm new to Arduino programming.
Thank you in advance!