Arduino library for WTV020-SD-16P audio module

it seems it's working fine, also sound quality
what diode did u use and where did u soldered?

1N4007. Connected in series as you will do with two power supplies to add its volts.

5V entering to the + lead of the first diode and connecting the - lead of the second diode to the wtv.

um, i think i am going to test again the board with 3volts pin and diodes
want to see if it will work better

I did not notice any difference in quality working at 5v or 3.3v.

By placing the two diodes in series with the 5v supply your dropping the voltage at the module input to 3.8v.
Essentially just feeding the module .5v over the recommended 3.3v.

I'm using an Arduino Uno to drive one of these boards (Embedded Adventures - Products - WTV020-SD SoundOut audio module - MOD-1007) based on the same chipset - the library works in as much as a single file play results in audio being played, however, when I try to queue up files in my code (to announce different digits, words, etc, like a talking clock, for example), the busyPin detection does not seem to be working.

I added a couple of lines of code to the playVoice() function to light up the on-board LED (pin13) when the busy loop was waiting but even on a four second audio file, the LED doesn't come on, indicating that I'm not getting the right busyPin status somehow... I've tried two modules (I had a spare) but so far no luck... I have to resort to putting delays between playouts (commented out below to demonstrate the problem) but no luck. each audio file is simply the spoken words "one", "two", etc, with 100msec of silence before/after the word.

any ideas appreciated!

/*
 Example: Control a WTV020-SD-16P module to play voices from an Arduino board.
 Created by Diego J. Arevalo, August 6th, 2012.
 Released into the public domain.
 */

#include <Wtv020sd16p.h>

int resetPin = 2;  // The pin number of the reset pin.
int clockPin = 3;  // The pin number of the clock pin.
int dataPin = 4;  // The pin number of the data pin.
int busyPin = 5;  // The pin number of the busy pin.

int ledPin = 13;

const int buttonPin = 8;     // the number of the pushbutton pin
int buttonState = 0;         // variable for reading the pushbutton status


/*
Create an instance of the Wtv020sd16p class.
 1st parameter: Reset pin number.
 2nd parameter: Clock pin number.
 3rd parameter: Data pin number.
 4th parameter: Busy pin number.
 */
Wtv020sd16p wtv020sd16p(resetPin,clockPin,dataPin,busyPin);

void setup() {
  //Initializes the module.
  wtv020sd16p.reset();
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);    
  wtv020sd16p.unmute();

  pinMode(13, OUTPUT);
//  digitalWrite (13, HIGH);
		digitalWrite(13, LOW);

}

void loop() {
  // read the state of the pushbutton value:
  buttonState = digitalRead(buttonPin);
  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  if (buttonState == HIGH) {    
  
  //Plays synchronously an audio file. Busy pin is used for this method.
//  delay(25);    
//  wtv020sd16p.setVolume(7);
  wtv020sd16p.playVoice(1);
//  delay(5000);
  wtv020sd16p.playVoice(2);
//  delay(5000);
  wtv020sd16p.playVoice(3);
//  delay(5000);
  wtv020sd16p.playVoice(4);
//  delay(5000);
  //  wtv020sd16p.mute();
  }
}

Busy pin is not always detected when using synchronous playback (playVoice), so add a delay of 50 ms before the detection of busyPin.
Add delay(50) in the line 42 of Wtv020sd16p.cpp

Good Luck!

i lu9jmg,

