Hello everyone, I am a 30-year-old uncle who started learning programming, DF Maker Community ID: jd3096. I am fortunate to participate in DFRobot’s call for Raspberry Pi project activities.
As a self-taught MicroPython learner for two and a half years, this is also my first attempt to use Raspberry Pi Pico for a project. I hope everyone can support me. I am very willing to try projects that others have not done before, and this project is published for the first time on the DF forum.
Project GitHub link:https://github.com/jd3096-mpy/MPY-CASSETTE-PLAYER
First, let’s take a look at the finished product:
For the Bilibili video, friends who like it are welcome to support!
Project Origin
When I was a child, my older brother had a Sony cassette player that I envied a lot. My brother was also my music mentor, and I heard many excellent music works from him. Although I later had my own MP3, and later MP3 was gradually eliminated, everyone started to listen to music on their phones. However, I have always had a sentiment about tape players in my heart. The exquisite mechanical structure design and cool appearance of cassette players left a deep impression on me. Now I am trying to make one myself!
Hardware Selection
Regarding the hardware selection for the project, the MCU must meet the requirements of this event, so I chose Raspberry Pi Pico. At the same time, I need a color screen to restore the effect of the rotating transparent tape window. Finally, due to the performance limitations of MicroPython, I need a music decoding chip, and I ultimately chose VS1053 because of its powerful functionality and the availability of a ready-made MicroPython library online. The other hardware is conventional: 4 buttons, a TF card slot, and to elegantly implement power on/off, I introduced AXP’s power management chip.
After selecting the hardware, I first built a module for testing and wrote a simple core framework for the project, which simulates the UI effect of tape playback.
PCB Production
I entrusted my old friend eggfly to help me design the PCB, which allows for a compact and elegant appearance, giving the project a proper look. After the event, I will upload it to the Jialichuang open-source square.
Core Ideas for Code Writing
The hardware is basically like this. Next, I will mainly discuss the key software issues that need to be addressed:
-
As a project from China, it must support Chinese. This project includes support for a full character set of 6500 commonly used Chinese characters, using the fb enhancement library from Wang Shujun: https://github.com/wangshujun-tj/mpy-Framebuf-boost
-
To have a smooth tape rotation effect, this project uses a 240×135 ST7789 color screen. Directly driving it with Python would greatly affect efficiency, so I used the fastc driver from the foreign developer Russhughes: https://github.com/russhughes/st7789_mpy
-
Support for VS1053’s driver, using the library from the foreign developer Peterhinch: https://github.com/peterhinch/micropython-vs1053
However, this library only supports the most basic playback methods, so I consulted the VS1053 manual and added some more advanced methods myself. -
Good UI, as a perfectionist, the interface must look acceptable to me, so I painstakingly cut out the materials one by one with Photoshop… it is quite a tedious task. -
To restore the operational logic of a tape player as much as possible, I needed to implement fast forward and rewind. What if the original library doesn’t have it? I’ll create it myself! I tackled the MP3 encoding format and VS1053, resolving those issues. The cover of the tape uses the album cover from the MP3 ID3 information, but I have processed it specially so that when playing MP3, if there is cover information, it will display on the screen, just like a tape is actually inserted. -
Finally, it’s about integration. It seems simple, but actually creating a complete system requires some effort. Many of the methods mentioned above required modifications to the MicroPython source code, so the final firmware was compiled by myself, containing some more advanced libraries, and ultimately summarized for use. The source code, documentation, shell files, and tool scripts have been uploaded to GitHub: https://github.com/jd3096-mpy/MPY-CASSETTE-PLAYER
A complete project certainly needs a shell. This year I just self-taught SW, still at the Hello World level, so please bear with me.
Finally, I will attach a Jialichuang panel. I am not very good at design, but after attaching the panel, it will significantly improve the aesthetic value.
Production and Assembly
The exciting moment has finally arrived! I need to use the following tools and platforms to assemble everything:
-
For PCB, I chose Jialichuang SMT, which seamlessly integrates with PCB design, making it convenient. The VS1053 chip used here was purchased from the official site, which is relatively expensive, and there is significant room for price reduction in shipping. Currently, I am making 10 SMTs, with an average price of about 100 yuan each. -
I chose to model the shell myself and print it using the Tuo Bamboo A1 mini printer. If you want higher precision, you can choose major 3D printing platforms to obtain better precision shells. The STL files are available in the repository. -
Jialichuang panel costs 40 yuan (for 10 pieces). -
Other components to purchase: 600mAh rechargeable battery – 10 yuan, 240×135 ST7789 plug-in screen – 8 yuan, M2.5×8 flat head screws – 4 yuan (50 pieces).
Conclusion
Although this project took a long time and consumed a lot of time and energy, the sense of achievement gained is also immense. Currently, the hardware structure is basically stable, but there are still many bugs to fix in the software. Since the entire program is built by myself, what may seem like an ordinary function can also fail. I welcome everyone to provide feedback. This time, I made 10 all at once, so if anyone is interested, please contact me.
Thanks to this era, I can rely on the power of one person to complete these tasks with the help of very convenient platforms and various internet resources. The best time to plant a tree was ten years ago, the second-best time is now. Why not play seriously if you have a hobby?
This article was first published on:DF Maker Community
Please indicate the source information when reprinting
▲ Click to participate
Hardware Arsenal
Click to learn more👆
DFRobot Official Brand Store https://dfrobot.taobao.com/
DFRobot Official Flagship Store https://dfrobot.jd.com/
If you have anything to say, feel free toleave a message!
If you have any questions, you can click “Read the original text”,to communicate directly with the author!
Previous Project Review
Understand the entire series of Raspberry Pi in one article!
Learn these 20 Linux commands to master your Raspberry Pi!
Raspberry Pi Cyberdeck with 6 screens, check it out!
Use Raspberry Pi to “light up” the Christmas tree
Raspberry Pi homemade cloud server, portable in your pocket!
Make a “digital microscope” with Raspberry Pi
Spring is here, you need a retro-style Raspberry Pi camera
3D printed Raspberry Pi spider robot
Make a handheld computer with Raspberry Pi and ESP32!
Create a retro game console based on Raspberry Pi Zero
The most comprehensive! How to choose Raspberry Pi expansion boards? One video solves it!
Click to read👆
Leave a Comment
Your email address will not be published. Required fields are marked *