General > General Technical Chat
[SOLVED] Can ESP32 board be used as an Arduino?
eti:
Long story short, I have moved house and my Arduino is nowhere to be seen, it’s in storage.
Can an ESP32 (WROOM type) be used “as an Arduino”, at a pinch?
I know the IDE has ESP32 plug-ins which allow the ESP32 to be programmed *with* the IDE, but can I treat the GPIO the same as if it were a cheap Arduino? I have no money for a replacement MEGA 2560, and the ESP32 is available for same day.
Thanks!
ledtester:
One big difference is the operating voltage, 3.3V vs 5V.
This page seems to give a good summary of the ESP32 WROOM GPIO pins:
https://circuits4you.com/2018/12/31/esp32-devkit-esp32-wroom-gpio-pinout/
For instance, some pins are input only, some do not have an internal pull up.
That page also has example code for the GPIO features (ADC, DAC, PWM, etc.)
Ed.Kloonk:
https://www.freetronics.com.au/blogs/news/etherten-and-ethermega-victims-of-the-global-chip-shortage
tooki:
--- Quote from: eti on September 20, 2022, 12:18:21 am ---Long story short, I have moved house and my Arduino is nowhere to be seen, it’s in storage.
Can an ESP32 (WROOM type) be used “as an Arduino”, at a pinch?
I know the IDE has ESP32 plug-ins which allow the ESP32 to be programmed *with* the IDE, but can I treat the GPIO the same as if it were a cheap Arduino? I have no money for a replacement MEGA 2560, and the ESP32 is available for same day.
Thanks!
--- End quote ---
One of the big advantages of the Arduino software framework* is how much support there is for various boards, making it a true cross-platform MCU framework. In addition to the classic AVR Arduinos (and a few non-AVR Arduinos), it supports numerous other MCU boards, including ESP32, STM32, and Raspberry Pi Pico.
Anyhow, the ESP32 WROOM and WROVER is a great, very, very popular upgrade (in most respects) from the classic Arduino boards, and at lower cost! Other than being 3.3V (which certain genuine Arduino boards also are), it’s a largely drop-in replacement. There are really only two downsides compared to the classic AVR boards like the Arduino Uno and Mega2560: compiling takes longer (since the ESP32 runs a RTOS under the hood, which must also be compiled), and it doesn’t have as many GPIOs as the Mega2560. (IIRC there do exist other ESP32 models with more GPIOs. Most, but not all, ESP32 MCUs are supported under Arduino.) Because of the ESP32’s popularity, most Arduino libraries have been battle-tested on ESP32, and in many cases have been explicitly optimized for them.
I’ve nearly completely switched to ESP32 in my projects, using PlatformIO as the IDE. (I’m vastly more productive with PlatformIO. The Arduino IDE is a toy.) The $11 for the official debugger (ESP-PROG) is well spent, though it’s a bit fickle.
Another board family that’s nice is the STM32 Nucleo boards. Many of them are pin-compatible with Arduino boards. Just bear in mind that they’re also 3.3V, and that not all Nucleo boards are supported in Arduino. One big perk is that the Nucleo boards have the debugger built in, and it works with almost zero setup. I’ve played with Nucleo boards at work, and have been meaning to order a few for myself.
IMHO the easiest way to browse what’s available is using PlatformIO (or its website), which lets you filter boards by software framework.
*”Arduino” comprises three distinct things:
1. The Arduino boards
2. The Arduino software framework
3. The Arduino IDEs
The only part that’s mandatory, so to speak, is the framework. You can mix and match the boards and IDEs at will, as I do with ESP32 on PlatformIO. It’s even possible to mix frameworks, like using ESP32 with both the Arduino framework and ESP-IDF (ESP32’s native framework) simultaneously.
pcprogrammer:
Even though the Nucleo boards are nice eti mentioned that he does not have the money to get a replacement MEGA2560, so this rules out a lot of the Nucleo boards too, because they are not as cheap as the ESP32 boards.
The main difference is the number of pins and the supply voltage as others already mentioned.
A benefit is the wireless connectivity and the much faster processor which can make more things possible.
Edit: There is of course the Raspbery PICO, which is also cheap and supported by the Arduino development environment. It too is 3.3V and if needed there are boards with wifi.
Navigation
[0] Message Index
[#] Next page
Go to full version