thank you for the suggestion - that makes perfect sense - the vendor made a similar suggestion overnight (emailed from o/s while on vacation, that's service)! I'll give it a go after Christmas is over - my wife is mad at me for spending too much time on this as it is right now :slight_smile:

that solved it - thanks very much!

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!!!

Hi, thank you for sharing the library!
I've got questions that I'm hoping someone here can answer one or more of them. They're not specifically about use with the library, but any answer about either the modules themselves or what has been done with them with or without the library and an external MCU would be greatly appreciated!

  1. This is a simple question that I hope that most anyone should be able to answer. The module claims to support some modes of playback where the playback will begin when the module is first powered on, and other modes where the playback is triggered by the binary level of particular I/O pins. I would like to be able to power off the module and have it begin playing automatically very soon after power turned on in some possible modes. I would like sound to begin playing less than one second after the module's power is first turned on, preferably much less than 1 second delay before playing begins. Is this possible? When you have an audio file that is abruptly loud at the very start of the file will you begin hearing playback within milliseconds or less than 1 second later from switching power on to the module? I am concerned that it may behave differently / much more slower after power is applied versus the short delay that is achievable when power has been already on for a long while and the playback is triggered by an I/O action. Some comment on a module seller's page suggested there was some configuration that could be changed having something to do with a busy line and some coding that would make a version 1.1 module play back without an added delay but there was no clarity as to what was meant there and whether the delay affected initial power on or track switching or pause/play switching or whatever. My main concern is auto-playing from power-on in any particular configuration..

  2. Earlier in this thread "sn4ke" stated an inability to play long files and said that his/her playback stopped after 10 or 20 seconds whatever they tried. Is this a limitation of the modules? I was hoping to be able to play long files perhaps 30 minutes or 1 hour long with one of these modules. Is it possible? I have seen no explicit specification to confirm or deny that this is possible.
    Has anyone successfully played a single file (other than infinite looping a short file) more than several minutes in duration? 30 minutes or more?

  3. I see from the module specifications that it has a very low quiescent power consumption in the microamps range, but it never specifies what quiescent state is other than the SD card being absent and it never specifies the amount of current used during other cases like "playback paused", "powered on, but playback stopped / not yet triggered by I/O command", "track playback finished and not looping", etc. I see there is some serial command to turn on/off the amplifier as well as configurations to pause / stop playback, but I have no idea how much power the module will consume when powered on but not playing in such cases. Does the module automatically go to low power quiescent mode whenever it is not playing a sound such as in "pause" or "stopped" mode? What sort of current draw do you see when playing and when playback is not happening in various states? What current reduction do you see when you send the turn off amplifier command and playback is not happening? Does the SD card also go into low power or turned off state when the module is not playing in some mode?

  4. How is the audio quality in AD4 or WAV mode at the maximum possible sample rate? I am not expecting "hi fi" CD quality but I wonder if it is pretty good for sounds which might be of a relatively quiet and subtle nature such as natural sound effects like perhaps the ocean, bird calls, river water flowing, soft speech or soft song that sort of thing. I'm hoping for something better than "telephone quality" 8kHz/PCM but obviously not as good as a CD. How would you rate it?

  5. I see there is a 16 pin DIP version of the WTV chip though I still haven't worked out whether it is compatible with being hooked to a SD card to play like the 20 pin variant of the chip in the WTV-020-SD module can. I guess there is some firmware on the WTV chip itself that affects its configuration / version but I haven't gotten into it much. I was just thinking of designing a custom PCB with just the chip and a SD card instead of the module and wasn't sure if either the 16pin or 20 pin chips would work and what other considerations there may be. The data sheet I've seen isn't that clear. Who makes the chip itself anyway? Got a web link?

  6. What's the lowest cost host board for these modules you might use if you're going to want to use it with something like an AVR/ATMEGA MCU, maybe a small rechargeable battery, voltage regulator, etc. in any larger quantity of units? The arduino's I've seen are a little large physically and costly in the case of needing dozens or hundreds of units and of course still aren't quite plug and play in interfacing to a module like this.

One comment about the use of diodes like 1n400x to convert 5V to 3.3V compatible power supplies and for logic levels. It is a horrible idea, speaking as a professional electrical engineer. For power supplies you should use a regulator like the LM317 or any of a wide number of LDO or DC-DC switching regulators to convert 5V to a stable 3.3V level, not just a couple diodes. For logic signals I would suggest using something like a 3.3kohm series resistor followed by the anode of a signal diode like 1N914 / 1N4148 whose cathode is connected to the 3.3V positive power supply if you are not going to use a logic level conversion chip. Many cases exist where the series diodes will still allow the output side voltage to climb too high and maybe damage the 5V intolerant 3.3V nominal circuitry unless the 3.3V circuitry has a consistently high current draw so that enough voltage will always drop across the series diodes to cause them to have the correct voltage drop.

Thanks in advance!

lu9jmg:
Busy pin is not always detected when using synchronous playback (playVoice), so add a delay of 50 ms before the detection of busyPin.
Add delay(50) in the line 42 of Wtv020sd16p.cpp

Good Luck!

I think that could solve the problem, but according to the manual, only 20 ms will do the job. I will test it and add that to the library, so nobody have to add code.

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!!!

You can't. It is hardwired on those modules.

SIR I JUST WANT TO ASK THE CONNECTIONS OF PINS OF THE WTV020 TO THE ARDUINO OF YOUR SAMPLE PROGRAM..

AND THE CONNECTIONS OF THE SPEAKER IN WTV020 MODULE OF YOUR SAMPLE PROGRAM.. THANKS...

SCHEMATICS SIR PLEASE.. :astonished:

1st page second post shows how to hook up the module. :wink:

MAY I ASK SIR WHAT SHOULD I DO FOR THE P02,P03 AND P07 CONNECTIONS?

MY CIRCUIT DONT WORK.. AND THERE SEEMS TO HAVE AN ERROR IN THE PROGRAM? THANKS!

For the pins you mention:

  1. You can hook them up to buttons like the schematic shows, for manual control of tracks.
  2. You can leave them disconnected and unused (maybe use 0.1uf ceramic cap to grnd).

As for the program you are using and what you are trying to accomplish, you must post that if you want help with it.

And please stop SHOUTING. :wink:

i cant get my own soundfiles to work with this module.
Can anyone tell me the exact settings to convert an mp3 into an ad4 file?
Must the mp3 mono? Which sampletype? Bitrate and so on must the source mp3 or wav??
the original sample files works fine!!

Hey.
I can't download library in this topic.
Link isn't working:
"Error 503 Service Unavailable"
Where can i download this Library?

I'm having the same issue, can anyone that has it re-upload the library?