iTranslated by AI
Building NECO MIMI Stack-chan
Hi everyone! This article is an easy-to-read summary of the content I presented during an LT at the M5Stack User Meeting Kanazawa #2 on February 10, 2024.
It's a story about how I created my own original stack-chan based on the stack-chan data available on GitHub.
Target Audience
- People interested in M5Stack or stack-chan
- People interested in cute things
Self-introduction
I'm Nanana, a virtual engineer. I started sharing information on X (Twitter) around June 2023. I'm active mainly on X (@nananauno), so I'd be happy if you followed me!
Here is a brief overview of what I did in the six months of 2023:
- Around June, I bought an M5Stack Core2.
- Around August, I applied for the M5Stack Japan Creativity Contest 2023.
- Around November, I went to Maker Faire Shenzhen 2023, and visited M5Stack the following day to tell Jimmy "I like it!"
At the time of the LT presentation, my M5Stack experience was about 8 months, but I fell in love with M5Stack's charm and did various things in that half-year. I've summarized what I did in 2023 in the following note articles, so please take a look if you're interested.
What is stack-chan?
For those of you who know M5Stack, you likely know stack-chan well, but for those who don't, let me explain what it is.
stack-chan is a super cute, palm-sized robot created by Shishikawa-san (@meganetaaan/@stack_chan). The 3D printable data for the enclosure, schematics, and software are all available on GitHub, so anyone can build their own stack-chan.
It seems that "AI stack-chan," created by @robo8080, is widely used by the community. AI stack-chan utilizes ChatGPT and VOICEVOX, enabling stack-chan to respond using Zundamon's voice (with default settings).
Since all the data required to build stack-chan is published on GitHub, anyone can make one as long as they have the motivation.
Why I decided to make stack-chan
In the self-introduction part, I mentioned that I went to Maker Faire Shenzhen 2023. At that Maker Faire, stack-chans collected by the stack-chan community, led by Shishikawa-san, were on display. Seeing this exhibition in person when I visited Maker Faire Shenzhen was what motivated me to want to build one myself.

stack-chan exhibited at Maker Faire Shenzhen 2023
What is NECO MIMI stack-chan?
NECO MIMI stack-chan is a cat-ear shaped board for stack-chan that I created based on the data published on GitHub. It features a circuit for driving serial servos and 14 NeoPixels in the cat-ear section. The board is designed as a module that can be stacked on an M5Stack.
While it's fun enough just building a stack-chan using the data available on GitHub, I wanted to create my own unique stack-chan if I was going to make one anyway. And if I was going to make it, I wanted to add a "Kawaii!" (cute) element. When I thought about what a "Kawaii!" element would be, I figured it had to be cat ears. Cat ears make anything cute, so I thought if I put them on the already cute stack-chan, it would become even cuter! With that simple idea and a burst of momentum, I started the production.
Overview
Here is the NECO MIMI stack-chan I made. What I created this time is a cat-ear shaped board and a module part to house it. The module is designed to be stackable on the M5Stack.

Block Diagram
This is the block diagram for the NECO MIMI board. For the serial servo circuit, I used the data published on GitHub as-is. What I added were the 14 NeoPixels mounted in the cat-ear section and an I2S microphone. While the M5Stack Core2 originally comes with a PDM microphone, removing the bottom panel to build stack-chan also removes the small board where the PDM microphone is located. Therefore, I made it possible to attach an I2S microphone to the NECO MIMI board for voice input for AI stack-chan.

Appearance
The external appearance of the NECO MIMI stack-chan looks like this. It's cute from every angle!

Here is a demonstration of it in action. The color and pattern of the NeoPixels in the cat-ear section change according to stack-chan's emotions.
More Details
From here, I'll explain the NECO MIMI stack-chan in a bit more detail.
NeoPixel
The cat-ear part of the NECO MIMI stack-chan is equipped with 7 NeoPixels on each side, for a total of 14. For the circuit and components of these NeoPixels, I referred to the circuit and components of the NECO UNIT released by M5Stack in 2023.
The two points I referred to from the NECO UNIT are:
- NeoPixel module WS2812C-2020
- Bypass capacitors

