It's the first time I use an ESP8266 and I didn't manage to get a proper response in the Arduino serial monitor. I only see weird characters, when I move the 3.3V wire.
You can see the connections in the following picture:
The code I run is the following one:
#include <SoftwareSerial.h>
SoftwareSerial BT1(3, 2); // RX | TX
void setup()
{
Serial.begin(115200);
BT1.begin(115200);
}
void loop()
{
String B= ".";
if (BT1.available())
{
char c = BT1.read();
Serial.print(c);
}
if (Serial.available())
{
char c = Serial.read();
BT1.print(c);
}
}
Maybe it's something really stupid. I am a total beginner, so I appreciate any help.
EDIT: I think power supply is 3.3Venter image description here
SOLUTION: the problem was the power supply. I tried exactly the same using the 3.3V from the arduino instead of the power supply and it works perfectly!
-
1where is the logic level shifter?Juraj– Juraj ♦09/13/2017 09:52:26Commented Sep 13, 2017 at 9:52
-
@Juraj ESP8266 GPIO pins are 5V tolerant.gre_gor– gre_gor09/13/2017 13:49:55Commented Sep 13, 2017 at 13:49
-
You might want to put the breadboard power supply on the other end, so the + an - markings actually match and doesn't look like you just shorted everything.gre_gor– gre_gor09/13/2017 13:51:23Commented Sep 13, 2017 at 13:51
-
Also that breadboard might have a split in the middle of the side rails.gre_gor– gre_gor09/13/2017 13:56:20Commented Sep 13, 2017 at 13:56
-
Do a sanity check, connect pin 2 - 3 and see if the Arduino terminal echo back a char that you send.MatsK– MatsK09/13/2017 17:43:33Commented Sep 13, 2017 at 17:43
2 Answers 2
You may well have killed the ESP by supplying it 5v, you have to have a logic level shifter, as Juraj says.
Assuming it's not dead then your next problem is there have been posts about that hardware setup and SoftwareSerial doesn't work at high speed. I can't tell you what it is that doesn't work because turning the speed of the link cures the problem, try 9600 maximum.
[Edited to be less accusational, which was not the original intent]
[Update]
Please see the datasheet here: https://www.mikrocontroller.net/attachment/231858/0A-ESP8266_Specifications_v4.pdf
The table in section 8.4.4 says that the maximum input voltage is 3.6V Just after that it says all digital pins are "protected from over-voltage with a snap-back circuit". This snap back voltage is typically 6V. So does that mean the GPIO are safe up to 6V?
(It might be that this datasheet has been superseded, I am unable to access the EspressIF site at the moment).
-
1To me, it looks like the jumpers on his power supply are set to 3.3V.gre_gor– gre_gor09/13/2017 13:54:08Commented Sep 13, 2017 at 13:54
-
1@MatsK - Sorry I worded that badly. I have seen plenty of comments on here about comms between an Arduino and ESP failing at high board rates when using Software Serial. I didn't mean to point a finger :)Code Gorilla– Code Gorilla09/14/2017 10:05:48Commented Sep 14, 2017 at 10:05
-
1No problem @CodeGorilla, I think the politically correct is to say"To use higher baud rates with Softserial isn't recommended!".MatsK– MatsK09/14/2017 10:52:50Commented Sep 14, 2017 at 10:52
-
1Regarding 5volt tolerant or not, this is a quite comprehensive article about it, hackaday.com/2016/07/28/ask-hackaday-is-the-esp8266-5v-tolerantMatsK– MatsK09/14/2017 10:54:59Commented Sep 14, 2017 at 10:54
-
4@MatsK - That's long :( So in summary the official data sheet says that the GPIO pins work at 3.3v Max, an unofficial early datasheet reportedly says 5v, some people say 3v, some 3.6v, some 5v and one thinks it could be 6v. There is a Facebook post reportedly from the CEO that says 5V (but I can't see this). Personally I will stick to using level convertors, because an ESP may only be 2ドル but a lvlconv is only 0ドル.2. BUT don't use 5V for the power, that will smoke the flash chip. :)Code Gorilla– Code Gorilla09/14/2017 12:37:11Commented Sep 14, 2017 at 12:37
Step 1: Turn On Your ESP8266 Module by Using Arduino Nano 3.3V Dc Output Pin. Remeber sometimes Arduino board is not delivering sufficient voltage to the ESP8266 module. You can use a 3.3 V ( Do not exceed input voltage from 3.3v) regulator ( AMS1117 ) to power this module. A voltage divider circuit is used to drop the Arduino 5V to ESP8266 3.3 V.
Step 2: Here is the schematic Diagram, in my code I used Digital pin 2 as a Tx and D3 as an RX. enter image description here
-
I think you mean the 3.3V may not supply enough CURRENT (voltage is fine) for the ESP8266, especially if you try to use the WIFI on it.Code Gorilla– Code Gorilla02/10/2018 12:28:27Commented Feb 10, 2018 at 12:28