Howdy! Need help. I bought an ESP 07 module and I want to connect it to an arduino uno to serve as a WIFI module to send sensor information to telegram. The problem is that I can't program this esp. I even connected the power supply from the lab power supply and according to what it shows me and what they write on the Internet, the consumption is small (as in the picture). From the arduino for programming I unplugged the atmega and connected:
VCC - power supply
EN - 3.3V (power supply)
GND - power supply and arduino
GPIO0- GND
ESP reset - Arduino reset
RX - RX
TX - TX
When trying to upload, the blue LED flashes as if it wants to but won't go. I have the settings like this (picture)
Can someone explain what I am doing wrong or what is the reason ? Maybe this module is defective ?
It should be RX - TX and TX - RX with UART interface.
But you cannot use RX and TX pins on Uno. They are reserved for uploading code and using serial monitor. You must use 2 other pins and the Software Serial library to make another UART interface.
Also, the TX pin, or any output pin, of the Uno is 5V which could damage the RX pin of the ESP, which is a 3.3V input. Use a voltage divider (eg. 10K & 4K7) to reduce the 5V signal.
Note that here they are referring to using the Arduino board as a USB to serial adapter to upload sketches to the ESP-07 module:
Unintuitively, when using an Arduino board as a USB to serial adapter, you should make the connections RX-RX, TX-TX.
The reason is that the purpose of this circuit is to connect the USB to serial bridge chip on the Arduino board (e.g., ATmega16U2) being used as the adapter to the target ESP8266. The labels on the pins on the Arduino board are in relation to the pins on its primary microcontroller chip, not the USB to serial bridge chip. The bridge chip has an RX-TX, TX-RX connection to the primary microcontroller, so the pin labeled "RX" on the Arduino board is actually connected to the TX pin on the bridge chip, and the pin labeled "TX" on the Arduino board is connected to the RX pin on the bridge chip.
So in order to make a RX-TX, TX-RX connection between the bridge chip and the ESP8266, you must make RX-RX, TX-TX connections according to the pin labels on the silkscreens.
This is reasonable advice when it comes to the first use case described by @majkimike32:
However, for the second use case they described (using an Arduino board as a USB to serial adapter for uploading sketches to the ESP8266), the RX and TX pins should be used. Although I would strongly recommend using a dedicated USB to serial adapter module for this purpose if possible, it is definitely possible to use an Arduino board. As you mentioned, there is the potential problem of the primary microcontroller on the programmer board interfering with the communication between its USB to serial bridge chip and the ESP8266 target. However, it sounds like @majkimike32 has already prevented that by removing the primary microcontroller from the programmer board (I guess it is one of the UNO R3 boards with the socketed ATmega328P).
Ah, yes, quite correct. By bad. Apologies @majkimike32
Yes, so that the code gets uploaded to the ESP and not the ATmega (which would result in an error anyway.
@majkimike32 perhaps you begin to see why this whole approach is not recommended for beginners
The ESP's features, speed and capacity completely outclass the ATmega328 in almost every respect except one: the number of available pins. In my opinion, using Uno to provide more pins is much more trouble than it is worth because of the need to write and debug 2 shetches for 2 different CPU and get them to communicate with each other. It's harder than you think. I would recommend adding additional pins to the ESP using i2c I/O expanders, ADC chips etc., over attempting to use the Uno's pins under command of the ESP. Then, the Uno is not required in the final circuit.
I would also recommend purchasing an ESP-based development board like Wemos D1 mini, which will make your life much easier!
First of all make sure that the UNO has no program on it that interferes with Serial. I always just use some kind of 'Blink' variant so i can see that that is what is actually running on it.
Second, and this is important as well, protect the ESP from the UNO 5v logic level by using a voltage divider
UNO -RX -> 1K -> ESP-RX -> 1K -> 1K -> GND which should get it to a safe 3.3v.
Third. Do not connect both reset pins together ! Rather connect RST on the ESP to 3.3v (Vcc) Optionally through a 10K resistor so you can add a button to pull it LOW to reset the ESP.
The ESP should just get a reset when GPIO 0 is connected to GND and after that, just leave it, It is ready for upload.
And finally, connect GPIO 15 via a 10K resistor to GND ! ESP8266 always need GPIO 15 to GND, but on all dev-boards this connection is made for you, but on am ESP-07 (or 12F) you have to make that connection.
Oh yes and make sure GPIO 2 isn't connected to GND in some way.
Consumption may peak near 300mA during WiFi connection, My UNO handles that just fine from the 3.3v pin, but mine is an original.
Keep in mind that only an ESP-07S has 4MB flash, and an ESP-07 has only 1MB flash. If you are not sure what you have, start with trying to program it with 1MB and once that works try the 4MB setting, and attempt OTA updates to confirm.
My bet is that the GPIO 15 -> 10K -> GND will fix it, but do also change the other suggestions i made, particularly the voltage divider on the ESP-07 RX line, since ESP8266's are not 5v tolerant.