Confused with Arduino UNO and ESP8266

Hello everyone, I got my ESP32, R4, and ESP8266 boards working great with my projects.
BUT I also have an Arduino UNO and bought the ESP8266 module. I connected it but inside the Arduino IDE, what do I select? Arduino UNO or ESP8266? Also I do not know what to put in the include of a sketch i.e. WiFi.h, esp8266.h etc. A simple sketch that I could upload that will utilize the esp8266 to connect to my wifi would help me a lot. Thank you!

8266

Do some more digging, the UNO if 5V and the eSP is 3V3. Connecting as shown could put the ESP in the fried critters category. Check there are adapters that will make this work on 5V and level translators. Also the Arduino 3V3 is underpowered for the ESP modules therefore an external power source is needed.

1 Like

Ok thank you. I am digging! I see YT video of people using UNO with ESP8266 module. But they did some kind of flashing with PÍO no idea over my head

You need to program the Uno and the esp8266 separately. They are two different processors. The interface between the 2 is the serial port. What you program into each one is dependent on what you are doing.

I program a web server on the esp8266 which gets requests from the browser and sends them to the UNO.

2 Likes

Foremost you should add a voltage divider on the ESP-RX pin to reduce the logic level from the 5v UNO to the 3.3v ESP.

You could also use the default firmware AT-commands of the ESP, but writing your own sketch will be much more efficient.

I had a link to a decent tutorial, but since then the same tutorial has been modified, and i do not support it anymore. (so now i'll end up typing out again, mind you there are still decent tuts out there probably
Basically if you have an Uno just like me and you want to upload a code to an ESP-01.
Upload an Empty sketch onto the Uno (or blink or something, nothing that uses the UART)
This will leave the USB to TTL converter to be used by us. If it a genuine UNO the USB to TTL should be a 16U2, but it may be a clone i guess. In that case the 3.3v regulator may or may not provide enough power to connect to WiFi but that is a different matter.
Connect as follows

UNO              ESP              
3.3v               Vcc               
3.3v               CH_PD      
3.3v                RST               
GND               GND
TX                   TX              (we are using the converter, not communicating with the 328P)
RX  -> 1K  ->   RX ->1K  -> 1K -> GND             (this is the voltage divider, it belongs to the 3.3v device)

Now if you connect GPIO 0 to GND and reboot the ESP, it will go into upload-boot mode,
Now you can upload using the UNO as a USB to TTL converter.
The messages that the ESP sketch is producing should be visible in the serial monitor.

If you want to communicate between the UNO & ESP you should swap the UNO's RX & TX lines.

I have moved your topic to Project Guidance ....Wasn't clear what Arduino IDE version you using and it's a better category overall for the question.

1 Like

ok thank you

Thank you Deva, I will try your suggestion. Thank you for taking the time to document this.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.