Close

The joy of using an underdocumented module and using a plan B at the last minute

A project log for Portable Trollmaster 3000

Spreading the voice of Eduard Khil

Dr  SalicaDr Salica 01/01/2015 at 22:042 Comments

Meet the culprit, the WTV020M01 module :

(Yes, one pin broke during transport).

This thing is a "MP3 audio player SD card module". That's for the title. Now a few teeny tiny details :

Caveat emptor : do not buy this thing ;-)

Ok, maybe it's just me. After all, it's my first real project. But after spending two days to get this thing working, I give up. It is supposed to work in a standalone fashion, it does not. It is supposed to work with a weird two wire interface, it does not. All I managed to get is some kind of static. At least this static lasts the duration of the sound supposedly played. I do not have the tools or the skills to debug what's going on so, time to move to plan B.

I'm now using the PCM library from "high-low tech". It allows me to load a small (~ 3 sec.) low quality sample in the Trinket Pro flash and play it through an output pin. I'm disappointed that I cannot play the whole Trololo song but the deadline is approaching and I still must deliver a minimum viable product.

I quickly hacked the PCM library to loop the sample instead of just playing it once. It's really easy : in the ISR after the call to stopPlayback(), just add a call to startPlayback(sounddata_data, sounddata_length); and the sample will loop forever !

I used Audacity to extract a sample and sox to convert it to 8 Khz :

sox in.wav -c 1 -r 8000 -u -1 out.wav

Then, I used the EncodeAudio tool to get the set of bytes to paste into the Arduino sketch and voilà !

The setback with the nonworking so-called MP3-SD module was annoying, especially with the deadline approaching. But in the end, the PCM library offers a quick work-around, even if it means only playing a part of the Trololo song.

Discussions

will.sweatman wrote 01/01/2015 at 23:33 point

Hi Dr Salica,

Those little sound modules are popular and come in many different forms. Most problems with them are SD card related. You should always format the card with an SD card formatting program each time you write the ad4 files.

4Dsystems has a better datasheet. There overpriced version is called the somo-14D. Sparkfun also makes a version that is well supported. All of them are based on the same IC.

Somo-14 D:

http://www.4dsystems.com.au/product/SOMO_14D/

Sparkfun's version:

https://www.sparkfun.com/products/11125

SD card formatter:

https://www.sdcard.org/downloads/formatter_4/

Example project with code:

http://hackaday.com/2011/12/13/naughty-duck-will-be-the-end-of-secret-santa-at-your-place-of-work/

  Are you sure? yes | no

Dr Salica wrote 01/02/2015 at 11:08 point

Hi Will Sweatman,

thanks for the links ! I bought this module for 5€ on ebay. Next time I'll go for the Sparkfun version ;-)

I think my SD card is working : when I play a file, I hear static that lasts the duration of the file. For now, I'm using the PCM library to play a sample. But after the contest, I will investigate the use of the WTV020M01 module again !

  Are you sure? yes | no