Go Down

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


I got it working, and directly connected the module to the Arduino 3,3V Output and the digital Pins set in the program. 
The SD Card is a cheap 64 mb from my cellphone formated to FAT.
The files are wave (Mono, 16 bit, 12 khz (16 khz didnt work and caused a "chopper"-like noise).

What I don't get is what the difference between
wtv020sd16p.asyncPlayVoice(0); and
with both modes I can do things, blink Led's ... while the sound is playing. What is the difference?

I was hoping to be able to play two sounds at the same time, or at lease pause one sound, play the second an than continue.
But this isn't possible, right?



I tried this tutorial but no sound are played in the B mode (with arduino) (two line serial mode).
I've used the arduino code and library indicate in this forum (the program run and the serial console indicate the sound should be played) but no sound.
I think the wtv020sd-16p module stay in mp3 mode and don't want run in two line serial mode.

The MP3 mode work properly on my wtv020sd-16p module (without arduino) (MP3 Mode). But not the two line serial mode of this tutorial...
I've verified all the wire...

Some idea of the issue of this problem ?


Oct 19, 2014, 09:38 pm Last Edit: Oct 19, 2014, 09:57 pm by Hagga Reason: 1
Hey guys!

I got this module last week and I have some issues with it.
When plugged in MP3 mode where I only use Arduino UNO to supply power it didn't work with 3.3V pin but played alright (with all the buttons working) with 5V which shouldn't happen. I am using 32ohm 0.25W speaker, maybe that's why? But then again, I plugged some earbuds to it and again it was only working with 5V connected to it.

When I connect the device in 2 pin mode, I only get a "click" sound when playVoice functions are being called, but get no music whatsoever(neither 3.3V or 5V plugged). I get a strong feeling that it's not receiving a right command and tries to play a file that doesn't exist. I have ad4 files names 0000, 0001, 0002 etc, I was using the test files and my own but to no avail...

I hope any of you have some more ideas :(



I got the Sparkfun WTV020SD and it plays sounds in stand alone mode but not when hooked up to the micro controller.

I don't think is a MicroSD card issue, otherwise it wouldn't work at all, right?

Thank you



I can playing  MP3 mode that wtv020 SD mini module.


(16 Pin module Pin1 is Ground,Pin8 is +VDD ,Pin3 and Pin4 is Speaker connections)

But I don't playing with software still

My project for blind people's color identifier and spoker device.First step is working and color sensor is recognize with arduino
But I am working nearly one month for that simple job

I am learning  I2C protocol in from that  china module
if you help me for code also you will help to blind peoples too.

in your codes:
if you random 1 to 10 values and if you show in serial monitor that value
and if you read that values sound (AD4 file) from SD cart I will  happy

Please help arduino pin connections too



I had try at first page library too
over 400 people see my last message but nobody don't say anything.

if a firm's have  product  it must be good support too.I had send an mail (not e-mail) to Sony Corporation 39 years ago I had receive  one page reply, after 15 day  .

Big firm's have big boss too.

Yes I don't know I2C protocol and C language  but I want learn and have not any sample code or tutorial that software for like in first message example

is very hard for a firm or I am asking very sopisticate Know-how question?



Some things I found out while playing with the WTV020SD:
- I didn't manage to play WAV files. Only AD4 (16kHz or 32kHz) did work.
- The module works at 5V for me with the jumper set.
- You better put a 0.1uF coupling capacitor at the Audio Output (Pin 2) to avoid loud "ticking" when switching between sounds.

- I need two delays. Without them it lock up or skips the track.

My idea is that without the first delay the busyPin is not completely HIGH and so the while() loop is skipped. I guess this is because its a 3.3V Output connected to the 5V Arduino Input.

The second delay might be needed because after finishing and closing one track it maybe needs some time to accept new commands...

Code: [Select]
  while (digitalRead(busyPin) == HIGH) {
    //do Stuff here

Do you also have these problems?

Unfortunately the WTV020SD Datasheet is really bad (probably a small Chinese manufacturer). So there are rather experiences than facts about this module...


Dec 01, 2014, 08:47 am Last Edit: Dec 01, 2014, 08:54 am by rysium
First of all big thanks and kudos to Diego J. Arevalo for putting together the library.  It was a great starting point to play with WTV020-SD-16P audio module.  

However there are two thing incorrect in this cpp code:
1. at the end of each loop in "sendCommand" there is 2ms delay after each bit is sent.  This 2ms stop bit should be sent after entire message is sent
2. the timing does not account for digitalWrite taking about 5us so there are at least 15us added to each clock pulse.

Because of this problems the "sendCommand" takes over 50ms to execute.  It was not acceptable in for my solution where I needed to do precise timings on each sound clip (fishing boat sound for RC model).  I have corrected both issues and the "sendCommand" now takes absolute minimum required for transmitting 16 bits.  I have also added "setVolume" function and fix "unmute" function to restore the volume level from before "mute".

Anyway, here is the entire library attached (including updated example and three sample ad4 files used in the example).  

@ the-rebel-agent - feel free to update it in your first post in this thread if you wish.



Is it possible to stream audio generated from this module via bluetooth to my headset ?
Which other module I need ?


Welcome and you are clear to go. Just be careful about the micro SD card you are using. Got a lot of pain in the b... figuring out why mine did not work from the start.
I am doing a gift box which plays four different audio phrases(files) depending on the child how close he is to the box. I am using 4pin ultrasonic with Arduino Nano and WTV020..Can you pleae help me with the code
Live to learn & make


I'm very impressed with this module and the library is great. I've tried it with a  TDA7297 10-50W Dual-Channel Power Amplifier Module and the sound is great. I'd like to connect 2 of the WTV020's to the amp since it is stereo so I can play music on one and sound effects on the other at the same time, however there is only one gnd input and 2 + inputs. Is it safe to connect the speaker - from 2 WTV020's to the same gnd in on the amp? I had earlier tried connecting 2 WTV020's to the same speaker and ended up frying both, don't want to sacrifice any more.


Hello. Anybody knows good source of vtw020sd v1.5? :)


Hello. Anybody knows good source of vtw020sd v1.5? :)
I've been getting them on ebay, just search wtv020sd.


Hello, I am working on a project using this module. But I still can't make it work. Can somebody help me?

The SD I am using is a SanDisk 2GB FAT format
this is the code I am using and I attached the circuit I used.

Code: [Select]

#include <Wtv020sd16p.h>

int resetPin = 10;
int clockPin = 11;
int dataPin = 12;
int busyPin = 13;

Wtv020sd16p wtv020sd16p(resetPin,clockPin,dataPin,busyPin);

void setup() {


void loop() {


Apologies if this has already been mentioned, but with the module dated 2012.01.12 what does the 5V/3.3V solder jumper on the module actually do?
I understand that this module works best with about 3.6V, and that two IN4007 diodes can be used in series to bump 5V down to around that. If I solder the jumper over to 5V would these two external diodes still be needed? Or are they included on the module now?

Go Up