WS2812C-2020
WS2812C-2020 is an RGB LED module with a built-in microcontroller manufactured by Worldsemi. The WS2812B commonly used in NeoPixel strips is a 5mm square module, but the WS2812C-2020 is a 2mm square module, making it a much smaller package. Since space is limited in the cat ears of the NECO MIMI board, I used this WS2812C-2020 to fit as many LEDs as possible.
Bypass Capacitors
Since the WS2812C-2020 is an RGB LED module with a built-in microcontroller, it's necessary to place bypass capacitors near the modules for noise suppression. I also referred to the NECO UNIT for the placement of these bypass capacitors. Generally, one bypass capacitor is placed for each IC, but space was limited in the cat-ear section of the NECO MIMI board, and I wanted to reduce the number of components as much as possible. Looking at the NECO UNIT schematic, I noticed that for 35 NeoPixels, only 17 bypass capacitors were used—roughly one capacitor for every two NeoPixels. Referring to this, I used 8 bypass capacitors for the 14 NeoPixels on the NECO MIMI board. So far, the circuit is working fine.
Module Production
The NECO MIMI board was created as a module that can be stacked on an M5Stack. The reason I chose the module form factor is simply because "it's an M5Stack." A core concept of M5Stack is the ability to expand by stacking, and I wanted to inherit this defining feature.
Another reason was that while I had considered other methods, such as those shown below, I ultimately wanted the NECO MIMI board to be used widely by everyone. By making it a module that can be sandwiched between M5Stack parts, it can be used while maintaining the existing body.

Left: Attached to the head, Right: Modifying the existing body
I measured the dimensions of an M5Stack ExtPort MODULE I had on hand, designed it in Fusion, and had it printed using JLC's 3D printing service.

Parts printed by JLC
I realized after printing that M5Stack's mechanical dimensions and other data are available on GitHub, so there was no need to measure them manually. If you're looking to create your own module, please use these open data sources to save time.
Challenges
Developing the module was the most difficult part of creating the NECO MIMI board. Typical M5Stack modules are designed so that the PCB fits inside the main body. If I had followed that design, I would have had to cut into the M5Stack body to let the cat ears stick out. Since cutting the body was out of the question, I decided to lower the NECO MIMI board by 1mm toward the module side. However, lowering it by 1mm introduced a new problem: the M-BUS pin header could no longer reach the M-BUS pin socket on the M5Stack body (more accurately, it barely reached, making poor contact very likely).

Trying to stick the cat ears out would require cutting the M5Stack body

I shifted the board position toward the module to let the ears stick out from the module side, but...
To solve this, I searched Taobao for a pin header with the optimal height. Taobao really has everything; I managed to find a pin header with an unusual height of 4.8mm that was perfect for this NECO MIMI board.

