(You can also find this post at https://blog.kmoene.com/blog/post/241.html)
The Drip Cave Simulator is a mini audio-visual device prototype that simulates a fantasy dripping cave, where each drop of water creates magical lights in the dark cave. This project is a perfect opportunity for me to experiment with my MegaHits audio modules.
Unlike most other projects, I started my prototyping design based on an existing and well-tested speech controller board called the MegaHits that I designed for audio playback purposes. The MegaHits is a low-cost (less than 90 cents) speech controller that’s capable of playing back long segments of audio clips. The logic part of the speech controller can be debugged and altered with a debug probe while the speech data is OTP(one-time-programmable). While MegaHits is very good at speech playback, it doesn’t have any lightning control capability and in this project, I am facing a challenge with controlling an LED with a speech controller.

I started my project by forking the existing MegaHits firmware source code, which was written in low-level c for performance and size optimisation(the controller is very limited, with 128 bytes of RAM, 1KB of x-RAM, and 12KB of flash ROM). After inserting the controlling code for the LED PWM and some appropriate delay, I found that the firmware doesn’t work on my development board. After some research and debugging I found that to controller audio and lightning individually I need to enable the “independent mode” of the PWM controller. I am using a single transistor(S8050 in my case) here to amplify the audio to the speaker since MegaHits’ audio algorithm is specifically designed for this kind of low-cost single transistor amplifier.
While perfectly suitable for lo-fi speech and music playback, It’s not designed for Dripping Cave Simulator’s application. The audio circuitry continues working while the drip cave simulator waiting for the next drop to happen, which wastes a lot of power. Shutting down and powering up the audio circuitry when needed is a solution but it creates a loud pop when doing so. To resolve that, I altered the audio synthesizing code and gradually turn the circuit up and down when a power event happens. This modification proved to be very effective both saving power and against the annoying popping noise. Which will be merged back to the main audio-only codebase. To make the sound more realistic, I also implemented a rate changing algorithm to randomly adjust the speed and the pitch of the audio.
After that, I started working on the physical sets. I found a paper box in my storage room and starts modifying it by opening up a window on the paper box. Then I painted the interior of the paper box black and glued on some dripstones which were made from painted paper towels. I also glued on the blue gift wrap which simulates the water surface. And finally, I installed my MegaHits modules under the gift wrap to finish my build.

For my next revision, I will be adding a better water effect to it by adding more layers of gift wraps. I will also implement some ambient lighting that shines from the ceiling(dark light maybe?) I will also add an ambient audio track that loops in the background.
For code credits, everything the controller runs were written by myself. There’s simply no space for any sort of library or abstraction layer for easier programming, everything was coded on a hardware register level.
I liked the low volume and low light of the piece, they created a calm and relaxing atmosphere.
Thank you! It’s currently running in my own room and it doesn’t distract me at all.
I really appreciate how you incorporate individual boards for the dripping effect. The technical aspect really shines in your piece.
Very fun watching your project come together. It is so cool how you got custom PCB boards for this.