[Final] MegaHits and the Dripping Cave Simulator

(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.

MegaHits PCB design, PCB file can be found on GitHub: https://github.com/megahits

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.

MegaHits and its single transistor amplifier in action. The transistor is not soldered on the module in this case, it’s behind the speaker. It produces a considering amount of heat while working which is unavoidable without further optimisation(which I did). The storage chip on this unit is on a socket, which enables me to swap audio clips. Music credit: Union!! – 765 MILLION ALLSTARS

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.

MegaHits module with LED and speaker working. You can hear the dripping sound from the speaker.

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.

Footage of the Drip Cave Simulator recorded before the presentation(unreleased footage).
https://cdn.discordapp.com/attachments/954048989295161347/970445951133175818/IMG_20220501_180511.jpg
The appearance of the box, which certainly has space to improve

Light on a tour of the Dripping Cave Simulator. The condition of the wrapping paper is pretty bad after the presentation but still sells the effects when the light is in show mode. Just like some Disney theme park magic 😉

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.

4 Comments Add yours

  1. Nathan says:

    I liked the low volume and low light of the piece, they created a calm and relaxing atmosphere.

    1. Kobayashi Kotori says:

      Thank you! It’s currently running in my own room and it doesn’t distract me at all.

  2. Han says:

    I really appreciate how you incorporate individual boards for the dripping effect. The technical aspect really shines in your piece.

  3. rjfeldman says:

    Very fun watching your project come together. It is so cool how you got custom PCB boards for this.

Leave a Reply