Published on April 24, 2025 · Reading time: 8 minutes
If you don’t know yet what EclairM0 is, make sure to check out the project’s description.
Thank you for considering building EclairM0.
Read and understand the entire guide first! I do not take the responsibility for any problems or damage to health or property, as stated by the project's license.
BATTERY SAFETY WARNING: This device contains a rechargeable lithium polymer battery. Do not drop, puncture, throw, reshape, or overheat the battery. Do not charge unattended. Do not keep fully charged or discharged for extended periods of time. Do not short-circuit or perform any modifications.
Make sure you have 3–4 hours of spare time and all the necessary equipment (including any safety measures):
- multimeter with basic features (resistance, capacitance, diode polarity)
- soldering iron with a fine tip
- hot air gun
- solder paste
- solder wire with flux
- solder wick with flux (for rework)
- tweezers
- helping hand
- magnifying glass
- PCB (4-layer) with matching stencils
- all necessary electronic components (see “Bill of materials”)
- Raspberry Pi 4 or older and microSD card (see “Flashing the bootloader”)
Schematic and PCB design as a KiCad project, a 3D-printable enclosure as OpenSCAD files, and the firmware source code are all in the GitHub repository.
Let’s set the expectations first: this is not a task for total newcomers. You will need to study device’s circuitry a little (to figure out the correct location and orientation for all components) and debug potential issues using a multimeter. You should also have enough experience with drag soldering and SMD reflow soldering.
Table of Contents
Bill of materials
I’ve tried to remove some characters from part numbers if these describe only the packaging information, serial numbers, or other minor differences. If in doubt, please look for “ordering information” in a datasheet.
Usually, it’s cheaper to buy parts for more than one board, and this also gets you some spares if something goes wrong.
(This table can be scrolled horizontally on mobile.)
Qty | Part | Part No.(s) | Manufacturer | Package/Size |
---|---|---|---|---|
1 | Microcontroller | ATSAMD21E18x-A | MICROCHIP | TQFP32 |
1 | Charging controller | MCP73831-2 | MICROCHIP | SOT23-5 |
1 | 3.3 V LDO voltage regulator | AP2112K-3.3 | DIODES INC | SOT23-5 |
1 | SPI display w/ SSD1306 driver | 012832DYPP3N (yellow) 012832DWPP3N (white) |
WINSTAR | 15-pin FFC, 0.65 mm pitch |
2 | Schottky diode | MBR120(V)LSF MBR130(V)LSF |
ONSEMI | SOD123F |
1 | USB‑C receptacle | USB4105-xx-x-060 | GCT | - |
14 | Tactile switch | EVQQ2B03 (50 gf) EVQQ2F03 (100 gf) |
PANASONIC | - |
1 | Slide switch | CUS-12TB | NIDEC COPAL | - |
4 | 1 µF MLCC X7R capacitor | - | - | SMD0805 |
6 | 4.7 µF MLCC X7R capacitor | - | - | SMD0805 |
2 | 5.1 kΩ ±1% resistor | - | - | SMD0805 |
3 | 33 kΩ ±1% resistor | - | - | SMD0805 |
1 | 560 kΩ resistor | - | - | SMD0805 |
1 | Li‑Po battery | - | - | 25×15×3 mm |
Relocating the battery protection circuit (advanced)
I am making these instructions available for people who know how Li‑Po batteries are built, understand the risks of making any modifications to the battery pack, and can follow the steps safely to fit the device in its enclosure.
Two additional 1 kΩ resistors and an extra 1 µF capacitor are required.
You do not need to follow these steps to make a version of the device that does not use a battery, or if the battery’s total thickness is 3.2 mm at most.
Li‑Po batteries have a small protection circuit module (PCM) located under the yellow tape. In the case of a 301525 battery, there are two SOT23-6 packages (protection chip itself and double MOSFET with common drain) and passives.

The 8205A
is the transistor package, so the G3US
(?) must be the main safety
chip. Using a multimeter and according to the device’s schematic, I can confirm
that:
- top-left pin of
G3US
is connected to the cell’s negative terminal, so it must be pin 6 - top-center pin of
G3US
is connected to both the capacitor and resistor, so it must be pin 5 - since it’s SOT23-6 package, the other pins are 4, 3, 2, 1 clockwise
- pins 1 and 3 of
G3US
must be connected directly to pins 6 and 4 of8205A
, respectively - it means the bottom left pin of
8205A
is no. 1, connected to the cell’s negative terminal - once again, it’s SOT23-6 package, so we know where the other pins are
Use a permanent marker to mark where pin 1 is on both chips, then remove these from the original PCB and use when assembling the device.

