Go Down

Topic: Arduino library for WTV020-SD-16P audio module (Read 355025 times) previous topic - next topic


Ok! I got it working! Turns out it was the SD card. Cheers for the help everyone!


I've been working with a Somo-14D recently on a lightsaber project.  I got it generally working until I realized that it couldn't do gapless playback.  The gap was very small, but very noticeable when going from a swing directly into a hum.

Do you know if this module can do gapless playback?  I know the two units are similar, I just don't know how similar.



I  just got from China a board : V1.5 / 2012.01.12", and "5v  / 3.3v

The only successfully way to format my Nokia mirco SD 512 MB
was win / cmd(Admin) / diskpart .
( http://www.chip.de/bildergalerie/Windows-To-Go-So-laeuft-Windows-8-auf-USB-Sticks-und-Festplatten-Galerie_54926063.html)

Up to now I run the board stand alone.
OK Files:
- 000X.ad4
- 000x.wav   freq 12.000 Mono and -1dB

It is possible to run MP3 im stand alone modus ?


Likewise... I have been trying to get this to work and have not heard a peek in testing.

I am using the sparkfun board pictured below. https://www.sparkfun.com/products/11125
1gb sandisk microSD
1 sound file on the card at 72kb.
FAT formatted on windows 7
File is named 0.ad4, and located in the root directory

I have tried wiring it up directly to 3v power, to the 3.3v and Vcc pads and touching the reset and play pins to ground... nothing

I tried using the arduino with this library as well, and have not seen any data on the serial monitor, nor any reaction from the board.

Would anyone with experience getting this to work consider writing an idiot helper post detailing exactly how to configure the board, leads, arduino code/libraries to get a hello world equivalent file to play?

Is there anyway to isolate whether the SD card is the problem vs a user error in wiring and configuring?



Hey guys,

Just a big thank you to the-rebel-agent for the library. I'm totally new to the arduino and electronics, but managed to get my module up and running with very little problems. I sourced my module from the e-bay link provided earlier in this thread and changed the solder-jumper to  5v. Everything seems to be working as it should.  :D 


Thanks for this library ! I managed to get my module working. I used a noname 2GD card.

However, if i call the playVoice() or asyncPlayVoice() function once, nothing happen. I have to call the function several times to make the module work.

Another problem is that the playback stops 10 ou 20s after the beginning. I tried with 8bits 22050Hz and 8bits 11025Hz.

Has anyone succeeded in playing a long file ?

Thanks !


Oct 03, 2012, 03:12 pm Last Edit: Oct 05, 2012, 12:40 am by elac Reason: 1
Thank You very much the-rebel-age for this library and example.
It works great.
And thanks chathuranga for the schematic you posted, it helped.
I have 1.5v module from the link you gave.
I use these 2gb micro SD card for all my Arduino modules that need micro SD(ethernet, tft lcd, etc.).
http://www.amazon.com/gp/product/B000VOU91U/ref=oh_details_o01_s00_i00 and they work great.
Also, for others if you don't want the sounds looping put all the code you need from the void loop part of the sketch in the void setup part(leaving void loop empty or commented out), then you have full control through the module buttons.
This is all you need for setup and loop for simple playback/stop and select.
//Initializes the module.
void setup() {
void loop() {

Thanks again!!!
It's all about the skills


Hello all,
I'd like to put together a tutorial for my students for audio-from-arduino.
Would those who have succeeded with this board please tell me
1)  what code they used? (the original library posted by the-rebel-agent is the winner?)
2)  what is the proper hook-up of pins (i.e. circuit diagram).  the one posted by chathuranga  works?

thanks in advance,



I am having problems with this module, i cant change the song that sounds every time it sounds the 0000 sound

Any idea??


Hi the-rebel-agent,
I have the Arduino 1.0.1 Software, and when I try to verify  your code the following errors appear:

WTV020.c: In function 'reset_WTV20':
WTV020.c:17: error: 'PB2' undeclared (first use in this function)
WTV020.c:17: error: (Each undeclared identifier is reported only once
WTV020.c:17: error: for each function it appears in.)
WTV020.c: In function 'send':
WTV020.c:25: error: 'PB1' undeclared (first use in this function)
WTV020.c:28: error: 'for' loop initial declaration used outside C99 mode
WTV020.c:33: error: 'PB0' undeclared (first use in this function)

I'm new to the use of Arduino, so any help will be welcomed.


Caritusm, make sure you have put the Wtv020sd16p folder in the Arduino IDE library.
Wtv020sd16p.h MUST be present for the code to work.  ;)
It's all about the skills


Oct 14, 2012, 03:39 am Last Edit: Oct 14, 2012, 05:37 am by kariloy Reason: 1

Bravo, Tested library and worked fine.. :)

And answering my previous question, I tested this with a 2GB SanDisk MicroSD card successfully. In other words there is no limitation of 1GB.

I booted my computer in my windows partition and used this tool:
to format my SD cards [Overwrite Formatting Option], I've only tried the SanDisk & Kingston but I assume the other one works too!

So the issue with the SD cards may just be [I speculate] nuances on the different implementations of available formatting tools (previously I was using gparted).


Alas, [previously] I am [was] not being so lucky.

I've tried with 3 different 2Gb microSD cards:
- SanDisk, Kingston & unbranded
- Formatted them all with FAT16 filesystem (and even tried to make a partition smaller than 1Gb)
- Used several .ad4 files "fished" from these foruns and lately official sample ad4 files from the 4D website

Module pin 1 --> arduino pin 2 (reset)
module pin 4,5 --> speaker (tested 3 variants: 8ohm/0.25watts; 16ohm/0.3watts; unbranded earphones)
module pin 7 --> arduino pin 3 (clock)
module pin 8 --> GND
module pin 10 --> arduino pin 4 (data)
module pin 15 --> arduino pin 5 (busy) + led setup (replaced 470 ohm resistor w/ 390 ohm resistor)
module pin 16 --> VCC (both +3.3V and +5V after changing the jumper)

the module I bought was the one in the link the rebel provided... using his library, his sample code...

... and all I got is the a tiny short "switching" noise when the LED blinks, if I hold the speaker to my ear...

So, according to your own experience can't you detect any flaw in my setup? Or is it just another case of the microSD card Russian roulette?

P.S. - I'm all out of microSD cards to try and I don't have an SD shield.


Where is the link to a library download? I can't find it in this thread.


Where is the link to a library download? I can't find it in this thread.

It is attached to the very first post of this thread. You can see it only if you are logged in.


OK, I changed browsers and found the link. Thanks for the good work.

Go Up