Arduino library for WTV020-SD-16P audio module

And again, this module is VERY PESKY about the uSD card that reads. I tried a lot of them until got one that did work.

EA3BIL and knut_ny,

Have you tried the module as a stand alone and not connected to the arduino?

The module only likes SanDisk MicroSD cards. It is a little tricky getting the microSD card into the slot properly. You have to open up the card slot and place it into position. You can not just slide it in from the end.

Mine was not working with the arduino and I tried it in stand alone and got it to work. Reference wiring diagram in the previous posts. I then was successful in getting it to work with the arduino.

ntmcguff,

I noticed about how tricky is to get the card correctly positioned on it...

Yes I did try to run it on StandAlone mode (aka mp3 player), same results, no sound at all (remember two modules tested, etc...)

I finally made the decision and moved to SparkFun WTV020-SD module.
(at least this one works on StandAlone mode with ALL sd's)...

I'll keep you all up-to-date about the results on using Rebel's library with it.

hello guys

first post for me...

ive been trying to get the module working for some time today... and finally got it making sounds.
thx for all the information in this post, was very helpful!

except for the issue ive faced! Everything was hooked up correctly, formatted the sd-card (SanDisk 64mb) in fat16.. etc..

But nothing happened.. I only noticed that the busyPin-LED was glowing all the time... first i thought this might be normal, but it is not!
Even if it did react to buttons ive pressed or code changes iv made! But at that point of trying i didnt know that it aint normal, so i started looking for the problem:

  • formated the SD-card x-times
  • soldered the jumper to 5v tested, and then again back to 3.3v
  • destroyed a in ear headphone to get the speaker
  • took differend .ad4 files
  • hooked everthing up again
  • used different code snippets
  • readed every post ive found
    -....

As a last desperated try i was just pressing slighty against the bottom side(between pin 8 and 9) of the sd-card, while it was mounted into the slot.
AND, some reaction, the busyPin-LED was turning off.. as i pressed some buttons i noticed sounds...!
Finally it worked for me.. :slight_smile:

So my conclusion is, that the SD-card might not have decent contact to the module, even if it looks fitted!

Hopefully this might help someone... like your posts helped me!

Necesito una ayuda, he visto que el creador de la libreria es argentino asi que lo escribire en español para explicarme mejor y luego lo intentare traducir.

Compre este modulo:

http://letsmakerobots.com/files/WTV020_manual_V1.3.pdf

Doy por hecho que es el mismo que usan todos ustedes. Estoy intentando conectarlo de manera aislada (el punto 8.8 del datasheet)solo vcc, gnd, el led de estado, reset ,play/stop y el altavoz.
Cuando arranca parpadea el led y se mantiene encendido, el reset parece que funciona pero cuando le doy al play se escucha como ruido y se apaga el led, y un 1-2 seg mas tarde deja de sonar y se enciende el led. Se que el modulo es muy especial con las sd, he probado 4: una kingston y una scandisk de 2gb, una de 256mb y una de 4 gb tracens y con cada unos de se escucha un tipo de ruido diferente. He probado con varios altavoces y buzers, los grandes son de 8 ohmnios y 3w y 1w respectivamente.
Tambien he probado con diferentes audios, algunos ejemplos que habeis puesto aqui y otros de youtube

Otra cosa que necesito que me expliquies que es eso de los modos que viene en el datasheet. Parecen distintas formas de conectarlo pero no entiendo como el boton play/stop puede estar en diferentes pines en cada modo y sin que haya que configurarlo con algun jumper.

In english:

I´m trying to conect the module like point 8.8 of datasheet. Reset works but when a press play, led go off and i heard a noise for 1-2 second, then stop and led go on. I try with 4 differents sd (two of 2gb kingstom and scandisk, one of 256mb and other of 4gb)

I try with 2 speakers of 8 ohms and 3w and 1w, and somes buzzer and little speakers. I try with mnay audio example form hear an otrher from youtube

hi
thanx 4 adding this library it seems that it is going to help us sooo much in our project XD
but i need to learn more and understand more things about this library
i bought this https://www.sparkfun.com/products/11125
i need to control playing the content of the sd card using arduino
for example play song 1 when some action happens or song 2 when other action happens
could u help me ^___^
i will be sooo thankful :slight_smile: :blush:

Hi,
I may be being thick here but can anybody send me a download link for this library.

Thanks :slight_smile:

It's attached to the first post on the first page of this thread.

rulicos:
I´m trying to conect the module like point 8.8 of datasheet. Reset works but when a press play, led go off and i heard a noise for 1-2 second, then stop and led go on. I try with 4 differents sd (two of 2gb kingstom and scandisk, one of 256mb and other of 4gb)

I try with 2 speakers of 8 ohms and 3w and 1w, and somes buzzer and little speakers. I try with mnay audio example form hear an otrher from youtube

I think ALL problems with this module are because of the power supply. SD cards need more than 3.3V to work (it's in their specification).

Using this power supply, all my problems disappeared:

wtv_power.png

Hey, Thanks for the library.

I am using Audio-Sound Breakout - WTV020SD from spark fun (https://www.sparkfun.com/products/11125), people recommend to use your library to control this module.

I first tested the model without arduino, simply grounded the play pin and it worked, I can hear sound coming from the speaker. however it didnt work with the library.

I'm not sure if I connected the right pin. according to the library, the pin 2 on arduino goes to reset on the module; pin 3 to DCLK, pin 4 to DIN, pin 5 to BUSY. and connect VCC to external 5v power.

is this correct?

thank you !

best

the-rebel-agent:
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 hope you share on that later in this thread!
Learning traps to avoid after stepping in so many is why I read so many posts!

Waytronic-Jasmine(Li):

djole_ru:
Hello!
I have a question!
How to manually change modes on vtv020-sd-16p,all ekys are on/off(loop),key 5 group of voice...
Thanks!!!

I want to ask which control mode module do you use?for example ,If you buy 2-wire series mode can not us key 5 group of voice,control mode is fixed when we program main chip,and you need tell supplier what you want,i think they will give you correct control mode module.

Please. On eBay the supplier tells little. This is typical and notice it says "MP3":

Nothing about mode. This one also uses mini-SD I don't find easily, nor adapter mini to micro-SD so this module says 'problems' to me.

I am having problems enough with the VS1003 modules I got. Yes there is software for other modules with the same chip that do almost what I want. In the meantime I have someone who wants dozens of Arduino-controlled sound players.

What I find that "works out of the box" is expensive and the rest are take your chances when buying and see how many hours before you get it to work if ever. Does that sound like any way to sell a lot of anything here?

HELLO,
this page helped me alot when I started using WTV020. i had used it as both stand alone mp3 player and interfaced with arduino (using arduino UNO and arduino mega 2560 both!). it was working pretty well. but now when I am trying to play the module, all I hear is a slight beep. nothing else. thje connections are pretty fine and so is SD card. can anyone suggest me what can be the problem? How can i get it working again! please help me out.

Kindly explain in English. I don't understand the language

I finally got mine to work. All this time is was an incompatible memory card. The data sheet should give some examples of working cards to use, that way we know what to get, the first time.

I've got the Sparkfun breakout board for this audio module working intermittently. I'm using it in serial mode connected to an Arduino UNO with the Wtv020sd16p.h library from the original post in this thread. The breakout board is powered from the 3.3 volts from my UNO. I'm getting my sounds to play okay, but frequently I don't get any sounds. If I remove power the UNO (which removes power from the breakout board), then re-apply, it works again. I've tried adding a speaker.reset() before I try to play a sound. I also tried increasing the delay() in Wtv020sd16p.cpp on line 37 from 300 to 750 and line 94 from 20 to 50 per a suggestion from a Sparkfun user in the breakout board comments, but neither helped. Here's my sketch:

#include <Wtv020sd16p.h> 

int resetPin = 8;  // The pin number of the reset pin.
int clockPin = 9;  // The pin number of the clock pin.
int dataPin = 10;   // The pin number of the data pin.
int busyPin = 11;   // The pin number of the busy pin. 

bool playingSong; 

// Create an instance of the Wtv020sd16p class.
Wtv020sd16p speaker(resetPin,clockPin,dataPin,busyPin);

void setup() 
{
  Serial.begin(9600);
  speaker.reset(); // Initializes the speaker module
  playingSong = false;
  Serial.println("Finished setup");
}

void loop()
{

  if (playingSong == false)
  {
    Serial.println("Play sound");
    speaker.asyncPlayVoice(0);
    delay(200);  
    if(digitalRead(busyPin) == HIGH)
    { 
      playingSong = true; // Set flag so command to play song doesn't run again
      Serial.println("Busy"); 
    }
    else
    {
      Serial.println("speaker not busy");  
    }
  }
  
  if (digitalRead(busyPin) == LOW)  // when song is over, reset flag so it will play again
  {
    Serial.println("finished song, play again");
    playingSong = false;
  }
}

When I have the problem of no sound the sketch outputs this over and over, it's seems to loop a few times per second:
Play sound
Busy
finished song, play again
Play sound
speaker not busy
finished song, play again
Play sound
Busy
finished song, play again
Play sound
speaker not busy
finished song, play again
Play sound
Busy

Hi the-rebel-agent,

Thanks for your library. Got my unit up and running in less that 30 minutes (most of it getting the wiring right!).

I had an old 64Mb(!) micro SD card that works fine and will probably be enough for what I want to do (voice for a robot).

Thank you for sharing this library!

I'm using the SparkFun breakout board as well, but I'm encountering some weird problems. Basically, I can get it to play back sounds, but when I try to play multiple files in a row, things don't work properly. Sometimes it will play the first file and then nothing for a couple of minutes, sometimes it will skip a file. Here's an example:

while(true){
wtv020sd16p.playVoice(1);
delay(2000);
digitalWrite(testLED, LOW);
wtv020sd16p.playVoice(3);
delay(2000);
digitalWrite(testLED, HIGH);
}

This behaves erratically. The LED flashes as expected, but the sound doesn't always play. Sometimes file 1 will play, sometimes nothing plays, and rarely file 3 plays. If I take it out of the loop, file 1 usually plays, but file 3 does not. I also tried it with asyncPlayVoice(), with the same results. If I take the delays out, the LED flickers and then stops while one of the files plays. Then it flickers some more and plays another file (usually it'll alternate, but sometimes it'll repeat).

Any ideas?

As with so many others on this thread, my problems have all come down to SD card issues.

Both a Sandisk and a Kingston 2GB failed to play any music at all - however a no-name 2GB card works fine. And by "works", I mean all songs play through fine as expected via 2-line control as done by this thread's library - so I must add my name to the chorus thanking the-rebel-agent!

And this behaviour was exactly the same on 2 WTV020-SD-16P modules (I got the second while trying to get the first to work, since I assumed Sandisk not working implied there might be a problem with my module).

All 3 SD cards look fine when used with a Mac SD card reader. However particularly in the case of the Sandisk, I wonder if the branded SD cards are genuine, particularly Sandisk which has a huge fakes problem?

My next steps

  1. Run cards through F3 (http://oss.digirati.com.br/f3/, Mac version of h2testw) to see if anything emerges.
  2. I have seen elsewhere (http://forum.arduino.cc/index.php?topic=115411.0) people suggesting trying slightly higher than 3.3v to the WTV, eg send in 3.6v - and that this can make previously failing cards work. I am getting a variable voltage regulator so I can try various levels and see if that helps with the 2 cards that are currently failing.
  3. I've just got a job lot of old 1Gb and smaller SD cards and will see if any pattern emerges from that, in terms of what SD cards work and what don't.

If anyone could give an amazon UK (or other) supplier of cards that is guaranteed to work, that would be extremely useful!