Thursday, November 16, 2017

Bare Conductive Arduino MP3 Player

I found the Bare Conductive Touch Board Starter Kit while searching for activities to do with my almost nine year old son over the school holidays. It contains a custom Arduino board with a built in microSD card reader and audio output along with twelve electrode that can be used for touch or proximity sensor input. There is also a jar and tube of black conductive paint, a brush for painting them on alligator clip wires and adhesives, stencils and cardboard cutouts for designing the sensors. A 128 MB microSD card, USB card reader and portable speaker round out the collection.

The idea is that you either paint on the sensors or clip the wires to metallic objects so that when touched it triggers the playing an MP3 track.

It turned out to be a bit too complicated for a 9 year old, but my son likes to fall asleep and wake up to music and I had the idea that I would use the kit to make an interesting MP3 player on Alex's bedhead.

The first thing was to program the Arduino board, something I was now familiar with after the ticket gate project. The code examples provided were only for the triggering of single tracks, whereas I wanted proper player navigation. This included the ability to:

  • Stop, play, pause and skip tracks
  • Shuffle tracks
  • Change the volume
  • Play collections
By default the library used by the code only plays files named in the format TRACKxxx.mp3, where each x is a number 0 to 9. I did see some code for alternative names, but couldn't get it to work so I stuck with that format.

When the shuffle mode is selected random tracks are picked. Each played track is added to a list which is scanned to ensure that it is not repeated. Skipping a track forwards or backwards only moves to the next number and doesn't use random selection.

For playing collections I made a subdirectory, in my case called sleep and placed the relevant tracks in there. I also swapped the 128 MB microSD card for an 2 GB card I'd got with an old phone. This is the largest size supported by the FAT16 library. 

The code, listed at the bottom of the post, is memory intensive and occasionally locks, but it mostly seems to work.


The need to manually copy and rename tracks made the player impractical for use by my son, who also likes current pop. Instead a I got him a portable bluetooth speaker and an old mobile phone with Google Play Music installed.

Still, after all that effort I decided to get my player working anyway and painted up a pre-primed MDF board with the stencil, affixing the Arduino board and speaker at the bottom. Each silhouette corresponds to a control. It's not intuitive, but it is artistic and I might add to the design later. I like the look of the bare white, gold and black Arduino as well, a nice reminder of what is usually hidden inside the designs.


Wednesday, November 15, 2017

Raspberry Pi 5 inch and 3.5 inch touch screens

After making the Arduino ticket gate I've been inspired to play with some of the other "maker" offerings available. I recently purchased a Raspberry Pi 3 and Raspberry Pi Zero W to experiment with. That actually takes the Raspberry Pi in the house to three as I previously bought my son a Kano Computer, which also uses a Pi board.

The Raspberry Pi can be hooked up to a standard HDMI monitor, but I wanted to try something a bit smaller so I obtained an Adafruit 3.5" PiTFT Plus and a 5.0" HDMI touchscreen. The former came with a badly soldered header and I've yet to get it working. Its instructions are also woefully out of date and unsuitable for the current Raspbian Stretch version of the Linux OS. 

For both screens what you need is the LCD-Show code. However, if, like me, you installed Raspbian via NOOBS then you are likely to get a kernel panic after installing. Don't panic!

I found these instructions to be helpful, but in my case I needed to slightly modify the boot partition statement.

  1. You need to edit /boot/cmdline.txt on the SD card, either before your Pi reboots or using a second Linux machine (fortunately I had the other Raspberry Pi Zero and a MicroSD card reader to do this on).
  2. Replace root=/dev/mmcblk0p2 with root=/dev/mmcblk0p7
If editing on a second computer put the MicroSD back in the Pi's slot and reboot.

Everything should now work and you've now got a small Linux device. Not as small as my old Zaurus handheld PC's but a lot more hackable.

Size comparison between the Raspberry Pi with 5" screen and a standard mouse

Popular Posts