Comment by philipallstar

6 hours ago

I am really struggling to understand what ESP32 is. I've got into adjacent things a bit recently, but haven't figured that one out yet.

It's a family of microcontrollers by Espressif. A microcontroller (MCU) is a type of integrated circuit (IC: physical appearance: Black rectangle of epoxy with exposed metal tabs). It has, in the same IC, a CPU, RAM, non-volatile FLASH memory, and a collection of peripherals which vary depending on the MCU. These usually include I/O protocols, ADCs, DACs, DMA controllers, math processors etc.

Stated another way: An MCU, like the ESP32, is a tiny computer, sans the hardware you physically interface with it.

The computing power, and memory is much lower than your desktop or laptop PC (or mobile phone), but if you are using it to run a dedicated task, instead of using a big OS like Linux or Windows, it can complete the tasks really fast (often microseconds) and with minimal power use. This is because it's easy to program to do exactly what you need, with nothing competing for the hardware.

A note on ESP in particular compared to other MCUs: It's one of the only (Or was?) options which has Wi-Fi integrated into the MCU itself. It's a good default if you want that.

  • > I's one of the only (Or was?) options which has Wi-Fi integrated into the MCU itself. It's a good default if you want that.

    Indeed. The closest direct competitor is likely the Nordic nRF52840, which does bluetooth + thread, but can't talk actual wifi

    • The closest direct competitor is Bouffalo Lab's BL6xx chips, which do bluetooth and wifi and have an open SDK. Their documentation is very poor unfortunately (at least in English).

      Otherwise NXP recently released their RW6xx line with wifi/bt/thread/zigbee. But as with any other western maker, the documentation and SDK aren't as easily accessible to mere mortals (but I think NXP in particular has gotten better with this).

  • I think their point was more: is an ESP32 more like a arduino (or any other MCU) running bare metal or some thine RTOS or more like a raspberry pi which is more like a mini computer running a full fledged Linux. And I guess the answer it kind of always sat in between a little bit and now the family kind of spreads out across this whole spectrum.

    • To date ESP32s have been best thought of as arduino-like things, albeit with some fancy hardware available like WiFi and Bluetooth stacks. But very much microcontroller boards where you compile firmware and push it to the board over USB.

    • > is an ESP32 more like a arduino (or any other MCU) running bare metal or some thine RTOS or more like a raspberry pi which is more like a mini computer running a full fledged Linux

      Espressif's answer: yes

    • Arduino have muddied this water now, too, as some newer ones come with a full fledged Qualcomm SOC, multiple GB of RAM, and power consumption which requires quite a beefy heatsink.

They're all just single board computers, generally low-powered (literally and in the sense of capability, particularly memory)

They're generally intended to run flashed firmware and be single-purpose. They usually come bundled with peripheral components and typically have breakouts to add more (pots, sensors, etc).

They're great for doing one thing (though some support firmware switching), and you can build the 'software' for them pretty easily using Python or C-like variants.

So for hobbyists they're perfect. You want a quick LED christmas display you can toggle between Rudolph and Santa from a quick network call? You want a humidity sensor in your bedroom? You want to create a networked security camera? These are the types of use cases for MCUs.

  • BTW, I was just researching this last week (the christmas display) and ESP32 has a matter compatible chip now... so you an control all this from Apple Home and the other Smart Home platforms.

    Absolutely mind blowing. What a fun time to do side projects.

    • I think you're confusing Matter and Thread. ESP32-H* have Thread radio, but every esp32 that has wifi is able to talk Matter over WiFi.

      I have virtual power outlets and fans that actually just some process on linux.

    • esp32 has wifi so it it's trivial to hook it to mqtt which then exposes it to home assistant

  • They're not single board computers. They're microcontrollers. Or rather they were until this new chip was introduced.

    • >they're not single board computers.

      what's the meaningful distinction now? It isn't all SoC anymore and it has had a linux capable MMU since S3, even if it required a lot of work.

      The only real difference at this point is pure numbers, and i'm not that keen on defining microcontrollers as "those things with less ram than an SBC.", and if it's a microcontroller because it requires bare-metal flashes; well then I point to the older S3 MMU boards running busybox.

      8 replies →

ESP32 boards are small and cheap adapters between Wifi (network APIs) and I/O pins for small electronics like LEDs and relays.

If you want a web API for something in the physical world, make ESP32 do it.

At its core those all ESP32 are microcontrollers with RISC-V cores[0] and integrated wifi. There's a plethora of peripheral configurations, hence all those ESP32-* variations. This one even has Gbit ethernet and audio, bit still, at it's core (hah), RISC-V with only a few hundred MHz and 512kB RAM. So the peripherals are now similar to a Raspberry Pi, but not the CPU part itself.

[0] older versions had Xtensa cores, not RISC-V.

  • The most common ESP32 boards now are still the Xtensa ones. Not all of the variants have WiFi. Some only have one core. A lot more variants than many would expect.

    Comparisons to a Raspberry Pi are a stretch IMO. It is not a single board computer. You can't hook it up to a monitor/TV, plug a mouse and keyboard in, and use it as a Linux PC. However, there are people who use Raspberry Pis like a microcontroller because of its GPIOs... but they should all be using microcontrollers instead.

  • It's worth noting that just because it says ESP32, doesn't mean it has WiFi (see the P4), and yeah not just RISC-V but also xtensa. I think it's more synonymous with "has a very shitty ADC" imo.

I have an ESP32 here, it can do wifi, but only like 2 requests per second or so, with 50kB of data (I didn't measure it, but that's approximately what it can do).

Originally it was the more capable successor to ESP8266, the super cheap chip containing a high speed core with wifi and an IP stack. At one point it powered a huge chunk of all smart devices on the market. Then the original ESP32 was introduced as the successor, with BLE and two cores which were even faster. That made it a very capable chip for tasks demanding compute. After the original ESP32 they decided to add variety and make a whole "ESP32 family" and yes there's quite a lot of variety these days. Even the ISA and cores changed.

"ESP32" is a brand name. It covers devices with different CPU cores - Tensilica Xtensa and more recently RISC-V.

Each type of device has different capabilities. Most have Wifi, some don't. Some have extra RAM and ROM, and some don't.

The main thing that ties all the different devices together is the ESP-IDF software stack.

I use an esp8266 to control a relay attached to a lava lamp. Every 5 minutes it pings an NTP server and closes the relay if it's the evening.