Creating a Retro Mini Cassette Player with Raspberry Pi PICO

0 572 Medium

1. Introduction

Hello everyone, I'm jd3096 and I started learning programming at the age of thirty. As a self-taught MicroPython learner for two and a half years, this is my first attempt to make a project by the Raspberry Pi PICO. Thank you for your supporting. I enjoy trying projects that others haven't done.

 

Project first published on https://mc.dfrobot.com.cn/thread-317472-1-1.html
Project link: https://github.com/jd3096-mpy/MPY-CASSETTE-PLAYER

 

First, let's take a look at this Cassette Player.

 

Original Video Link: https://www.bilibili.com/video/BV1694y1c7yN/?spm_id_from=888.80997.embed_other.whitelist&t=1&vd_source=b82fbdf82867d54f5830b6e2eafff951

 

 

2. Story

In my childhood, my elder brother had a Sony Walkman cassette player that I always admired. He was my musical inspiration, exposing me to many excellent musical works. Although I eventually had my own MP3 player, and MP3 players were gradually phased out, and everyone started using smartphones to listen to music, the nostalgia for cassette players has always stayed with me. The precise mechanical design and cool appearance of the Walkman cassette players left a deep impression on me. Now, I want to try to make one myself!

 

用树莓派PICO做一个复古迷你磁带播放器图3
Attempt to simulate the appearance and logic of the cassette player from that era

 

3. Hardware

Regarding hardware selection for the project, the MCU naturally had to meet the requirements of this event, so I chose the Raspberry Pi PICO. Additionally, I needed a color screen to show the rotating transparent cassette window effect. Due to the performance limitations of MicroPython, I required a music decoding chip, and I ultimately chose the VS1053 for its powerful features and available MicroPython libraries. Other hardware components include 4 buttons, a TF card slot, and for graceful power control, AXP's power management chip is used here.

Once the hardware was selected, I initially built a prototype using modules for testing and implemented the core framework of the project, simulating the UI for cassette play effects.

 

用树莓派PICO做一个复古迷你磁带播放器图5
Prototype built using development boards and modules—somewhat crude in appearance but validated basic functionality requirements

 

4. PCB Production

For PCB design, I enlisted the help of my friend, eggfly, to create a compact and elegant appearance. This gives the project a nice look, and after the event, it will be shared on the JLCPCB Open Source Square.

 

用树莓派PICO做一个复古迷你磁带播放器图6
Eggfly's board designs always go to my heart, with a 4-layer board and a compact layout

 

5. Core Ideas of Code Writing

With the hardware in place, let's focus on the key software challenges:
1. As a project by a Chinese developer, it naturally needed to support Chinese. The project incorporates a full font library with 6500 commonly used Chinese characters, using the fb enhancement library by wangshujun: https://github.com/wangshujun-tj/mpy-Framebuf-boost
2. To achieve smooth cassette rotation effects, I use a 240x135 ST7789 color screen. Directly driving it with Python would be inefficient, so I utilized the fastc driver by russhughes: https://github.com/russhughes/st7789_mpy
3. Support for the VS1053 driver, using the library by peterhinch: https://github.com/peterhinch/micropython-vs1053. Since this library only supports basic playback methods, I consulted the VS1053 manual and added more advanced methods.
4. Make a good UI. I used Photoshop to meticulously extract each element, a somewhat laborious task.
5. Attempting to replicate the operational logic of a cassette player, incorporating functions like fast forward and rewind. Since the original library lacked these features, I had to create them myself. I did thoroughly research in MP3 encoding format and VS1053. The cassette cover uses the album cover from MP3 ID3 information, with some special processing. When playing MP3s, if there is cover information, it will be displayed on the screen, just like the real thing.
6. Integration of all components—thinking it would be simple, but creating a complete system required some effort. Many of the methods mentioned above required modifications to the MicroPython source code, so the final firmware was self-compiled, incorporating some advanced libraries. The source code, documentation, shell files, and utility script libraries are uploaded to GitHub: https://github.com/jd3096-mpy/MPY-CASSETTE-PLAYER
7. A complete project naturally needs a casing. This year, I started learning SolidWorks, and the result is at a beginner's level. 
8. Finally, a JLCPCB panel. I don't understand design much, but slapping on a panel greatly improve the appearance level.

 

用树莓派PICO做一个复古迷你磁带播放器图4
JLCPCB panel, self-designed to be simple, attractive, and incorporating elements of a cassette player

 

6. Production and Assembly

The exciting moment has arrived—putting everything together. The following tools and platforms were used:
1. For PCB, JLCPCB SMT was chosen for seamless integration. The VS1053 chip used here was purchased from the official source, which is relatively expensive. There is still significant room for price reduction if you take it by mail. Currently making 10 SMTs, the average price per unit is around 100 yuan.
2. For the casing, I modeled it myself and used the Bambu Lab A1 Mini for printing. For higher precision, various 3D printing platforms can be considered to obtain a more accurate shell. The STL files are available in the repository.
3. JLCPCB panel: 40 yuan (for 10 panels)
4. Other components to buy: 600mAh rechargeable battery—10 yuan, 240x135 ST7789 plug-in screen—8 yuan, M2.5x8 flathead screws—4 yuan (50 pieces)

 

用树莓派PICO做一个复古迷你磁带播放器图2
Materials for assembly—screws and panel make it all come together

 

7. Conclusion

Although this project took a considerable amount of time and effort, the sense of achievement gained is significant. Currently, the hardware architecture is relatively stable, but there are still many software bugs to address. Since the entire program is self-constructed, even seemingly ordinary functions may encounter issues. Suggestions are welcome, and I have already made 10 units. If anyone is interested, feel free to contact me.

Thanks to this era, accomplishing such projects with the convenience of platforms and various internet resources is possible through the efforts of a single individual. The best time to plant a tree is ten years ago; the second-best time is now. If you have a hobby, why not pursue it seriously?

 

The article was first published on https://mc.dfrobot.com.cn/, December 23, 2023

 Cr: https://mc.dfrobot.com.cn/thread-317472-1-1.html

 Author: jd3096

License
All Rights
Reserved
licensBg
0