iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
😇

Common Pitfalls when Using Arduino Nano ESP32

に公開

1. Overview

I bought this because I wanted a Nano with WiFi connectivity. However, since it's equipped with an ESP32, there were parts that couldn't be used in the same way as a standard NANO, so I'm taking notes here. I will add more if I run into other issues.

2. You need to cut the B1 pin to use an expansion I/O board

I was having trouble because I couldn't upload code when it was mounted on the expansion I/O board. After some research, I found a forum post saying "Cut B1!"
https://forum.arduino.cc/t/esp32-not-recognized-if-connected-to-gravity-nano-i-o-shield/1176673

The B1 pin, along with the B0 pin, is explained below. It seems they are used for bootloader mode.
https://support.arduino.cc/hc/en-us/articles/9625819325212-About-the-B1-and-B0-pins-on-the-Nano-ESP32

3. Different way to specify NeoPixel pins

I couldn't get the NeoPixel to light up no matter what I did, but it turned out the pin specification method was different.

A similar discussion was taking place in this forum.
https://forum.arduino.cc/t/nano-esp32-and-neopixels-issue/1177402/2

For example, if you want to use D6, you specify number 9, which is the GPIO number.

In the NeoPixel "simple" sample, it usually looks like this:

#define PIN        6
#define NUMPIXELS 16
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
...

When using the Nano ESP32 and you want to use the D6 pin, it's not 6 but the GPIO number 9.

#define PIN        9 // D6 = GPIO9
#define NUMPIXELS 16
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
...

Details are provided below. There is also a mapping diagram between PIN numbers and GPIO numbers.
https://docs.arduino.cc/tutorials/nano-esp32/pin-setup/

For things other than NeoPixel, the standard PIN numbers work fine.

4. Analog pins cannot be used as digital pins (this applies to standard NANO too)

This is not just because of the Nano ESP32; it seems the standard Nano can't use them either.

The exception is the Arduino Nano, Pro Mini, and Mini’s A6 and A7 pins, which can only be used as analog inputs.

https://forum.arduino.cc/t/can-i-use-all-the-analog-pins-of-arduino-nano-as-digital/923215/2

It's not listed in the digital section of the official documentation either, so that must be the case.

https://docs.arduino.cc/tutorials/nano-esp32/cheat-sheet/#pins

5. Operating voltage is 3.3V instead of 5V, and 5V cannot be obtained without a USB connection

The internal operating voltage of the ESP32-S3 SoC is 3.3 V

https://docs.arduino.cc/tutorials/nano-esp32/cheat-sheet/#operating-voltage

Accordingly, the 5V output pin has been changed to VUSB. When connected via USB, 5V is supplied from the USB, but when supplying power from VIN without a USB connection, 5V cannot be obtained. If VIN is 5V, you can use that, but since I was trying to use 12V, I prepared a separate three-terminal regulator to get 5V from 12V.

Discussion