🌈 ESP32-S3 Rainbow: ZX Spectrum Emulator Board! Get it on Crowd Supply →
View All Posts
read
Want to keep up to date with the latest posts and videos? Subscribe to the newsletter
HELP SUPPORT MY WORK: If you're feeling flush then please stop by Patreon Or you can make a one off donation via ko-fi
#1-BIT AUDIO #CH32V003 #COIN CELL #EMBEDDED #GITHUB #LOW-POWER #MCU #MIDI #PCB #PIEZO BUZZER #POWER OPTIMIZATION #RISC-V #SOLDER PASTE #WCH #WLINK

These super cheap (around $0.10 in bulk) RISC-V MCUs from WCH have been pretty popular recently. I recently had a need for a small, low power MCU and my usual choice of an Espressif module would have just been too power hungry - and also too large.

I’m using the smallest version of the CH32V003 - the CH32V003J4M6 - this is an 8 pin IC. It’s definitely a massive step down from what we normally have to play with. It’s got 16K of flash and only 2K of RAM. The CPU is pretty reasonable though - it’s RISC-V running at 48MHz - so not too shabby.

CH32V003J4M6 Specifications

There are a lot of online guides to programming this chip - so I’m not going to do a deep technical dive. Here’s a good starting point as is this seies.

You don’t need very much to bring this chip up. It’s got its own built in voltage regulator - so you can feed it anything from 2.7~5.5V and it just needs a 100nF decoupling capacitor.

For our project, I took inspiration from this project - which is a coin cell powered mini game console. This was a good starting point as it included a buzzer. Here’s my schematic:

Schematic

And the final PCB layout:

PCB Layout

Despite me adding pin headers, we still ended up with a very small board: 16.3mm X 11.7mm.

I got the boards made up by PCBWay. I skipped ordering a stencil as there are very few components on the board, so not too hard to solder up by hand.

Soldered Up

But I had forgotten how painful soldering under the microscope was.

Soldering

Then I remembered - I have a PCB printing machine that also dispenses solder paste!

Solder paste dispensing

I was pretty amazed at how well this came out, especially considering the solder paste I used is almost three years past its best-before date!

Each board consists of:

  • One CH32V003 MCU
  • A small piezo buzzer driven by a transistor

My plan is/was to power these boards from a CR2032 coin cell battery. In standby mode the power consumption is very good - around 7-8µA.

Standby Mode Current Draw

I did find a bit of a problem with standby mode - with the device in standby, I couldn’t program it anymore - which is a bit of a pain when you are trying to develop. And even worse if your wakeup is not working. For a while, I thought I’d bricked it completely.

Fortunately there is a way to get back to a good known state. The wlink utility can be used to erase the flash even in standby mode.

$ ./wlink erase --method power-off --chip CH32V003

When playing music, the power consumption is a different story. When the MCU is in active mode, it’s a very reasonable 3.3mA. But as soon as we start playing audio, we spike up to 130mA.

Current spike during playback

I am using a very low mark-space ratio on my audio output (the buzzer is only on for a small fraction of the time), so we do only average 13-14mA, but the 130mA peaks are too much for a coin cell - as soon as we play audio, the device browns out.

My backup plan was to use one of these tiny Lithium cells. I did have to modify one of my charger boards for this cell - I don’t think pumping 1A into an 80mAh cell would end well…

Tiny 80mAh lithium cell

With the LiPo, we get more than enough juice to power the board and play the music without issues.

But I really wanted to get this working with a coin cell. I modified one of the boards to use a much higher base resistor on the transistor - bumping this up to 10K.

Tiny 80mAh lithium cell

With this, we got some much more reasonable results.

  • Peak current: 56 milliamps (down from 130mA!)
  • Average current: Just over 7 milliamps (down from 13-14mA)

Much lower current requirements

This version works beautifully with the coin cell, plays all the way through, and is still plenty loud enough for my purposes.

My actual code for playing back the audio is very simple and naive. I’m just bit-banging the GPIO pin with the note frequency.

It doesn’t sound too bad for one of these tiny buzzers - it’s actually pretty impressive!

To actually get the audio data I put together a simple tool (well, my AI chum put it together…). This lets you export a track from a midi file in a simple format that the MCU can use.

MIDI file conversion diagram

This also contains a very simple 1-bit Sound FX generator which is quite fun.

All the code for the project is on GitHub.

And you can listen to the results here:

#1-BIT AUDIO #CH32V003 #COIN CELL #EMBEDDED #GITHUB #LOW-POWER #MCU #MIDI #PCB #PIEZO BUZZER #POWER OPTIMIZATION #RISC-V #SOLDER PASTE #WCH #WLINK

Related Posts

