Portable ARM Device

Portable STM32F103 Hardware platform for password/bitcoin keeper, oscilloscope, data logger, game etc.

Similar projects worth following
Most of the projects I have in mind involve a microcontroller, LCD, some buttons, a power source, some I/O and optional mass storage or USB. These $2 MP3 player comes with most of these features, I'll need to replace the PCB with a STM32F103.

While shopping for parts for my next project, I came across these $2 MP3 players from China. They are about 2AA batteries in size. It has all the I/O I'll ever need in a project.  It even comes in an inconspicuous injection molded case making easy to hide your gadget/key/bitcoin keeper in plain sight.

There is already a project: China cheap MP3 player hack . In my case, I would upgrade from the STM32F030 which is actually usual favorite to STM32F103 with native USB interface, dual ADC, dual SPI and a lot more memory.

STM32F103 is used in Blue Pill breakout board and can be found for around $2 from China with some minor differences.


  • STM32F103 64kB FLASH, 20kB RAM, up to 72MHz
  • Mini-USB: USB 1.1 device, charging
  • 128x64 LCD
  • Micro SD slot for SD/SDHC.
  • 3.5mm Stereo - multiple I/O functions are available
    e.g. 3.3V TTL serial, ADC, PWM, I2C and serial bootstrap.
  • 5 push buttons, On/Off switch
  • Li-ion battery - not sure about capacity


Low power design

The device is powered from internal Li-ion battery.  LTC4054 is used for charging the battery from USB. LDO is used to power the main circuits.  The RTC and backup RAM location are backup from the battery. A pair of silicon diodes is used to drop the battery voltage down as they consume no quiescent current vs a LDO.

From Elm-Chan: How to Use MMC/SDC

MicroSD can draw a lot of current and introduce a droop during hot-insertion.  This can reset the microcontroller or affect results of ADC. The XC6206P332MR and other ultra low quiescent current LDO make compromises for low bandwidth/transient response. It has a slow recovery time for a sudden load.  Previously I have seen much less droop using a switch mode supply with a fast transient response.

While you can pile lot of passives to undo the manufacturer's design decision on $0.04 parts, it is cheaper and takes much less space to simply use 2 separate supplies for the microcontroller and the MicroSD.

I wired 4 GPIO in parallel (saving one MOSFET) to control the power to the LCD backlight (probably around 20mA).


A diode clamp is used for input protection.  Two series resistors are used as current limit and the signals are clamped a diode drop above the zener voltage.  The zener is pre-biased by R4 to reduce the load on the inputs below the threshold.  C2 reduce the AC impedance.

The protection circuit can be altered for clamping to 3.3V rail by replacing D1, D2 with use schottky diodes, D3 depopulated and relacing R4 with 0R.

Libraries that needed to be ported/written

Reference bookmarks

Open source password/bitcoin keeper

Oscilloscope based on the STM32F103 

Read more »

  • Multifunction I/O and buttons

    K.C. Lee12/18/2017 at 17:38 0 comments

    I thought about adding an analog MUX to select the signals as digital I/O pins do not like the intermediate voltages between '0' and '1'.  

    It turns out that there is a way of skipping the MUX in the STM32F10x family. There is an On/Off control that can be used to shutdown the "TTL Schmitt trigger" in the "Input Analog" mode (CNF[1:0]= "00", Mode[1:0]="00").  I have not yet confirmed if it is implemented in all of the GPIO pins or that it is specific to the ones with ADC.

    I have tied 3 pairs of GPIO together and connect them to the 3.5mm stereo connector giving access to GPIO, UART, Timer function, ADC and I2C.

    • Tip: PA10 (UART0 RXD/TIM1 CH3), PB0(ADC IN8/TIM3 CH3), PB6 (I2C SCI1)
    • Ring: PA9 (UART0 TXD/TIM1 CH2), PB1(ADC IN9/TIM3_CH4), PB7 (I2C SDA)

    I am hoping to implement diode clamps on the I/O for some protection.  The Ring/Tip pin assignments are consistent with FDTI 3.3V serial cable.

    Bootstrap key

     UART0 is used in the ROM bootstrap mode.  My intention is to hold down one of the keys (e.g. "Down") key during power on for entering the bootstrap mode.

    Battery backup

     I have hooked up the battery backup supply to the Li-ion battery directly.  This allows for 84 bytes of battery backed RAM as well as a Real Time Clock.

  • Initial PCB placement

    K.C. Lee12/16/2017 at 19:15 2 comments

    I took the PCB template from China cheap MP3 player hack, my STM32F103 breakout board and added a few parts. This is a preliminary placement.  I have not added the support circuit for the LCD or the random generator, but they should fit in the space.

    I can't do much until the MP3 players arrives in the new year.  I'll try to do my own measurement of the MP3 component placements on the PCB and confirm the footprints. I have no idea what the keep out areas and height restrictions are.  I like to get my PCB done right the first time.

    That could take a couple of weeks to a couple of months depending on the mood of the Canada Post and Canada Custom.  My recent packages seem to arrive very quickly.  May be the temp workers fired for the holiday season ignore Canada Post's rule to intentionally slow down packages from China.

  • Ordering parts

    K.C. Lee12/15/2017 at 15:45 0 comments

    I took the first step to order a couple of these.  I'll might have to wait quite a bit after the new year.  Just hope they forget about those pesky Li-ion batteries.

    There seems to be a slightly different version of these with a yellow/blue backlit LCD.  I order one too. 

    Ordered LTC4054 Li-ion charger from Aliexpress as I don't see it in China cheap MP3 player hack .  I could be wrong, but I can use it for some other projects.

View all 3 project logs

Enjoy this project?



davedarko wrote 12/15/2017 at 18:09 point

I was about to point to a link but then saw it was the first in your reference :D Looking forward to see how this turns out, the other one was quite good :)

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates