Using arduino UNO or nano and esp-01

Hi,
i bought an Arduino UNO R3 board, few Arduino nano V3.0 (compatible) and few ESP-01 Wi-Fi board and started playing with my son for his school assignments.

I viewed dozens of you tube videos and articles about how to connect and use the Arduino board with the ESP-01, many of which with contradictory info.

I thought that the reason to use an Arduino board with the ESP-01 was because of the many digital and analog pins offered by the Arduino boards, but lacking the Wi-Fi option they could use the ESP-01 board only to send or receive data over Internet.
Instead many posts on Internet forums suggest to discard the Arduino board and use only the ESP-01 as an independent unit, even if it has only two digital GPIO's.

I would like to use Arduino UNO or Nano to read some analog sensors and sending the values to a Firebase database.
I already have an account on Firebase and have used it for other apps.

In a scenario like this, what board should be chosen in the Arduino IDE? Where is the sketch loaded? On the Arduino board or on the ESP-01?

I have seen two different Firebase libraries (FirebaseArduino.h and FirebaseESP8266.h). Which one should I use?

If the Arduino board is the main board in the sketch, how does it pass the sensor's values to ESP-01? is it an automatic process once you use a function to write values to Firebase?

I would appreciate if someone could shed some light over this issue of connecting the Arduino boards with the ESP-01 and how to use such a configuration to read signals with the Arduino boards and sending them trough the ESP-01 to any Internet platform.

Thanks

It is reasonable to use an Uno or Nano to gather the data and an ESP8266-01 as a WiFi modem. The Uno would have user written code on it to get the data and format the data into packets that code on the Uno would send to the ESP. User written code on the ESP would receive the data and send the data out to the end destination.

There are several choices for the communication method between the Uno and ESP.

One could set up serial ports on the 2 boards and send the data via the UARTS. I would use a software serial port on the Uno and the ESP.

I2C is another communication method that would work. The Uno could be an I2C master and the ESP an I2C slave. I like this choice, myself.

Then there is SPI, which is somewhat like I2C.

Whichever communication method that is used one must remember that the Uno is a 5V device and the ESP a 3.3V device so level shifters must be used between the 2 devices.

Another way to do it is to use a ESP8266 WiFi module like the NodeMCU or Wemos for a single board solution with an external I2C or SPI ADC and/or external digital IO expanders (ie. MCP23008). Then you do not have the added complexity of the communication between the Uno and ESP and the supply voltage differences.

archet:
Instead many posts on Internet forums suggest to discard the Arduino board and use only the ESP-01 as an independent unit, even if it has only two digital GPIO's.

Because you are simply wrong to start with!

The ESP-01 has four digital GPIO's. :roll_eyes:

Which means it can interface to quite a number of devices, and easily control a number of port expander boards which have eight or sixteen I/Os each. :grinning:

Paul__B:
Because you are simply wrong to start with!

The ESP-01 has four digital GPIO's. :roll_eyes:

Which means it can interface to quite a number of devices, and easily control a number of port expander boards which have eight or sixteen I/Os each. :grinning:

Since the OP mentioned analog sensors, look at the MCP3004 Analog to Digital Converter.

OP- Some people have used the ESP-01 as a WiFi "shield" for the Arduino, but if you need WiFi, just use a board that already has WiFi on it. My current favorite is the Wemos D1 Mini. The Wemos is based on the ESP8266 and you program it using the Arduino IDE. If you program your code on the ESP8266-01 module, you also have to provide a regulated 3.3V supply and an external UART to program it. The Wemos D1 Mini or NodeMCU have a regulator and USB UART built on board.

thx

SteveMann:
The Wemos D1 Mini or NodeMCU hade a regulator and USB UART built on board.

Quite so, but where an ESP-01 will suffice, I often like to use the ESP-01 together with its USB support module.

It may or may not be cheaper than the WeMOS D1 Mini and it is compact and plugs directly into a USB "phone charger". Mind you, eBay/ Aliexpress prices have gone crazy with Covid-19. :roll_eyes:

The main disadvantage of an ESP-01 standalone, is the lack of convenient voltage regulation. The Wemos D1 has the 3.3V regulator and USB port to use 5V power.

aarg:
The Wemos D1 has the 3.3V regulator and USB port to use 5V power.

As does the combination I illustrated. :grinning:

It depends on whether you really require more GPIO on the WeMOS D1 Mini - which is of course, my other main "go-to" module - and how much space you have and which form factor suits. :sunglasses:

Paul__B:
Quite so, but where an ESP-01 will suffice, I often like to use the ESP-01 together with its USB support module.

Do you have a link? I tried these modules before, but the ESP Pin 1 was opposite what your image shows, making the total length about 4 inches.

Well, there are a ton of them on eBay and if you note the arrow, it indicates that the ESP-01 mounts directly over the interface board, not the other way.

.
So I don't know what you might have done with such a module! :astonished: