Why did I choose to go with ESP32-S3-WROOM?
So, a fundamental question behind choosing a right Microcontroller for our Robot.
If you wanted to design and build a bot - How would you choose a CPU? what makes a bot worth developing a solution with a CPU that makes a right decision? Would you choose the MCU first and then choose sensors needed for it? based on the functionality it offers? Is it based on the ease of manufacturing capability? availability? what else?
To understand why I landed on the ESP32, I need to tell you where i started.
Man… I had a lot of questions about choosing a right MCU for my project.. and I was so young 20 years ago :-) and always wondered how things are made.
After the industrial revolution, the world has grown at a pace faster than the humans living right now could actually benefit the progress from. I saw my father always busy working at a machineshop, and when I was in 10th grade, when all my friends were playing, my father asked me to go work in the machineshop. Though I never regretted it, I always felt sad thinking about the awesome social life that my friends were experiencing, which I could not. As a kid of 16, what else could you think apart from playing after school hours? I think it was when I started to feel restless and now I cannot feel the rest even when I want to do something as part of recreation. I feel like I am doing something wrong! I still feel like I am now living a fast paced life that even just sitting freely and looking at the sky, or going out for a walk at the beach makes me feel guilty of wasting time. Always been an overthinking kid. I used to work on production lathes - they’re called “production” for a reason. You are a human robot work on that lathe non-stop, all day long putting a work piece on the chuck and turn it, then dismantle it for inspection and just repeat the whole process and count 1500 to 1600 pieces at the end of the day. Get paid for the number of pieces you worked, keep a track of it in a sheet of paper, and let the inspection specialist audit for you once every week, just to figure out that you had a difference in 100 pieces and getting told off for being unable to count numbers properly. My father is nearing his 70s and he still works at his machineshop. He takes working in machineshop as a religious practice, considers his favourite thing. Very hardworking. I will always be thankful for him, who showed me a way of life in his own style. There are so many cars out in the world running with an inlet valve that I machined with a simple manual lathe. Working this trade, as a machinist gave me a kick start to maker’s life. Be it reading drawings of the part, assembling a lathe, preparing the work piece, centring the 4 jaw chuck, learning to use the screw gage the first time, all these have been memorable.
I can always sense the level of intelligence in a man by either looking at his craft, way of speech, his presentation, or the presents he gave to his girl friend. But, for a robot, how do you sense it? Actually, it is not realistic to perceive intelligence of a robot. Because unlike humans, they are always limited by the capabilities. Being a creator, it is up to you to give it a power of sensibility. To keep the price per parts low, and still achieve a bit of reliable physical model that can “feel” something, we gotta use sensors that a micro controller can natively support. There are some fancy keywords words that come along with sensors to read a value it outputs during operation. I2C, SPI, Or just get Raw values? So, basically, out of so many MCU manufacturers out there, does your application of logic help the system give life? how much are you willing to go all by yourself? would it be easier if there are people of your like mindset is also working on something similar and are open enough to share code with the world and calling it open source? For me, There were so many factors that made me decide.
- How many sensors am I going to require? is it going to let me use multiple sensors of the same type without too much hassles?
- What should be the Computational power? what is the bare minimum I needed?
- Does the manufacturer’s eco system also has a developmental framework, that helps me with shipping the product faster? Or, do I have to do it in assembly code like in the 60s?
- What strategy can I come up with storing the firmware?
- In the future, if I plan on sending upgrades, How can I be flexible enough so people can always choose to upgrade when they want?
- How long will it be available for manufacturing in the market? Or, has been already declared End of Life?
- Power requirements - Do I have to struggle too much with excessive schematics for the power supply? is it worth the trade off?
- Connectivity requirements - Do I have to have a periphery or the MCU comes with it?
- Certification and compliance - How much do I have to bleed before I actually start to sell the first bot?
Honestly, when I first started playing around with MCUs, RPI’s Pico was in the boom and I had thought about using RP2040.
Dual-core Arm Cortex-M0+ processor, flexible clock running up to 133 MHz
264kB on-chip SRAM 2 × UART, 2 × SPI controllers, 2 × I2C controllers, 16 × PWM channels 1 × USB 1.1 controller and PHY, with host and device support 8 × Programmable I/O (PIO) state machines for custom peripheral support Operating temperature -40°C to +85°C Drag-and-drop programming using mass storage over USB Low-power sleep and dormant modes Temperature sensor Accelerated integer and floating-point libraries on-chip
But, I was not writing another Raspberry Pi Pico W.
And then, I moved on to assess STM32H742xI They are extremely reliable, think about using them in medical electronics equipments. They have good repute as well. But, this is a bare metal chip. I have to re-invent wheels. I mean, RF for antenna, WiFi, BT chip, getting compliance certified, they are a bit of hassle which makes it suitable for well established organisations. For home-based creators who are just starting up, they will find something that they can get more out of a system by hard wiring too much. That is why I chose ESP32-S3.
A quick google search can always give you comparison of all the different microcontrollers out there.
I chose the WROOM package instead of bare me(n)tal in the development. incase if you see me using another chip after this, then consider I have blown up. What I liked the most:
- It comes with some really good dev kits, using which I can easily program it, and infer deeper decisions before actually designing my own schematics. This helps in its own ways - You have a system already, just wire up with GPIO pins, and then simplify circuits, program it, and test it. This is where people liked Arduino the most. They delivered a Dev board, and with their IDE, rate of experimentations significantly grew up. Qualcomm buying them is an another topic we can leave it for another day. Anyways…
- Their ESPIDF - I find it cool, you can actually develop professional grade solutions with their framework.
- PINS- they are indeed, so so good with lots of pins. I am still assessing what pins to use, but I plan to use lots of sensors.
- I plan to partition the storage - one for the booted flash, and another one for the OTA.
- The S3 variant specifically - when you look at the ESP32 family, there are so many variants it can make your head spin. ESP32, S2, S3, C3, C6… I went with the S3 because it runs dual-core LX7 processors - a step up from the LX6 in the original ESP32. Why does that matter? Because on a self-balancing robot, you need one core doing nothing but running the balance control loop at a fixed rate, and another core handling WiFi, BLE, camera, and everything else. If they shared a single core, the balance loop would hiccup every time a WiFi packet came in. The robot would fall. Not ideal.
The S3 also has native USB OTG and better BLE 5.0. And there are vector instructions baked in for basic ML inference - I may not use them now, but it is good to know they are sitting there.
Why the WROOM-1 module and not the bare ESP32-S3 chip?
Remember question 9 on my list? How much do I have to bleed before I actually start to sell the first bot? This is where the WROOM-1 module does something beautiful. It comes pre-certified - FCC for USA, CE for Europe, and a handful of other regional certifications. The RF design, the antenna, the shielding, all of it has already been tested and approved by ST before it even reaches my hands. If I had gone with the bare ESP32-S3 chip and designed my own RF circuit around it, I would be looking at somewhere between A$10,000 to A$30,000 (A$ is AUD, I live in Aus) in certification lab fees just to legally sell the thing in the US. Before a single unit ships. The module bleeds for you in advance, and the cost is already baked into the $4 or so you pay per unit. That is an incredible deal.
Why N16R8 - what does the 16 and R8 actually mean for the robot?
The N16 means 16MB of Flash storage. The R8 means 8MB of PSRAM. The PSRAM is what I care about most for the camera( I really hope to build this). When the OV2(/5)640 captures a frame, that image has to sit somewhere in memory while the processor works on it. With 8MB of PSRAM, the frame buffers live there comfortably, leaving the internal SRAM free for the actual application logic. Without PSRAM, you simply cannot do camera streaming on an ESP32. The 16MB Flash matters for OTA updates - question 4 on my list. To send firmware updates over WiFi, you need two equal app partitions on the Flash: one running the current firmware, one receiving the new one. With 16MB I can give each partition a generous 6MB and still have room left for storing configuration and web assets. With only 8MB Flash, that headroom gets tight fast as the firmware grows. It is one of those decisions that costs you almost nothing now but saves you a painful redesign later. So, does the ESP32-S3-WROOM-1-N16R8 answer all 9 questions? Pretty much, yes.
Multiple sensors of the same type - solved with multiple I2C buses (and XSHUT pins.) Computational power - dual LX7 cores handling balance and connectivity separately. Developer ecosystem - ESP-IDF is genuinely professional grade. Firmware storage - 16MB Flash with room to breathe. OTA updates - dual partition scheme, people can upgrade whenever they want. Market longevity - Espressif has committed long-term production, no EOL in sight. Power - the module runs off 3.3V, plays nicely with a single LiPo cell through an LDO. Connectivity - WiFi and BT built in, antenna included. Certification - done before I even touch the board. Back at the machineshop, my father never picked up the wrong tool for the job. You do not face a valve seat insert with a boring bar meant for something else - you use the right insert, at the right speed, for that specific material. You learn this the hard way. The ESP32-S3-WROOM-1-N16R8 is that tool for this robot. Just the right one, for this job, right now. Now let me go actually build the thing.