Coding the Space Rock player with Arduino

Have had lots of fun and games trying to get the Arduino element of the player to work, so far.

Firstly, getting the newly-purchased SD card to read was relatively straightforward. Once I worked out that I could transfer the files through my camera (as I don’t have an SD card reader other than the one I had just bought to attach to the Arduino), testing to see if it was connected and reading the files on there worked okay. Once I had reformatted the card for FAT32, at least. There is still an issue with some of the files having names too long for the DOS 8.3 naming convention, but I will rename these later.

Testing the SD card reader
SD card reader working

Next, I bought the additional components (amplifier chip and capacitors) for, and built, this circuit:

Simple Audio player schematic
Simple Audio player schematic
Simple Audio player amplifier circuit

Unfortunately, not realising there was a difference between the Arduino DUE board, which this circuit was designed for, and the Arduino (Elegoo) UNO I have, took me off on the wrong track somewhat and cost me a fair bit of time. Essentially, the DUE uses the Audio.h library, which needs the DAC port. A port my UNO sadly doesn’t have.

So, next, lots of Googling, trying to find a simpler circuit and code that uses the TMRpcm library instead. For a while, every bit of code I verified was giving me errors similar to this one (I tried a few!):

So then I decided to try the other computer, and the same lines of code all worked fine.

Next, to build the circuit. I tried to build this:

Simple Audio player with two buttons.

But the wiring around the capacitors and amp chip lost me completely.

Then I started working with this code – – and finally managed to play various of the .wav files on the card
(although the audio was so distorted it was sometimes hard to tell!).

But how to make the circuit, so that it wasn’t just plugged straight into the Arduino board? After a couple of false starts, I found and built this:

This meant I now had very distorted, but louder audio from the speaker.

Simple audio amp circuit for testing
Simple audio amp circuit for testing

So…next steps..?

  1. Build the more complex amplifier circuit above that works on the UNO, ideally with a potentiometer for volume control
  2. Find and write the code to play the .wavs whenever a tilt switch is activated, and turn off again when tilted back into place
  3. Find and write the code to make this happen randomly (ie play one of the eight .wav files at random) when the player is tilted forward (rather than the current keyboard entry in serial monitor)
  4. Last, but definitely not least, think about how the circuitry and power can fit inside the player shell

Watch this space.

Inspiration for the ‘Space Rock’ audio player

I want to make one of these. Imagining them as a limited edition for a band or artist, loaded with samples of their work, so the user can create their own soundscapes. Could be a version using the Voyager Sounds collection?

And also a nod to the interactive tilt radio by Luka Or, whose shape initially inspired the ‘Space Rock’.

3D sketches for outer space artefacts

Some screenshots of ideas for developing an ‘alien’ aesthetic for the outer space artefacts.