-
High voltage coin cell - I blew up the original PCB on a bistable cholesteric display, so I built a coin-cell Joule thief to crank out 27V and bring it back to life. A simple two-inductor setup with a 27V Zener does the trick—about 10 mA while the button’s held. Then I got fancy with a regulated version (just one extra transistor) that tops the cap to 27V and basically idles—average draw lands around 1.53 mA. It’s neat, tiny, and perfect for this low-current reset job. Full build and measurements are in the video.
Brain Surgery - I cracked open a cheap Halloween toy, found the super-simple LED + LR41 setup with the arm-as-switch trick, and swapped the ‘empty head’ for my own CH32V003 + buzzer PCB. Now it screams as well as shines—powered by a small lithium cell for extra volume because if you’re going to be annoying, do it properly. New schematic, new brains, same spooky vibes.
I made a 10 Cent MCU Talk - I taught a 10¢ CH32V003 RISC‑V MCU to talk. By bit-banging PWM as a DAC and using a tiny 2‑bit ADPCM decoder, I squeezed ~6–7 seconds of recognizable audio into 16 KB of flash. Then I went full retro with LPC speech synthesis (Think: Speak & Spell) using the Talkie library and a small web tool I built to generate LPC data—so this little 8‑pin chip can now play samples and ‘speak’ lots of words with only a few kilobytes.
Worlds smallest USB-C Li-Ion charger - I stumbled upon these incredibly tiny USB-C Li-ion chargers on AliExpress and couldn't resist checking them out! These minuscule PCBs, just 10mm x 6mm, feature the LP4054 (or TP4054) linear battery charger. With a 1.65K programming resistor, they offer a charging current of around 600mA. Keep in mind, they can get pretty toasty, reaching up to 92-93C! For fun, I tried recreating them in KiCad and found it surprisingly easy.

Related Videos

10¢ MCU Music Hack - CH32V003 - I spun some tiny WCH boards at PCBWay around an 8‑pin MCU (48 MHz, 16k flash, 2k RAM) to beep tunes off a coin cell. I tried hand-soldering, then used my paste-dispensing PCB printer—expired paste still worked great. Standby sips under 8 µA, but it locks out programming; a WLink flash wipe rescued me. Wake draws ~3.3 mA, and audio peaks hit ~130 mA (~13–14 mA average), which browned out the coin cell. A tiny 80 mAh LiPo with a TP4056 (modded to ~100 mA) proved the design, then swapping the buzzer’s base resistor from 1k to 10k tamed it to ~56 mA peak and just over 7 mA average—coin cell friendly and still loud. I’m bit-banging audio for now (PWM/timers later). I also made a quick MIDI-to-note tool and a one-bit SFX generator. These boards are heading into my next project—stay tuned.
10¢ Talking Chip - CH32V003 Speaks! - I got a 10‑cent MCU literally talking. With just 16K of flash and 2K of RAM, I used PWM and a tiny transistor amp to play 6+ seconds of audio at 8 kHz by compressing it with super‑simple 2‑bit ADPCM—4:1 compression and a decoder in under 2 KB. I built a handy WAV‑to‑2‑bit‑ADPCM tool to make it easy. For longer phrases, I switched to the Talkie library (TI LPC speech synthesis from the TMS5220/TMS5100 era—think Speak & Spell and classic arcades), and I even made a web tool and player for generating and previewing LPC data. It’s wild what you can squeeze out of a 10‑cent MCU. Also, PCBWay did the boards—link below.
10¢ MCU Brain Surgery - CH32V003 - I crack open a punchy little toy, show how the original just squishes two contacts to light the eye LEDs off a pair of LR41s, then perform some brain surgery to cram in a tiny lithium cell and my own board that triggers lights—and an incredibly annoying tune—on each punch. It sips about 7 µA in deep sleep and wakes via a yellow trigger wire, but the soldering was fiddly and full of swearing. Tape it up, cram it back in the head, and yes, it works a treat… maybe too well, because the beeping is driving me mad.
High Voltage Coin Cell - 27V Joule Thief - How much voltage can we squeeze out of a CR2025? Turns out… plenty! I built a little Joule-thief-style boost circuit with two 1 mH inductors, an NPN, a Schottky, a 27 V zener clamp, and a storage cap to zap my LCD pad clean at around 27 V. I profiled it with a Nordic power monitor: about 11 mA during the boost and ~9.28 mC per click—so tens of thousands of presses from one coin cell. Then I added a second transistor tied to the zener to auto-limit the drive, dropping hold current to about 1.5 mA—huge win. Scoped it (~38.7 kHz, base swinging to nearly -6 V), laid out a PCB, 1:1 print check for fit, and sent the gerbers off to PCBWay.
Dodgy circuit could have caused a fire! - So, I got this red mini handheld game thing from AliExpress and it died pretty quickly. After a bit of tinkering, I found that it still draws current but isn't turning on because of a dead battery and a burnt voltage regulator. I removed the faulty components and injected 3.3 volts directly into the system, and guess what? The screen lights up and it works, but there's no sound. Despite the hiccup with my microscope, which stopped recording some interesting bits, you get the picture. It's partly revived but not quite there yet. Big shout out to PCB way who help us out with PCBs!
HELP SUPPORT MY WORK: If you're feeling flush then please stop by Patreon Or you can make a one off donation via ko-fi
Want to keep up to date with the latest posts and videos? Subscribe to the newsletter
Blog Logo

Chris Greening


Published

> Image

atomic14

A collection of slightly mad projects, instructive/educational videos, and generally interesting stuff. Building projects around the Arduino and ESP32 platforms - we'll be exploring AI, Computer Vision, Audio, 3D Printing - it may get a bit eclectic...

View All Posts