My entry for a mini pumpkin decorating contest for Halloween. A singing (miku) pumpkin made in less than 24 hours including modeling, painting, 3D printing and coding. If I had more time, I would have wanted to put all the electronics inside the pumpkin.
A small pumpkin with an acrylic painted face sitting on a custom 3d printed speaker housing. It can light up and play music simply by touching anywhere on the pumpkin (except for the stem). It utilizes the ESP32 capacitive touch pins while reading an MP3 file from an SD card and outputting it as I2S protocol.
This code was intended to play only one song with a simple pause feature. When the touch pin senses change, it will turn on the LED pins and begin playing music from the SD card. There is a second touch pin that allows pausing. The music does not loop and needs to be manually restarted by resetting the ESP32 either through the onboard reset button or power cycling.
This is a list of components used in this project.
- ESP32 WROOM 32D
- MAX98357A
- 4 Ohm 3 Watt speaker
- Micro SD Card
- SD card adapter reader module
- LEDs
- 100 ohm resistors
- Battery bank
Make sure the following libraries are installed:
- arduino-audio-tools by pschatzmann
https://github.com/pschatzmann/arduino-audio-tools
- SD by Arduino, Sparkfun
- Please pay close attention to the model of ESP32 as each variation can have different pinout than the one used in here
- The touch value used may not reflect the same for other ESP32. Please use serial monitor to see the touch pin output and adjust accordingly
- Use an audio program like Audacity to remove any metadata on the MP3 file you wish to use as it will cause delay problems
Singing.Pumpkin.Demo.Compressed.mp4
Song: Humorous Dream of Mrs. Pumpkin / Hachi
If you find yourself using this code to add to your project or make a video/tutorial with it, I simply ask that you credit me @lenpai0 and provide a link to this page. Thanks and enjoy!