Hi, I'm trying to connect an Arduino Nano to an ESP-01S WiFi module. I've been trying to follow tutorials online, but none of them have worked, and almost all of them give conflicting instruction on how the module is supposed to be connected. Here is what I have currently, but I have tried many different configurations and nothing seems to work.
What I expect to happen is: I plug the Nano into my laptop, open the serial monitor in the Arduino IDE, and am able to type AT commands into the prompt and get feedback.
What actually happens is: I plug the Nano into my laptop and it doesn't show up as a device. "Board at /dev/ttyUSB0 is not available".
My OS is Ubuntu 18, but the same thing happens on Windows.
Can anybody either see a problem with my wiring or give me advice on how to troubleshoot?
There are a number of problems with that arrangement.
One is that you are connecting TX to TX and RX to RX instead of crossing them over.
Another is that the RX on the Nano is already connected to the USB interface chip (whatever that may be in a clone).
And the 3.3V source on the Nano is probably not adequate for the WiFi operation when you do manage to communicate with the ESP-01, though a 1 mF (1000 µF) capacitor would probably sort that out.
But we do focus on the "creative head-banging" aspect of such a project. The ESP is a substantially more capable microcontroller than that on the Nano, why not just use the ESP?
Edit: Aliexpress links updated as at December 2024.
To program the ESP-01, you use a purpose-built USB programming adapter which works "out of the box" with the Arduino IDE:
Aliexpress item
At least, that is the manual**switching version; I actually recommend in preference the automatic version which while it does include the reset button, actually initiates the programming directly from the Arduino IDE: Aliexpress item
Similarly, to actually use the ESP-01 in a project, a very convenient way is with the cheaper adapter board, plugged into a USB "phone charger" so you have both the 5 V and 3.3 V conveniently and adequately supplied.
Aliexpress item
You have three GPIO conveniently available by soldering to the adapter, and the fourth - serial Rx - can be separated from the USB chip if necessary by cutting a track. Using those I/O you can connect port expanders for many more I/O connections and a variety of sensors.
Because I want my Arduino to be able to connect to my local network wirelessly.
SteveMann:
What is the nano doing?
I plan to add sensors to the Nano so it will mostly be monitoring those sensors.
SteveMann:
Why don't you just use a board that has WiFi on it to begin with?
I'm not aware of a small form factor board with WiFi that is reasonably priced. The closest thing I could find on Amazon is this board which is larger and more than 5 times the price of a Nano+ESP-01S. Can you please suggest a board that I should use instead?
Paul__B:
There are a number of problems with that arrangement.
One is that you are connecting TX to TX and RX to RX instead of crossing them over.
Another is that the RX on the Nano is already connected to the USB interface chip (whatever that may be in a clone).
And the 3.3V source on the Nano is probably not adequate for the WiFi operation when you do manage to communicate with the ESP-01, though a 1 mF (1000 µF) capacitor would probably sort that out.
Can you recommend a circuit diagram that does work? As I said, this is what I found online, but I would like to find the "correct" way to connect an ESP to a Nano.
Paul__B:
But we do focus on the "creative head-banging" aspect of such a project. The ESP is a substantially more capable microcontroller than that on the Nano, why not just use the ESP?
You program it with a purpose-built USB programming adapter:
Similarly, to actually use the ESP-01 in a project, a very convenient way is with the cheaper adapter board, plugged into a USB "phone charger" so you have both the 5 V and 3.3 V conveniently and adequately supplied.
You have three GPIO conveniently available by soldering to the adapter, and the fourth - serial Rx - can be separated from the USB chip if necessary by cutting a track. Using those I/O you can connect port expanders for many more I/O connections and a variety of sensors.
I would prefer to use the Nano, and almost all of the resources online show it being programmed with an Arduino, not a purpose built board, but I'll buy that programming adapter because you recommend it. One problem is that I don't really know what to do with it when it arrives. Does it work with the Arduino IDE? If so, how do I configure it to connect to my WiFi?
sycorax_:
Because I want my Arduino to be able to connect to my local network wirelessly.
I plan to add sensors to the Nano so it will mostly be monitoring those sensors.
I'm not aware of a small form factor board with WiFi that is reasonably priced. The closest thing I could find on Amazon is this board which is larger and more than 5 times the price of a Nano+ESP-01S. Can you please suggest a board that I should use instead?
I have some 50 or so sensors, switches and lights on my home IOT. Most of the nodes are running on ESP hardware flashed with Tasmota. Communication is by MQTT over WiFi.
Some of my nodes are running on the Wemos D1 Mini ($3 at Amazon) or the ESP8266-01 ($1). I've never seen a Nano but the ESP8266-01 is probably similar in size.
If you don't mind the wait for U.S. Customs, you can get them a bit cheaper from Banggood (China).
Also, the Wemos D1 Mini has more RAM and a faster processor than the Uno. The ESP boards are programmed using the Arduino IDE. Except for pin definitions, they are mostly indistinguishable from genuine Arduino boards.
The programming adapter works perfectly with the Arduino IDE. You program the ESP to do whatever you wish including operating as a Web server or simply interacting with a Web server. There are plenty of examples in the ESP libraries (which you install using the Library Manager) in the IDE.
The ESP-01 will connect to a Port Expander board to implement numerous I/O ports and to many sensors and adapters using I2C - it needs only two I/O pins to do so. So a Nano is completely unnecessary and only complicates the programming,
While there are ESP versions with more I/O pins brought out, the most generally useful of which is the inexpensive WeMOS D1 Mini, you can do quite a lot with the ESP-01. I can't say anything about the Arduino UNO WiFi REV2 except that it is indeed, ridiculously expensive for its functionality, uses a different WiFi module and the inconvenient UNO form factor.