PROJECT
Compact, inexpensive, and powerful! The Seeed XIAO family includes seven stamp-sized breakout boards with ESP32 controllers as well as with the RP2040, the SAMD21 and others. However, for connectivity in the prototyping phase, some extension board is needed. The Elektor eXpansion board integrates a lot of connectors (not just from the Seeed ecosystem), as well as a user button and LED plus some protection features.
By Saad Imtiaz and Jens Nickel (Elektor)
In the ever-evolving world of electronics, the need for flexible and robust development tools is paramount. Many developers have faced the frustration of working with expansion boards that fall short in terms of connectivity and protection. This expansion board for the tiny Seeed Studio XIAO microcontroller breakout boards addresses these pain points, offering versatility and robust features.
We created our board for our AmpVolt power meter project, but of course, the eXpansion board can be used in many different projects where you need an ESP32-C3 or -S3 (or another controller used in the XIAO family — see text box), and not too many pins. The XIAO boards offer 11 GPIO pins in total (D0…D10), serving as, among others, one SPI, one I2C, and one UART, as well as digital and analog inputs and outputs. The XIAO boards are mutually pin-compatible to a large extent. For example, you will always find the I2C pins at the D4 and D5 position. This makes prototyping even easier!
At the moment, there are 7 boards available, integrating controllers from different manufacturers. Find out more about their specs here.
XIAO ESP32S3 Sense |
But please note that D4 and D5 stand for the position of the pin on the XIAO board, it does not mean the GPIO pin 4 and 5 of the MCU. When you program via the Arduino IDE, the pin number for functions such as digitalRead(…) depends on the XIAO board you are using – please refer to Table 1 and the documentation of the XIAO board.
Table 1: XIAO Board pin connections to controller board GPIO numbers.
XIAO Board pin | ESP32-C3 | SMD21 | ESP32-C6 | ESP32-S3 |
D0 | GPIO2 | D0 | GPIO0 | GPIO1 |
D1 | GPIO3 | D1 | GPIO1 | GPIO2 |
D2 | GPIO4 | D2 | GPIO2 | GPIO3 |
D3 | GPIO5 | D3 | GPIO21 | GPIO4 |
D4 (SDA) | GPIO6 | D4 | GPIO22 | GPIO5 |
D5 (SCL) | GPIO7 | D5 | GPIO23 | GPIO6 |
D6 (TX) | GPIO21 | D6 | GPIO16 | GPIO43 |
D7 (RX) | GPIO20 | D7 | GPIO17 | GPIO44 |
D8 | GPIO8 | D8 | GPIO19 | GPIO7 |
D9 | GPIO9 | D9 | GPIO20 | GPIO8 |
D10 | GPIO10 | D10 | GPIO18 | GPIO9 |
When programming using Arduino IDE, select the correct XIAO variant, and when defining pins, use the appropriate GPIO numbers to select the correct pin on the board.
For example, if you want to blink LED1 (attached to D3) on the eXpansion board while using an ESP32 C3, to define LED1 as output, you have to use the corresponding GPIO number, i.e. 5 or D3, as demonstrated in the code snippet below.
#define LED D3 or #define LED 5 // As GPIO5 corresponds with D3 void setup() { pinMode(LED, OUTPUT); } void loop () { digitalWrite(LED, HIGH); delay(1000); digitalWrite(LED, LOW); delay(1000); }
Schematic Diagram
The expansion board’s design revolves around maximizing connectivity and functionality. The schematic diagram is shown in Figure 1. Of course, the main feature are the expansion connectors, which make the 11 GPIO pins (D0…D10) of a XIAO board of your choice easily accessible. The XIAO boards are part of the Grove ecosystem, and there are a vast variety of Grove peripheral modules available. For this reason, we are offering a lot of Grove connectors on the board — but not only these. This makes our board unique on the market.
Figure 1: Schematic diagram of the eXpansion Board V1.0There is an incredible number of I2C chips and modules available, from sensors to actuators and user interface elements such as displays. As you may know, many I2C modules can be connected in parallel to a controller’s I2C interface. You just have to make sure that they have different I2C addresses. Therefore, we had an extra eye on many connectors, making the I2C pins (D4 and D5) available. We decided on four Grove I2C connectors (J5 to J8) and two I2C Qwiic connectors (J11 and J12). These connectors facilitate effortless integration with various Grove and Qwiic I2C modules (see, for example, here). It goes without saying that, instead of Grove connectors, you could also solder other connectors that fit the pitch of 2 mm, for example, 4-pin PH2.0 connectors from JST.
Of course, not all peripheral modules are interfaced with I2C, for example, sensors are often connected via some sort of one-wire interface. Therefore, we also connected pins D0…D3 and D8…D10 to some Grove connectors. Together, D8, D1, D9, and D10 can form a full SPI interface with Chip Select (CS). These pins are available at J2 and J3, but it is required to use these two connectors simultaneously to access them all.
J9, along with D6 and D7, forms a Grove-compatible UART connector. To make it even more versatile, RX and TX pins are swappable via jumpers (JP1 to JP4). This adds to the board’s flexibility, enabling robust serial communication not only for “peripheral” UART modules, such as an RS-232 or RS-485 adapter, or a Grove GPS module. With swapped pins, you may also connect another controller board with Grove UART connector here, or even a second Elektor eXpansion board, to communicate with each other. To switch the RX/TX connections, simply disconnect the JP1 and JP4 solder bridges and connect the JP2 and JP3 bridges.
The board also incorporates an LED (LED1) and a button (SW1) for basic input and output functionality. These are connected to pins D2 and D3, respectively. The LED can serve as a status indicator, while the button can be used for user input. Notably, LED1 can be decoupled by desoldering the JP5 jumper, allowing users to disable the LED if not needed, and have free access to the corresponding GPIO pin.
Additionally, ESD protection has been added on the 3.3 V, 5 V, I2C, and SPI lines by using the SMF05C.TCT TVS diodes (D1 and D2) — more on this below.
The board also includes a screw terminal connector for 3.3 V, 5 V, and ground, which can be quite applicable to power and/or ground other electronic modules and devices. A 2 mm pitch connector is also available for battery connections, making the board suitable for both stationary and portable projects.
PCB Layout
The PCB layout is shown in Figure 2. To reduce the size of the PCB without sacrificing on connectivity, I2C and IO connectors are also added on the back side of the PCB, as shown in Figure 3. This was possible by using SMD connectors instead of standard through-hole technology (THT) connectors. Furthermore, for the UART and two of the I2C connections, THT support is also added, so if you run out of SMD connectors, THT connectors can be used.
The arrangement of components and connectors ensures that the board remains compact yet highly functional, catering to a wide range of project requirements, as shown in Figure 4.A 3D-printed enclosure was also designed for the eXpansion Board, as seen in Figure 5. The enclosure provides access to all the connectors, which makes it easy to be integrated into any project. In Figure 6 the eXpansion board is powered with a LiPo battery.
Importance of ESD Protection
In field applications, electronic devices are often exposed to various environmental stresses, one of the most critical being electrostatic discharge (ESD). ESD occurs when a sudden flow of electricity is transferred between two electrically charged objects, typically caused by contact. Without proper ESD protection, microcontrollers, and other sensitive components can suffer irreversible damage.
Microcontrollers (MCUs) are particularly vulnerable to ESD due to their intricate and delicate internal structures. An ESD event can induce high-voltage spikes that exceed the MCU’s voltage tolerance, leading to immediate or latent failures. Such failures can manifest as degraded performance, data corruption, or complete device breakdown. This can be catastrophic in field applications where reliability is paramount, such as in industrial automation, medical devices, or outdoor sensors.
To mitigate these risks, the expansion board is equipped with ESD protection on the 3 V, 5 V, I2C, and SPI lines. This protection ensures that any electrostatic discharge encountered in the field is safely dissipated, preventing it from reaching and damaging the sensitive MCU. This feature is crucial for maintaining the integrity and reliability of the device in real-world applications.
Future Enhancements and Applications
This expansion board is compatible with all microcontrollers in the XIAO lineup. It’s a game-changer for developers, educators, and hobbyists alike, particularly beneficial for rapid prototyping, educational projects, and IoT solutions, offering extensive connectivity and robust power management features. All the KiCad files and production files are available on the Elektor Lab GitHub Repository for this project.
In the future, we plan to use this expansion board to develop various projects, leveraging its multiple I2C and Qwiic connectors to integrate various sensors and modules seamlessly. Furthermore, as the XIAO ESP32 series has Wi-Fi capability, so the board is ideal for remote control and IoT applications. This board not only addresses current needs but also paves the way for innovative developments in electronics and microcontroller applications.
Questions or Comments? If you have questions about this article, feel free to email the author at saad.imtiaz@elektor.com or the Elektor editorial team at editor@elektor.com. |
Related Products Seeed Studio XIAO ESP32C3 Seeed Studio XIAO ESP32S3 Sense Seeed Studio Arduino Sensor Kit (Base) |