Add support for ESP32 zero / super mini boards
Look into support for ESP zero / super mini boards that much smaller form factors. This is a list of boards that I have found and will at least investigate what is possible,
The challenge is that many super mini boards exist and not all have the same pin configuration. In order officially support these boards I need to ensure the correct pinout which means that I will focus on known brands to make it easier for builders to identify the correct boards and also ensure that boards are easy to find around the globe.
Would be good to have a board with 8 Mb flash since the 4Mb is not going to work when moving to Arduino 3.
I start with naming the pins from the upper left on the top side...
ESP32 C3
Waveshare ESP32 C3 zero (18 pin board)
Pins: 5V, GND, 3V, 0, 1, 2, 3, 4, 5, 6 | 7, 8, 9, 10, 11, 12, 13, RX, TX
Note: GPIO10 is RGB LED, GPIO2/GPIO8/GPIO9 are strapping pins and needs to be high on boot.
CPU: ESP32-C3FH4, 160Mhz,
Connectivity: 2.4GHz Wi-Fi (802.11 b/g/n) and Bluetooth® 5 (LE)
Memory: 400KB of SRAM and 384KB ROM, and 4MB of onboard Flash memory
GPIO: 3 × SPI, 1 × I2C, 2 × UART, 1 × I2S, 2 × ADC
LED: WS2812 RGB LED (GPIO10 is also connected to LED)
Size: 18 mm x 23.5 mm
URL: Link
TENSTAR ESP32 C3 super mini (16 pin board)
Same layout as the TZT
Pins: 5, 6, 7, 8, 9, 10, 20,21 | 0, 1, 2, 3, 4, 3V, GND, 5V
Note: GPIO8 is LED, GPIO2/GPIO8/GPIO9 are strapping pins and needs to be high on boot.
CPU: ESP32-C3FN4, 160Mhz,
Connectivity: 2.4GHz Wi-Fi (802.11 b/g/n) and Bluetooth® 5 (LE)
Memory: 400KB of SRAM and 384KB ROM, and 4MB of onboard Flash memory
GPIO: 3 × SPI, 1 × I2C, 2 × UART, 1 × I2S, 2 × ADC
LED: Blue LED on GPIO 8
Size: 18 mm x 22.5 mm
URL: Link
TZT ESP32 C3 zero (16 pin board)
Same layout as the TENSTAR
Pins: 5, 6, 7, 8, 9, 10, 20,21 | 0, 1, 2, 3, 4, 3V, GND, 5V CPU: ESP32-C3FN4, 160Mhz, Connectivity: 2.4GHz Wi-Fi (802.11 b/g/n) and Bluetooth® 5 (LE) Memory: 400KB of SRAM and 384KB ROM, and 4MB of onboard Flash memory GPIO: 3 × SPI, 1 × I2C, 2 × UART, 1 × I2S, 2 × ADC LED: Blue LED on GPIO 8 Size: 18 mm x 22.5 mm URL: Link
DING YIMEI ESP32 C3 zero (18 pin board)
This board as a different layout than the others, not recommended to use. Not the same layout as the waveshare even though it has the same amount of pins.
Pins: 5V, GND, 3V, 0, 1, 2, 3, 4, 5 | 6, 7, 8, 9, 10, 18, 19, 20, 21 CPU: ESP32-C3FN4, 160Mhz, Connectivity: 2.4GHz Wi-Fi (802.11 b/g/n) and Bluetooth® 5 (LE) Memory: 400KB of SRAM and 384KB ROM, and 4MB of onboard Flash memory GPIO: 3 × SPI, 1 × I2C, 2 × UART, 1 × I2S, 2 × ADC LED: WS2812 RGB LED (GPIO10 is also connected to LED) Size: 18 mm x 22.5 mm URL: Link
Seeed Studio XIAO ESP32 C3 (14 pin board)
Note! This board has an external antenna and might not be suitable for this project.
Pins; 0, 1, 2, 3, 4, 5, 6 | 7, 8, 9, 10, 3V, GND, 5V URL: Link
Adafruit QT ESP32 c3
URL: Link
Other
ESP32-C3FN4: This chip is designed for a temperature range of -40°C to 85°C. ESP32-C3FH4: This chip is designed for a temperature range of -40°C to 105°C.
ESP32 C6
Waveshare ESP32 C6 zero (18 pin board)
Pins: 5V, GND, 3V, 0, 1, 2, 3, 4, 5, | 22, 21, 20, 19, 18, 15, 14, RX, TX CPU: ESP32-C6FH4, 160Mhz, Dual processors Connectivity: 2.4GHz Wi-Fi (802.11 b/g/n) and Bluetooth® 5 (LE) Memory: 320KB ROM, 512KB of HP SRAM, 16KB LP SRAM and 4MB Flash memory GPIO: 3 × SPI, 1 × I2C, 2 × UART, 1 × I2S, 2 × ADC LED: WS2812 RGB LED (GPIO8 used, not conflict with pins) Size: 18 mm x 23.5 mm URL: Link
Sparkfun ESP32 C6 qwiic (12 pin board)
URL: Link
Are ESP32 modules with dual-core processors required for the iSpindle?
When do you need to switch to Adriano-3 (8MB modules)?
The ESP32 Super Mini modules should be easy to find and cheap. I would prefer an ESP32 C3 Super Mini (Zero) 16-pin 4MB module with layout: 5, 6, 7, 8, 9, 10, 20, 21 | 0, 1, 2, 3, 4, 3V, GND, 5V for the first step. https://dl.artronshop.co.th/ESP32-C3%20SuperMini%20datasheet.pdf
Maybe there will be more ESP32 Super Mini Modules with 8MB Flash in the future.
Dual core is not essential, i'm only using one core currently. But two cores could speed up the sensor readings if more could be done in parallel. One thread for connecting to wifi and the other for reading sensor values. But since I need to support 8266 its easier to do everything in one thread.
I'm currently on 1.8 Mb with the current features and when i have tested with Arduino 3 it added 300k on top of that which means I can do flashing via web or OTA. So to move to Arduino 3 i would need 8Mb RAM.
I ordered a few boards from aliexpress and I focused on getting some brand ones since I want to make it easy for users to find the correct board. Some of the super mini does not have the same pinout which means the software would not work.
I ordered a the TENSTAR and WAVESHARE board but i did not receive the 16pin TENSTAR as in the picture above, instead i got a 18pin board that was identical to the waveshare except for the print on the back. Both of those we branded as Zero
Currently I'm testing those boards to see if they can be used even though these are 18-pins.
If you have some brand 16 pin boards that could be recommended i would order the try those as well. The ones i have look at had different pinouts so it would be hard to find the correct ones.
This is the current schematic im testing with the Tenstar/Waveshare Zero board (18 pin). I've just done some initial hardware test and next step is to make a prototype to do some more testing with.
I have also added a storage pin feature that will place the board in deep sleep when more than 2.5V is applied to the pin. The intention is to use that when a wireless charger is connected so the board will go to sleep while charging. Once power is removed the device will wakeup. No real need for a power on/off switch.
- removed obsolete schematic *
Support for the ESP32 c3 Zero from Waveshare / Tenstar (18-pin board) is now available in the dev branch. More testing is needed but the basic tests has passed.
Are ESP32 modules with dual-core processors required for the iSpindle?
When do you need to switch to Adriano-3 (8MB modules)?
The ESP32 Super Mini modules should be easy to find and cheap. I would prefer an ESP32 C3 Super Mini (Zero) 16-pin 4MB module with layout: 5, 6, 7, 8, 9, 10, 20, 21 | 0, 1, 2, 3, 4, 3V, GND, 5V for the first step. https://dl.artronshop.co.th/ESP32-C3%20SuperMini%20datasheet.pdf
Maybe there will be more ESP32 Super Mini Modules with 8MB Flash in the future.
I have placed a new order for an ESP32 super mini so lets see if I can get the correct one this time. I have added support for the waveshare board so that seams to work fine.
Support for the ESP32 c3 Zero from Waveshare / Tenstar (18-pin board) is now available in the dev branch. More testing is needed but the basic tests has passed.
I have ordered the TENSTAR ESP32 C3 Zero (18-pin board). The “Storage” input for charging with Qi Charger should be renamed to “Charging” as it will also be active when charging with USB-C. What does the solution for “force config” look like?
Support for the ESP32 c3 Zero from Waveshare / Tenstar (18-pin board) is now available in the dev branch. More testing is needed but the basic tests has passed.
I have ordered the TENSTAR ESP32 C3 Zero (18-pin board). The “Storage” input for charging with Qi Charger should be renamed to “Charging” as it will also be active when charging with USB-C. What does the solution for “force config” look like?
Thats a good idea, I will change the naming to Charging PIN
Force config can be set either via the UI or by connecting the two pins CFG1/CGF2 which is checked at startup and sets the option on the device. As long as that is set it will not go into sleep mode. This is useful when doing calibration and getting gravity/angle values for the calibration formula.
I test the TENSTAR ESP32C3 Zero module with the 2.3.0 firmware and all devices are recognized. The data is sent to the target in "Config mode".
No data is sent in "gravity mode" because the module does not wake up from sleep mode. I have a resistor with 220 kOhm against GND at IO4 (Charging PIN) as a test.
EDIT: The same problem with or without charging
I get the same issue, interesting that this board does not work as other esp32 boards. Will do some more testing to see what could be the issue
I can see that the boards wants to wake up (connects to serial but does not complete the boot sequence) my guess its must be some of the strapping pins that causes this. I dont have a soldering iron where I'm at the moment but my best guess is the GPIO8 / GPIO9 that should be high during boot but on my board they are low.. So there might not be any pullup resistors on the gyro board.
Probably its best to move the i2c to some other pins to avoid this or add some pullup resistors to the SCL / SDA lines.
I will do some more testing when I can resolder my test board.
Link to the info page i found; https://www.espboards.dev/esp32/esp32-c3-zero/
I test the TENSTAR ESP32C3 Zero module with the 2.3.0 firmware and all devices are recognized. The data is sent to the target in "Config mode".
No data is sent in "gravity mode" because the module does not wake up from sleep mode. I have a resistor with 220 kOhm against GND at IO4 (Charging PIN) as a test.
EDIT: The same problem with or without charging
I've found out that its due to RTC memory corruption that the device does not start up properly after deep sleep. I have seen that on the ESP32 lite as well. Once I disable that part it works fine. However a lot of the new features will not work so I will see if I can figure out why this occurs. I will do some more tests both with the Waveshare and Tenstar Zero boards to see if there is any difference.
I also got the super mini boards in the mail yesterday so I will test them as well.
Can now confirm that WaveShare & Tenstar Zero boards + the Tenstar Super Mini does not work with RTC memory enabled. All of them dont start properly when this feature is enabled. Do you have any ideas on what could cause this ?
So, here is an update schema of the ESP32c3 Zero where i have changed some pins to avoid the strapping pins. This version is in the dev branch.
Here is a draft version of the super mini, the charging pin might need a pulldown on these boards to do proper wakeup, at least more testing is required.
After installing the new firmware version under branch/dev, the following message appears in the browser for both module variants C3 Zero and C3 Super Mini: Failed to load status from device, please try to reload page!
The automated build used the wrong ui build, i will fix that and let you know
The build in the dev branch should be good now.
I tested both module variants with v2.3.0 beta:
ESP32 C3 Zero: All tests, including charging, were successful. I use a 4.7 kOhm pull-down resistor.
ESP32 C3 SuperMini: Basically, it works, but I have problems with the WiFi connection with two tested modules. Either no connection to the AP is established at startup, or the connection is interrupted during use (even “Scan for strongest AP” makes no difference).
Power consumption in sleep mode: ESP8266 = 0.17mA; ESP32C3 Zero = 0.66mA
Can you share some serial log output of the startup procedure for the wifi issue?
The current for the cpu should be 5uA in deep sleep mode, what other thing was connected? Gyro? Temp sensor? The voltage divider would also leak som power
Can you share some serial log output of the startup procedure for the wifi issue?
Serial log > if connection is OK: (blue LED flashing slowly)
: Setting up hardware.
394 I: GYRO: Detected MPU6050/MPU6500 68.
1283 I: Main: Battery 3.89 V, Gyro=88.49, Run-mode=1.
1326 I: WIFI: Reducing wifi power for c3 chip.
1327 I: WIFI: Connecting to wifi using stored settings Zeluce33.
7335 I: WIFI: Found the following networks ssid: Zeluce33 bssid: 74:42:7F:3F:21:16, rssi: -81 channel: 6.
7336 I: WIFI: Found the following networks ssid: Zeluce33 bssid: A0:04:60:37:70:83, rssi: -86 channel: 1.
7337 I: WIFI: Using ssid: Zeluce33 bssid: 74:42:7F:3F:21:16, rssi: -81 channel: 6.
..
8235 I: WIFI: Connected to wifi Zeluce33 ip=192.168.1.65.
8235 I: WIFI: Using mDNS name iSpindel-M.
8321 I: TSEN: Found 1 temperature sensor(s). Using 9 bit
8322 I: Main: Switching gyro to continous.
8327 I: Main: Activating web server.
8328 I: WEB : Configuring web server.
8328 I: WEB : Configuring web server.
8338 I: WEB : File=error.log, 946 bytes
8342 I: WEB : File=gravitymon2.json, 2116 bytes
8347 I: WEB : File=http-1.tpl, 225 bytes
8351 I: WEB : File=reset.dat, 1 bytes
8351 I: WEB : Setting up async web handlers.
8353 I: WEB : Web server started.
8363 I: WEB : Setting up handlers for web server.
8365 I: WEB : Web server started.
8365 I: WS : Starting serial websocket
8366 I: SDBG: Serial logging started at 115200.
521 I: SDBG: Serial logging started at 115200.
521 I: Main: Setup completed.
Serial log > if not connected to WiFi after Reset: (blue LED flashing fast)
: Setting up hardware.
394 I: GYRO: Detected MPU6050/MPU6500 68.
1282 I: Main: Battery 3.85 V, Gyro=89.11, Run-mode=1.
1324 I: WIFI: Reducing wifi power for c3 chip.
1325 I: WIFI: Connecting to wifi using stored settings Zeluce33.
7333 I: WIFI: Found the following networks ssid: Zeluce33 bssid: 74:42:7F:3F:21:16, rssi: -85 channel: 6.
7334 I: WIFI: Found the following networks ssid: Zeluce33 bssid: A0:04:60:37:70:83, rssi: -89 channel: 1.
7335 I: WIFI: Using ssid: Zeluce33 bssid: 74:42:7F:3F:21:16, rssi: -85 channel: 6.
...............................................................................................................................................................................................................................................................................
38132 E: WIFI: Failed to connect to wifi 0
38134 W: WIFI: Failed to connect to first SSID Zeluce33.
38135 W: WIFI: Failed to connect to any SSID.
38221 I: TSEN: Found 1 temperature sensor(s). Using 9 bit
38222 I: Main: Setup completed.
38792 W: Main: Angle: 89.11 (89.11), Velocity: 0.00
40235 W: Main: Angle: 89.10 (89.10), Velocity: 0.00
Serial log > sometimes loss of IP connection to the iSpindel when it is moved (no ping possible) Blue LED flashing slowly
29869 I: GYRO: Movement detected (500) 7215 5509 4658.
30767 I: GYRO: Movement detected (500) 1280 13743 5502.
31666 I: GYRO: Movement detected (500) 3794 2218 481.
32564 I: GYRO: Movement detected (500) 95 2200 424.
33462 I: GYRO: Movement detected (500) 1558 1755 393.
34361 I: GYRO: Movement detected (500) 822 623 946.
35259 I: GYRO: Movement detected (500) 2412 418 36.
36157 I: GYRO: Movement detected (500) 793 125 54.
37055 I: GYRO: Movement detected (500) 1608 243 172.
38521 W: Main: Angle: 12.62 (89.05), Velocity: 0.00
39952 W: Main: Angle: 12.63 (63.58), Velocity: 0.00
: Setting up hardware. 394 I: GYRO: Detected MPU6050/MPU6500 68. 1283 I: Main: Battery 3.89 V, Gyro=88.49, Run-mode=1. 1326 I: WIFI: Reducing wifi power for c3 chip. 1327 I: WIFI: Connecting to wifi using stored settings Zeluce33. 7335 I: WIFI: Found the following networks ssid: Zeluce33 bssid: 74:42:7F:3F:21:16, rssi: -81 channel: 6. 7336 I: WIFI: Found the following networks ssid: Zeluce33 bssid: A0:04:60:37:70:83, rssi: -86 channel: 1. 7337 I: WIFI: Using ssid: Zeluce33 bssid: 74:42:7F:3F:21:16, rssi: -81 channel: 6. ..
: Setting up hardware. 394 I: GYRO: Detected MPU6050/MPU6500 68. 1282 I: Main: Battery 3.85 V, Gyro=89.11, Run-mode=1. 1324 I: WIFI: Reducing wifi power for c3 chip. 1325 I: WIFI: Connecting to wifi using stored settings Zeluce33. 7333 I: WIFI: Found the following networks ssid: Zeluce33 bssid: 74:42:7F:3F:21:16, rssi: -85 channel: 6. 7334 I: WIFI: Found the following networks ssid: Zeluce33 bssid: A0:04:60:37:70:83, rssi: -89 channel: 1. 7335 I: WIFI: Using ssid: Zeluce33 bssid: 74:42:7F:3F:21:16, rssi: -85 channel: 6.
From what i can see the error comes from the arduino framework and my guess is that in the first attempt the signal is weak (-81) and in the second -85 which is weaker and barley connectable which is proably why it fails the second time. The c3 boards have had quite bad Wifi reception where i was forced to lower the transmission power for them to work. It might be that the newer boards have fixed that and I can remove that limitation.
The current for the cpu should be 5uA in deep sleep mode, what other thing was connected? Gyro? Temp sensor? The voltage divider would also leak som power
I have carried out further consumption measurements. The measurements are always taken on the same test board with identical peripherals (DS18B20, MPU6050, voltage divider) in deep-sleep mode: ESP8266 > 0.17mA ESP32 C3 SuperMini with power LED > 0.49mA ESP32 C3 SuperMini without power LED > 0.16mA
ESP32 C3 Zero > 0.58mA (is there a comparative value?)
According to the documentation, the power consumption for the Zero board alone should be ~ 43uA.
The MPU6050 could draw 4mA according to the data sheet and the DS18B20 the same when active. I will see if I can do some current tests in the coming week, i have not had that much time to focus on the projects in the last few weeks,
I have not done some initial testing with the zero and super mini boards and the basics seams to work. I need to make a full prototype to test all the features. The dev branch is up to data with the latest changes.
With “firmware32c3zero.bin 2.3.0 beta-2,” I get the error “battery level not valid” on both Zero boards. The voltage at pin 4 is 1.75V and works with the previous version “firmware32c3zero.bin 2.3.0 beta.”
ok, i will have a look, i just tested the pin configuration for the other features, i have not tried the battery not the sleep/charging features in a complete build.
I'm still waiting for some new components so I can build a few new prototypes and test everything properly
I tested the supermini and the voltage reading looks good. What voltage factor are you using. I calibrated mine to 1.78 (the standard for the c3 mini was 2.25) which is to high.
You where correct there was a bug affecting the zero board. It should be fixed now (build will be ready in 15 min). I have also added the default voltage factors that I calculated for those boards.
The waveshare zero board should now work as expected and I had a successful fermentation using that board (2.3 beta3). I will now start to do the same testing with the supermini board as the next step.
Beta 4 is now released with support for the esp32 c3 super mini, closing this now