If everything works as expected, when installing the battery you will need to put some double-sided tape on the bottom, carefully bend its terminals near the end to prevent the potential damage, and solder the cell onto the PCB using a regular soldering iron. In this scenario, NC is the battery negative terminal, “+” is the positive one, and the “-” pad goes unused. You may also need to temporarily connect the device to PC in order to turn on the battery protection circuit.
One of the strips is made of aluminum, so you’ll need a lot of flux to make a reliable joint, but do this very fast (2–3 s at 300°C is more than enough) and do not overheat the battery!
PCB assembly
Spread some solder paste on the bottom of the PCB, using stencil as a helper. If it does not look okay, use a paper towel to wipe it off the board and try again.
Photos were taken when assembling an older PCB revision, but the instructions are still up-to-date.

Place components according to the schematic, heat the board up to 250—270°C until the solder paste melts and becomes shiny, then continue for 15 more seconds or so. Do not install OLED display and battery yet. Do not place Q1, U3, C4, R3 and R4 if using the battery with a built-in protection circuit. Make sure all parts are rotated correctly, in particular:
- SAMD21 is placed in such a way that the “Atmel” logo is rotated 90° clockwise, towards the battery
- both Schottky diodes are rotated in such a way that the cathode indicator is pointing downwards
- additional battery protection chips, if used, must match the schematic, as reverse-engineered above
If there are any unwanted solder bridges, try using solder wick to remove those.

Let the board cool down, then connect it to PC using a USB‑C cable. If you get the “USB device not recognized” notification, ignore it for now. Check with a multimeter that there is approximately 5.0 V on a test point next to the “D” pad, and 3.3 V next to the “C” pad.

Flip the board and repeat the reflow soldering process for buttons on the top. The components on the bottom will be held in place with the surface tension. Do not touch any plastic parts before they fully cool down.

At last, install the OLED with a regular soldering iron. Make sure there is a connection between each pin on the flex cable and the respective PCB pad. Remember to use double-sided tape later to lock the screen in place.
I’ve cheated a little and re-used the microcontroller from another prototype board, so I can already see that everything works just fine.

Flashing the bootloader
The UF2 bootloader is required for uploading new firmware without using a SAMD21 hardware debugger later on.
You can use a Raspberry Pi with OpenOCD software installed as a hardware debugger. Tested with Pi Zero W and Pi 4, it will not work with Pi 5 which uses the RP1 coprocessor for GPIO. Use Raspberry Pi Imager to prepare an SD card with Wi‑Fi and SSH preconfigured.

Connect the board to Pi (only data, clock and ground signals are required) and to PC. Make sure the USB‑C cable supports data transfer.

Use the SSH client to access Pi. The command-line SSH client is preinstalled on all modern operating systems, including Windows 10 and later.
In the remote session, run the following commands one by one to install OpenOCD,
clone the code repository, and flash the bootloader. A new TRINKETBOOT
drive
should appear. (EclairM0 uses the bootloader of Adafruit Trinket M0.)
sudo apt update
sudo apt install git openocd wget -y
git clone https://github.com/mateusznowakdev/eclair
cd eclair/bootloader
wget https://github.com/adafruit/uf2-samdx1/releases/download/v3.16.0/bootloader-trinket_m0-v3.16.0.bin
sudo openocd

Installing the firmware
The notes demo app, written in TinyGo and shown on the project description page, can be downloaded from Releases tab on GitHub or compiled from source (tested with TinyGo 0.37):
git clone https://github.com/mateusznowakdev/eclair
cd eclair/firmware
tinygo build -target eclair.json -o firmware.uf2
Copy the .uf2 file to the TRINKETBOOT
drive, and the device will reboot
automatically.
If TRINKETBOOT
is not present, unplug the board from PC temporarily and
try again. Still no luck? Try entering bootloader’s mass storage mode manually
by shorting “R” and “G” pads twice in a short succession, using a wire or a pair
of tweezers.
Now you can install the battery (make sure the polarity is correct), and you’re good to go! 🍪
Check out other blog posts:
-
EclairM0, the pocket notepad
2025-04-24 · 14 min read
Tiny device with great performance, long battery life, open hardware design and many additional use cases. Notes app written in TinyGo.
-
Tracking libadwaita adoption in Fedora (updated for F42)
2025-04-15 · 2 min read
The complete list of software preinstalled in Fedora, including apps using the libadwaita library.
-
Making framebuf text 10x faster in CircuitPython
2024-12-23 · 4 min read
Finding a cause of slow text rendering and optimizing it for monochrome LCD and OLED displays.