I2S Microphone
As I mentioned at the beginning, removing the bottom panel of the M5Stack Core2 also removes the small board where the PDM microphone is located. Therefore, I made it possible to attach an I2S microphone to the NECO MIMI board side for voice input with AI stack-chan. However, after thinking it through, I realized that if I had used a PDM microphone instead and used the same pin assignment as the M5Stack Core2's PDM microphone, I could have supported the microphone without changing any source code. Therefore, I plan to change this I2S microphone to a PDM microphone.
The reason I made the microphone attachable to the NECO MIMI board is that I wanted to use AI stack-chan, but I also wanted to make stack-chan dance to ambient sounds. I experimentally attached an I2S microphone to the BUS MODULE and made the NeoPixels light up according to external sounds. If I can also make the servo motors move with the sound, it seems like stack-chan will be able to dance.
Also, I found an interesting way to attach a microphone, so I'll share it. It's a flexible PCB created by @washishi that allows the small PDM microphone/IMU board removed from the M5Stack Core2 to be attached to the stack-chan board. This is great because it makes good use of the small board removed from the M5Stack Core2.
Firmware
Finally, let's talk about the firmware for NECO MIMI stack-chan. The firmware is based on @robo8080's AI stack-chan 2 RT version, with added code to support the NeoPixel part. The reason I used the RT version is that it allows the serial servos to move without changing the source code.
I added processing to change the color and pattern of the NeoPixels according to emotions for NECO MIMI stack-chan.
NeoPixel processing is created as a separate task
NeoPixel processing has its own dedicated loop and is handled in a function separate from the loop function. Since various processes are carried out in the loop function, writing NeoPixel processing there would make it difficult to control the timing of the NeoPixel lighting. By making it a separate task, it can focus solely on NeoPixel control.
The following code calls the ESP32 API xTaskCreatePinnedToCore to create a function called neo_loop as a separate task.
void setup()
{
…
#ifdef NECOMIMI
FastLED.addLeds<NEOPIXEL, NEO_PIN_DIN>(neco_leds, NEO_NUM_LEDS);
FastLED.setBrightness(60);
xTaskCreatePinnedToCore(neo_loop, "neo_loop", 40000, NULL, 1, &neo_thp[1], 0);
#endif
}
Acquiring emotions from M5Avatar and changing NeoPixel colors and patterns
The following code is the neo_loop function for controlling the NeoPixels on the NECO MIMI board. It periodically gets stack-chan's current emotion from the M5Avatar library and controls the NeoPixel colors and patterns accordingly.
Calling avatar.getExpression() allows you to get stack-chan's current emotion, so it calls functions to control NeoPixel colors and patterns based on this value.
// Process NeoPixels on NECO MIMI board.
void neo_loop(void *args){
Expression exp; // expression from m5avatar
while(1){
exp = avatar.getExpression();
Serial.printf("[NECO]exp:%d\n",exp);
switch(exp){
case Expression::Happy: neo_fade(208); break;
case Expression::Neutral: neo_random(CRGB::Green,5); break;
case Expression::Doubt: neo_move_fade(CRGB::Yellow); break;
case Expression::Angry: neo_fade(0); break;
case Expression::Sad: neo_fade(142); break;
case Expression::Sleepy: neo_fade(64); break;
default: neo_blink(CRGB::Blue);
}
delay(1);
}
}
Future Aspirations
NECO MIMI stack-chan is not yet finished, and I'd like to share what I'm planning to do next.
- Refine the board (PWM servo support, PDM mic)
- Make it dance to ambient sounds
- Sell it on Switch Science
First, the current board is basically a collection of things I wanted to try, and it wasn't designed with other users in mind. By adding pins for PWM servos and making it compatible with PDM microphones, I hope to make it more versatile so that a wider range of people can use it.
Second, as mentioned in the I2S microphone section, I ultimately want it to capture external sounds and dance along to them.
Third, since I want many people to use the NECO MIMI board I created, I’d love to make it available for sale through Switch Science. I'm thinking of making it attachable to the RT version/official M5 version once they are released.
Summary
I’ve reaffirmed that stack-chan is cute no matter what!
On a more serious note, here are some things I realized through creating my own original stack-chan:
- Everything needed is open-source and can be built immediately.
- I'm grateful for manufacturing services like JLC.
- stack-chan still holds immense potential.
All the data required to build stack-chan is public on GitHub, meaning anyone can make one as long as they have the motivation—which is a wonderful thing. Also, manufacturing services like JLC are empowering individual-level making. While 3D printers are becoming more common, not everyone has one, so the widespread availability of low-cost manufacturing services creates a very fortunate environment.
Lastly, I feel that stack-chan still has a lot of potential. Many people are already creating their own unique stack-chans and sharing them on X and elsewhere. If my stack-chan became even cuter just by adding cat ears, there is a high possibility that many more "Kawaii!" stack-chans will appear in the future. With the official M5 stack-chan also on the way, the project is bound to keep evolving. I'm really looking forward to it!
If you're interested in stack-chan
If this article has sparked even a bit of interest in stack-chan, I definitely recommend trying out M5Avatar. There's no need to buy servo motors right away—just try uploading a few lines of sample code from the M5Avatar library to your M5Stack. M5Avatar is a library for displaying stack-chan's face on the LCD. Using this library alone, you can easily turn your M5Stack into a stack-chan.
@robo8080's AI stack-chan can also be easily flashed via M5Burner, though it requires an SD card and API keys for ChatGPT and VOICEVOX, which takes a bit more effort. As a first step, I recommend M5Avatar since it doesn't require extra preparation. I bet you'll be ordering servo motors the day after you try M5Avatar.
I hope you all try making your own original stack-chan!
See you later!
Discussion