Arduino Forum

Using Arduino => Audio => Topic started by: onesky on Jun 20, 2012, 08:26 pm

Title: cheap sound module: what version is this?
Post by: onesky on Jun 20, 2012, 08:26 pm
today i received this sound modules i ordered on ebay hong kong (http://www.ebay.com/itm/160806790230?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649), they should accept serial commands as confirmed by the seller. What i don't understand is the version i got. On the ebay auction it was showed the "V1.4" and the description says "DC2.5 ~ 4.5V"

(http://t4.pixhost.org/thumbs/1328/13017062_img_0061.jpg) (http://www.pixhost.org/show/1328/13017062_img_0061.jpg)

Now this board shows "V1.5 / 2012.01.12", and "5v  / 3.3v"

that means i can power it via arduino 5v?

someone have the right datasheet for this version? i have found this one (http://www.google.it/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CFQQFjAA&url=http%3A%2F%2Fwww.emartee.com%2FAttachment.php%3Fname%3D41540.pdf&ei=bxbiT6yxG4-f-QaXg7G2Aw&usg=AFQjCNGJW4Lth46KE0-rEDxpvJ_nuMRthA) but it's outdated.

I sent an email to the seller, waiting the response.
Title: Re: cheap sound module: what version is this?
Post by: johnwasser on Jun 21, 2012, 02:43 am
From the picture I see it has a solder jumper for selecting between 5V and 3.3V (currently set to 3.3)

Looks like only 6 of the 8 pins on each side are populated.

The pinout seems to match this (pretty crappy) document for the WTV020-SD-16P:

http://www.elechouse.com/elechouse/images/product/MP3%20Sound%20Mini%20SD%20Card%20Module/MP3%20Mini%20SD%20Card%20Module.pdf
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jun 21, 2012, 01:36 pm
thanks for your exam
do you think if i change the solder of the jumper to the 5volts, it will burn when connected to the arduino 5v?

or can i use a resistor to power it at 3.3volts with arduino?

Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jun 21, 2012, 05:03 pm
Don't Arduino nano have a 3.3v output?
Title: Re: cheap sound module: what version is this?
Post by: johnwasser on Jun 21, 2012, 05:14 pm
> Do you think if i change the solder of the jumper to the 5volts, it will burn when connected to the arduino 5v?

I think you should change the jumper to 5V if you are going to use 5V power and logic.

> Can i use a resistor to power it at 3.3volts with Arduino?

You CANNOT use a resistor on the power line to regulate voltage.  Either use 5V power or 3.3V power.  Set the solder jumper to match.
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jun 22, 2012, 01:17 pm

Don't Arduino nano have a 3.3v output?
yes but .. "when running on external (non-USB) power, the 3.3V output (which is supplied by the FTDI chip) is not available"
http://arduino.cc/en/Main/ArduinoBoardNano

so i think i will try to change the solder to the 5volts pin as suggested by Johnwasser (thank you)
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jun 27, 2012, 09:28 pm
edited.
Title: Re: cheap sound module: what version is this?
Post by: JM33 on Jun 28, 2012, 01:22 pm
I have similar problem with yours and  I find an alternative. This module playbacks directly mp3 files in stereo. Without the need to convert. 
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 09, 2012, 04:47 pm
Got the same one. Which brand of SD card are you using?
Title: Re: cheap sound module: what version is this?
Post by: xl97 on Jul 10, 2012, 07:26 pm
Im confused... :)

the one you have pic of...'looks' like it uses micro SD?  (uSD socket?)

is this correct?


the hong kong store/link..looks like it uses a regular (larger) SD card?   is this correct?


Id like to get one if its microSD...

let me know.

thanks!
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 10, 2012, 07:29 pm
Mini is just a name, It uses a micro-sd card. Bought the same from that link.
Title: Re: cheap sound module: what version is this?
Post by: xl97 on Jul 10, 2012, 07:45 pm
mini?

I just wanted to confirm that is didnt use NORMAL (large) sized SD card.. and did, in fact use the micro SD card..

the pics were bit deceiving..

good to knwo it 'does' use all SMD copoennts & uses a micro SD card..

(going to order 1 or 2)..

anyone get theirs up and running yet? would be interested looking at the code/interface (class functions) used/created.

Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 10, 2012, 08:39 pm
I said mini cause eBay listing says mini. In the other hand, we are in the same boat. If I am lucky today, will be able to get a 1gb micro card to test the board tonight. Keep you posted.
Title: Re: cheap sound module: what version is this?
Post by: xl97 on Jul 10, 2012, 11:16 pm
ahh...got it.

I assume you guys are going to try using the 2-Line Serial Communication protocol?

Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 12, 2012, 06:20 am
plugged everything and nothing. Just the led blinking twice and later, just keeps on. I assume that he is not reading the card cause I erased everything from the sd card and still doing the same.
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 12, 2012, 08:33 pm
mine is not working too
maybe i connected it wrong to the arduino or maybe it doesnt support 5volts or maybe the skecth i used was wrong, or maybe the files must be mp3. There are very few informations on this module combined with arduino.

i used this scheme  (except for the 5v power) to connect it to analog A3 A4 A5arduino pins

(http://img560.imageshack.us/img560/7879/1wto.jpg)

(http://img137.imageshack.us/img137/5750/wtsdf.jpg)
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 12, 2012, 08:38 pm
Will try that this night. I am using these audio files already converted to ad4

http://www.4dsystems.com.au/downloads/Audio-Sound-Modules/SOMO-14D/Docs/AD4-sample-files.zip

Tried mp3 control mode, as I told you via pm and did not work cause the module is hardwired to work 2 serial line mode. I am also using "kingstone" micro sd card brand. I am pretty sure they are fake, but vendor told me that any brand will be fine.
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 12, 2012, 08:42 pm
i also followed the very confusing informations here:
http://emartee.com/product/41540/MP3%20Sound%20Module%20Mini%20SD%20Card

and used this test sketch with the appropriate AD4 sound file loaded on the microsd 1gb card and named 0000.ad4
http://yapan.googlecode.com/svn/trunk/arduino/examples/SOMO_14D_Test/SOMO_14D_Test.pde

but it keeps silent
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 12, 2012, 08:45 pm
What about the busy light? What about its behavior?
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 12, 2012, 08:48 pm
i dont remember, i tested weeks ago

we must test all kind of files: wav, ad4, mp3

should connect also the led blinking status on the module to see if it's working

we should know if the connection scheme as showed above is correct (connected to the analog pins of arduino) and if the skecth test is ok

that means we need help
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 12, 2012, 08:52 pm
Will test all this night, but I am pretty sure this module will only play certain ad4 and Wav files encoded in the right rate. As read in other websites, this one and somo-14d shares the same IC so connection diagram should be fine, even the sketch program should be correct. Your problem was the Vcc and mine the connection. Keep you posted. We are in the same boat. And If anybody have this working, we will really appreciate any help.
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 12, 2012, 08:54 pm
from the link above i downloaded also this test program, next time i will try this

Code: [Select]

/*
  Control Arduino Wave
*/
int RST = A3;
int CLK = A4;
int DAT = A5;
   
   
void setup() {   
   
   
    pinMode(RST, OUTPUT);
    pinMode(CLK, OUTPUT);
    pinMode(DAT, OUTPUT);
   
   
    digitalWrite(RST, HIGH);
    digitalWrite(CLK, HIGH);
    digitalWrite(DAT, HIGH);
   
    digitalWrite(RST, LOW);
    delay(5);
    digitalWrite(RST, HIGH);
    delay(300);
}

void loop() {

  send(0x0000);
  delay(60000);
  send(0x0001);
  delay(60000);
  send(0x0002);
  delay(60000);
  while(1);
}
void send(int addr)
{
  digitalWrite(CLK, LOW);
  delay(2);
  for (int i=15; i>=0; i--)
  {
    delayMicroseconds(50);
    if((addr>>i)&0x0001 >0)
      {
        digitalWrite(DAT, HIGH);
        //Serial.print(1);
      }
    else
       {
         digitalWrite(DAT, LOW);
        // Serial.print(0);
       }
    delayMicroseconds(50);
    digitalWrite(CLK, HIGH);
    delayMicroseconds(50);
   
    if(i>0)
    digitalWrite(DAT, LOW);
    else
    digitalWrite(DAT, HIGH);
    delayMicroseconds(50);
   
    if(i>0)
    digitalWrite(CLK, LOW);
    else
    digitalWrite(CLK, HIGH);
  }
 
  delay(20);
}

Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 12, 2012, 09:14 pm

Will test all this night, but I am pretty sure this module will only play certain ad4 and Wav files encoded in the right rate. As read in other websites, this one and somo-14d shares the same IC so connection diagram should be fine, even the sketch program should be correct. Your problem was the Vcc and mine the connection. Keep you posted. We are in the same boat. And If anybody have this working, we will really appreciate any help.

i used the somo tool to create the ad4 file
http://www.4dsystems.com.au/prod.php?id=74
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 13, 2012, 01:13 am
Checking the diagram I noticed that A0, AX, etc are only inputs for arduino. How will this woork that way? I do believe that theconnection diagram is wrong and you should use other pins as outputs.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 13, 2012, 02:58 pm
Did all the test using almost every code available and got a few conclusions. A pins are only analog inputs, so you should use any other digital output ( example: 2,3,4 for reset,clock,data). When I turn on the WTV020-SD-mini-16P, the busy light blinks quickly and after a second of so keeps on. I connected the reset, clock and data and reset the board at the setup portion of the code. You should put the rst pin for 5ms down and later wait 300ms before send any command. I noticed that this guy, was able to do something with the  WTV020-SD-20s board:

http://www.vduenasg.blogspot.com.ar/2012/03/wtv020-sd.html

He modified the clock timing, from 200us to 50us to make it work. So, basically I am pretty sure that now is a software problem with the data and clock pins, since I believe the rst function is working. A out the 3.3v problem, the manual states that you can connect two N4007 diodes in serial from a 5v output power. Did not test it yet. Will be playing with this modified code:

Code: [Select]
/*
  SOMO-14D Test
  Control a SOMO-14D module to play sounds

  Reference
  http://www.4dsystems.com.au/prod.php?id=73

  Created 20 October 2009
  By Shigeru Kobayashi
*/

const int clockPin = 2;  // the pin number of the clock pin
const int dataPin = 3;  // the pin number of the data pin
const int resetPin = 4;  // the pin number of the reset pin

const unsigned int VOLUME_0 = 0xFFF0;
const unsigned int VOLUME_1 = 0xFFF1;
const unsigned int VOLUME_2 = 0xFFF2;
const unsigned int VOLUME_3 = 0xFFF3;
const unsigned int VOLUME_4 = 0xFFF4;
const unsigned int VOLUME_5 = 0xFFF5;
const unsigned int VOLUME_6 = 0xFFF6;
const unsigned int VOLUME_7 = 0xFFF7;

const unsigned int PLAY_PAUSE = 0xFFFE;
const unsigned int STOP = 0xFFFF;

void setup() {
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
  pinMode(resetPin, OUTPUT);

  digitalWrite(clockPin, HIGH);
  digitalWrite(dataPin, LOW);

  // reset the module
  digitalWrite(resetPin, HIGH);
  delay(100);
  digitalWrite(resetPin, LOW);
  delay(5);
  digitalWrite(resetPin, HIGH);
  delay(300);

  sendCommand(VOLUME_7);
}

void loop() {
  // play "0000.ad4"
  sendCommand(0x0000);
  delay(1000);

  // play "0001.ad4"
  sendCommand(0x0001);
  delay(1000);

  // stop playing
  sendCommand(STOP);
  delay(1000);
}

void sendCommand(unsigned int command) {
  // start bit
  digitalWrite(clockPin, LOW);
  delay(2);

  // bit15, bit14, ... bit0
  for (unsigned int mask = 0x8000; mask > 0; mask >>= 1) {
    if (command & mask) {
      digitalWrite(dataPin, HIGH);
    }
    else {
      digitalWrite(dataPin, LOW);
    }
    // clock low
    digitalWrite(clockPin, LOW);
    delayMicroseconds(50);

    // clock high
    digitalWrite(clockPin, HIGH);
    delayMicroseconds(50);
  }

  // stop bit
  delay(2);
}
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 13, 2012, 05:12 pm
at this point i am not even sure wich one is Pin 1

A or B?

(http://img19.imageshack.us/img19/930/1pin.jpg)
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 13, 2012, 05:40 pm
Def A is pin # 1. That's the way I tried.
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 13, 2012, 06:31 pm
then my wiring wrong was wrong
now i turned into A

i loaded the sketch
http://yapan.googlecode.com/svn/trunk/arduino/examples/SOMO_14D_Test/SOMO_14D_Test.pde

i changed variables into analog
Code: [Select]
const int clockPin = A4;  // the pin number of the clock pin
const int dataPin = A5;  // the pin number of the data pin
const int resetPin = A3;  // the pin number of the reset pin


i loaded the wav files 
0000.wav
0001.wav

i turned on the board and i could listen a sound, very short, distorted and not as original.

but it's a step forward. Now i will try to change wave formats
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 13, 2012, 06:46 pm
Hurray, good for you. I just heard a small noise. What do you mean you turned the pins to Analog? Are you still using A pins as clock, rst, and dta?
You were using Arduino nano right? Ask you this cause since I am using UNO, will have to put some resistors between rst,clock and dta pins. Cause UNO high value is 5v and I think WTV020-SD-16P is 3.3v.
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 13, 2012, 07:11 pm
i am using the analog pins on Nano as the scheme above
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 13, 2012, 07:16 pm
How is this working to you eludes me. Cause A pins are only inputs, no outputs. There is no way to Arduino UNO to set those as outputs. At least It is compiling to you. And the sound you mentioned, should be the same pitch audio tone I got.
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 13, 2012, 07:21 pm
i tested other wav files lower quality and it works fine. Now i must understand the exact max quality wav format.

where did u read that analog pins can be only input?
with these commands they work as output

pinMode(clockPin, OUTPUT);
 pinMode(dataPin, OUTPUT);
 pinMode(resetPin, OUTPUT);


i confirm also that the 5volts soldered pin works fine too.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 13, 2012, 07:28 pm
According to the manual: Sampling rate from 6KHz 16KHz for WAV voice format

Just read Arduino UNO specs and they are labeled as analog inputs. Did not know they could be used as outputs. Makes sense If working for you and did not get any compilation or run-time error.

What about the busy light indicator?

PS: Good to know about the 5V, cause will solve a lot of problems for me too.
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 13, 2012, 08:13 pm
according to ebay description
"can play WAV/AD4 format 6K ~ 32K sampling rate of audio, comparable to 44KHz sound quality MP3 format;"

but the manual and ebay dont say the bit rate, just the KHz

the busy led of arduino blinks 3 or 4 times then stop.

you can test the audio board if it's working connecting a led to the Pin16_VDD (+) and Pin15_P06 (-)

i attached the wav file that worked on mine, i still have to find out the right format
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 13, 2012, 08:23 pm
I really appreciate your time. So, were you able to test "test" ad4 files from Somo website? Or they did not work for you and you created that wav file? And about the bit rate, I do believe than conversion tool will take care of that right? I did not use it yet.
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 13, 2012, 08:52 pm
ad4 dind work, maybe sample rate was not ok

now i am experiencing a problem, the board doesnt play anymore wav files, if i connect the led to the board it plays but very very slowly

something went wrong but i dont understand what.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 13, 2012, 08:57 pm
You mean the volume is so low? Cause I read that defaul value is 0 and most of the sketches I read set it 7 from from very beginning. Attached a ad4 in 32Khz made with the conversion tool. Could you test it?
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 13, 2012, 09:51 pm
i mean slow speed

i loaded your file, i can listen a sound but i don't understand what is it..? seems a buzzz from a walky talky

these are the features on the v1.3 manual

?Support 1GB SD card max. or SPI flash 64MB max.
?Support 4 Bit ADCPM format files.
?Sampling rate from 6kHZ to 36KHZ for AD4 voice format.
?Sampling rate from 6KHz?16KHz for WAV voice format
?16 Bit DAC / PWM audio output.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 13, 2012, 10:14 pm
Try this application:
http://4d.websitetoolbox.com/post/show_single_post?pid=37039279&postcount=2

and the ad4 was DaftPunk song. ;)
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 13, 2012, 10:27 pm
files must be 4bit encoded in AD4 format too
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 13, 2012, 10:53 pm
Encoded the attached file in 32Khz 4bit. It was a mono wav file before from Windows SO.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 14, 2012, 06:19 am
I give up. Tried everything but change from 3.3v to 5v VDD. I am so tired of this board. I would love to see a video of it working, cause I hardly believe this is working anywhere but Italy dude. Have been 3 nights and nothing. Could at least, If you don't mind, upload a video or photo? I mean, It will be useful to check the busy led and the behavior.

Just to be clear, you changed from 3.3v to 5v, and you are NOT using any resistor for pin rst, dta or clk right? It is the only thing that remains to change in my configuration to give up definitely. It is so frustrating.
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 14, 2012, 01:26 pm
i wouldn't give up rebel-agent, the module works, just check again all connections, pins, code used and i would change the soldered pin to 5volts

i am not using any resistor

what i understood of this board:

1. seems it doesnt play the 0000 named file (starts playing 0001)
2. if i connect to analog pins of arduino it plays some sounds fine while other doesn't play correctly
3. if i connect to digital pins of arduino it plays sounds fine
4. it needs around 1 second of delay at startup.
5. needs to add the exact lenght time of each track using "delay" command

video test here: http://www.youtube.com/watch?v=hCRpr2SnBac

code used on the video test:
Code: [Select]
/*
 SOMO-14D Test
 Control a SOMO-14D module to play sounds

 Reference
 http://www.4dsystems.com.au/prod.php?id=73

 Created 20 October 2009
 By Shigeru Kobayashi
*/

const int clockPin = 6;  // the pin number of the clock pin
const int dataPin = 9;  // the pin number of the dataPin pin
const int resetPin = 3;  // the pin number of the reset pin

const unsigned int VOLUME_0 = 0xFFF0;
const unsigned int VOLUME_1 = 0xFFF1;
const unsigned int VOLUME_2 = 0xFFF2;
const unsigned int VOLUME_3 = 0xFFF3;
const unsigned int VOLUME_4 = 0xFFF4;
const unsigned int VOLUME_5 = 0xFFF5;
const unsigned int VOLUME_6 = 0xFFF6;
const unsigned int VOLUME_7 = 0xFFF7;

const unsigned int PLAY_PAUSE = 0xFFFE;
const unsigned int STOP = 0xFFFF;

void setup() {
 pinMode(clockPin, OUTPUT);
 pinMode(dataPin, OUTPUT);
 pinMode(resetPin, OUTPUT);

 digitalWrite(clockPin, HIGH);
 digitalWrite(dataPin, LOW);

 // reset the module
 digitalWrite(resetPin, HIGH);
 delay(100);
 digitalWrite(resetPin, LOW);
 delay(10);
 digitalWrite(resetPin, HIGH);
 delay(100);

 sendCommand(VOLUME_7);
}

void loop() {


 delay(1000);

 // play "0001.wav"
 sendCommand(0x0001);
 delay(4000);
 
   // play "0002.wav"
 sendCommand(0x0002);
 delay(4000);
 
 
   // play "0003.wav"
 sendCommand(0x0003);
 delay(6000);
 
   // play "0004.wav"
 sendCommand(0x0004);
 delay(6000);
 

 // stop playing
 sendCommand(STOP);
 delay(1000);
}

void sendCommand(int addr) {
digitalWrite(clockPin, LOW);
 delay(2);
 for (int i=15; i>=0; i--)
 {
   delayMicroseconds(50);
   if((addr>>i)&0x0001 >0)
     {
       digitalWrite(dataPin, HIGH);
       //Serial.print(1);
     }
   else
      {
        digitalWrite(dataPin, LOW);
       // Serial.print(0);
      }
   delayMicroseconds(50);
   digitalWrite(clockPin, HIGH);
   delayMicroseconds(50);
   
   if(i>0)
   digitalWrite(dataPin, LOW);
   else
   digitalWrite(dataPin, HIGH);
   delayMicroseconds(50);
   
   if(i>0)
   digitalWrite(clockPin, LOW);
   else
   digitalWrite(clockPin, HIGH);
 }
 
 delay(20);
}


now, since on my project all the digital pins are busy, i must find out why on analog pins doesn't perform well

any idea?


as stated on arduino site they can be used as digital output as well
Quote
While the main function of the analog pins for most Arduino users is to read analog sensors, the analog pins also have all the functionality of general purpose input/output (GPIO) pins (the same as digital pins 0 - 13).
Consequently, if a user needs more general purpose input output pins, and all the analog pins are not in use, the analog pins may be used for GPIO.

http://arduino.cc/en/Tutorial/AnalogInputPins
Title: Re: cheap sound module: what version is this?
Post by: johnwasser on Jul 14, 2012, 05:20 pm

as stated on arduino site they can be used as digital output as well
Quote
While the main function of the analog pins for most Arduino users is to read analog sensors, the analog pins also have all the functionality of general purpose input/output (GPIO) pins (the same as digital pins 0 - 13).
Consequently, if a user needs more general purpose input output pins, and all the analog pins are not in use, the analog pins may be used for GPIO.

http://arduino.cc/en/Tutorial/AnalogInputPins


One odd quirk you may come across is that on the SMD versions of the ATmega processor where you get A6 and A7 pins, those two CAN'T be used as digital pins.
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 14, 2012, 05:56 pm


as stated on arduino site they can be used as digital output as well
Quote
While the main function of the analog pins for most Arduino users is to read analog sensors, the analog pins also have all the functionality of general purpose input/output (GPIO) pins (the same as digital pins 0 - 13).
Consequently, if a user needs more general purpose input output pins, and all the analog pins are not in use, the analog pins may be used for GPIO.

http://arduino.cc/en/Tutorial/AnalogInputPins


One odd quirk you may come across is that on the SMD versions of the ATmega processor where you get A6 and A7 pins, those two CAN'T be used as digital pins.
yep, i knew that
i use these anaolog pins:

int RST = A3;
int CLK = A4;
int DAT = A5;

i dont' understand why with digital pins the sounds are played correctly, while with these analog pins some sound files are truncated after 1 second or doesn't play at all and stop the board to work.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 14, 2012, 06:27 pm
Only have more bad news. Changed the soldered pin from 3.3v to 5v. Reconnected everything, plus added the busy pin. Used the very same sketch you used and nothing. Later I modified the code to sense the busy pin, cause wanted to know what was going on there. To my surprise, after I reset the module, busy pin keeps HIGH for few seconds ( a bit too much). Later when I read LOW, I start to play the song #0001. I put a loop to play the song until BUSY is LOW and all over again. This is the code:

Code: [Select]
const int resetPin = 2;  // the pin number of the reset pin
const int clockPin = 4;  // the pin number of the clock pin
const int dataPin = 7;  // the pin number of the dataPin pin
const int busyPin = 8;  // the pin number of the busyPin pin

int busyPinState=LOW;

void setup() {
  Serial.begin(9600);
  pinMode(resetPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
  pinMode(busyPin, INPUT);

  digitalWrite(clockPin, HIGH);
  digitalWrite(dataPin, LOW);

  Serial.println("Initializing module.");
  digitalWrite(resetPin, HIGH);
  delay(100);
  digitalWrite(resetPin, LOW);
  delay(5);
  digitalWrite(resetPin, HIGH);
  delay(100);
}

void loop()
{
  Serial.println("Reading busy pin state.");
  busyPinState=digitalRead(busyPin);
  if (busyPinState == LOW) {
    Serial.println("Start playing 0001.wav");
    sendCommand(0x0001);
    while(busyPinState==HIGH){
      busyPinState=digitalRead(busyPin);
      Serial.println(busyPinState);     
    }
    Serial.println("Stop playing 0001.wav");
  }
  else{   
    Serial.println("Module is busy.");
    delay(1000);
  }
}

void sendCommand(int addr) {
  digitalWrite(clockPin, LOW);
  delay(2);
  for (int i=15; i>=0; i--)
  {
    delayMicroseconds(50);
    if((addr>>i)&0x0001 >0)
    {
      digitalWrite(dataPin, HIGH);
    }
    else
    {
      digitalWrite(dataPin, LOW);
    }
    delayMicroseconds(50);
    digitalWrite(clockPin, HIGH);
    delayMicroseconds(50);
    if(i>0)
    {
      digitalWrite(dataPin, LOW);
    }
    else
    {
      digitalWrite(dataPin, HIGH);
      delayMicroseconds(50);
    }
    if(i>0)
    {
      digitalWrite(clockPin, LOW);
    }
    else
    {
      digitalWrite(clockPin, HIGH);
    }
  }

  delay(20);
}


This is the video I took from this little experiment:

http://www.youtube.com/watch?v=PaYt-kdAwJU

In this video you can see the weird behavior of this board. I don't know If the microSD card is not being read, or the module spk output is dead, or nothing. Don't have a clue of what is going on.
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 14, 2012, 06:43 pm
i don't understand the thing about the busy pin. Just solder a led on the board as showed on the scheme or in my video, and you get your busy led, no need to add anything on the code.

(http://img560.imageshack.us/img560/7879/1wto.jpg)

p.s.
cant see your video, it's private
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 14, 2012, 06:54 pm
Try again here:
http://www.youtube.com/watch?v=PaYt-kdAwJU

and about the busy pin, the manual says that when the module is playing the voice/song the busy pin is in HIGH or 1. Was trying to know IF this little one was working or not.
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 14, 2012, 07:08 pm
i see your video, from what i can perceive from the quality of the video, connections seem ok
are you sure about the bredboard connections? i still didnt use that before so i can't say anything about it.
what wav files are you testing? did you test my code without your busy pin adds?

these are my connections:

(http://img839.imageshack.us/img839/975/arduinosound.jpg)

these are my files
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 14, 2012, 07:24 pm
I really appreciate your help. Yes, tried your code first, without the busy pin as input, and later added for debugging purposes. Downloaded your wav files and will test them right away. Using same pin out as you actually and the breadboard is brand new so I think that's ok. Keep you posted. And about your analog pins problems, will be very helpful to connect an oscilloscope to check the signals. ;)
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 14, 2012, 07:36 pm
Tried your very same code, modifying the pins #s, and your WAV files and nothing. Same erratic behavior. At this point I believe the module is not working or the sd card is not being read. Were you able to try my code?
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 14, 2012, 07:53 pm
no i didnt try. Did u format the card in FAT ? did you try the same arduino pins of my code? they are pwm.

i can suggest you to test the connections between the breadboard pins and the arduino with a tester
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 14, 2012, 08:13 pm
Actually formatted them twice. With Windows and Linux in FAT16. Will try all over again and tell you.
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 14, 2012, 08:37 pm
read also comments and links here:
http://www.sparkfun.com/products/9534

i will try to add resistors on analog pins, even if are equipped with pullup resistors

Quote

Pullup resistors

The analog pins also have pullup resistors, which work identically to pullup resistors on the digital pins. They are enabled by issuing a command such as

digitalWrite(A0, HIGH);  // set pullup on analog pin 0

Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 14, 2012, 08:46 pm
No luck here, even using same pins as you did. :~
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 14, 2012, 09:17 pm
i tested with resistors 30ohm, 180ohm, 1khom
didn't work at all
so no resistors are needed on pins

did you try to change the speaker?
since now i used a 4 watt 16ohm minispeaker
if i connect to the pc microphone i cant listen anything
if i connect to a 3 watt 8ohm speaker the sound stop at beginning
if i connect to headphones i listen the same of 4 watt speaker


Edit:
i converted the wav files into ad4 and now it's working fine also with analog pins!

wav files have a lot of problem with this sound board, better to use AD4 format!

what i converted: wav files sampled at 36khz and saved in wav (pcm unsigned mono 8bit) with Goldwave free software
what program i used for AD4 conversion: Usb Recover free software from SOMO website (http://www.4dsystems.com.au/downloads/Software/SOMO-14D%20Audio%20Converter/4D-SOMO-Tool.zip); used orignal sample rate (36khz)

then i disconnected the speaker and connected the mini-amplifier to AUDIO-L of sound module and to the ground of arduino: very loud volume now!

now the problem:
how to manage these files with Arduino because they play correctly but doesn't respect the order or they skip the first track sometime. Something is wrong with the code!

is this code correct for that wave form?
Code: [Select]
void send(int addr)
{
  digitalWrite(CLK, LOW);
  delay(2);
  for (int i=15; i>=0; i--)
  {
    delayMicroseconds(50);
    if((addr>>i)&0x0001 >0)
      {
        digitalWrite(DAT, HIGH);
        //Serial.print(1);
      }
    else
       {
         digitalWrite(DAT, LOW);
        // Serial.print(0);
       }
    delayMicroseconds(50);
    digitalWrite(CLK, HIGH);
    delayMicroseconds(50);
   
    if(i>0)
    digitalWrite(DAT, LOW);
    else
    digitalWrite(DAT, HIGH);
    delayMicroseconds(50);
   
    if(i>0)
    digitalWrite(CLK, LOW);
    else
    digitalWrite(CLK, HIGH);
  }
 
  delay(20);
}


(http://img833.imageshack.us/img833/3146/waveformx.jpg)
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 15, 2012, 12:25 am
for rebel-agent: did u read this forum? maybe your kingston is not compatible?

http://www.picaxeforum.co.uk/showthread.php?13971-Getting-started-with-the-4D-Systems-SOMO-14D-audio-module/page2


i am using a 1gb Sandisk i bought from ebay (maybe a fake)
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 15, 2012, 07:23 am
About the ad4 format, now that is working fine for you: were you able to try SOMO default ad4 files from their website?

About the speaker: A friend of mine loaned me one of those that usually are installed inside a light saber hilt, which I assume are 8 ohms 250 mw, but I am going to check that.

About the memory: 1 GB cards are almost at the border of the extinction, so they are not easy to get nowadays. Will track another brand to test.

About the sendCommand source code, I am not sure that code is perfect. Since my board is not working, I am not able to test it. Will be refining it once my board is working. And obviously will be sharing it here.

PS: Some asserts:
1-My speaker is 8 ohm 1w.
2-About the signal, this documents xplains very clear how should work:
http://www.embeddedadventures.com/datasheets/MOD-1007_hw_v4.pdf
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 15, 2012, 03:03 pm

About the ad4 format, now that is working fine for you: were you able to try SOMO default ad4 files from their website?

just tested, they all work fine
i also found the problem with track order list; i fixed adding the STOP command after each track

i fixed the volume command, adding a delay of 600 at startup. It needs time to elaborate..

this is my edited program

Code: [Select]
/*
 SOMO-14D Test
 Control a SOMO-14D module to play sounds

 Reference
 http://www.4dsystems.com.au/prod.php?id=73

 Created 20 October 2009
 By Shigeru Kobayashi
*/

const int clockPin = A4;  // the pin number of the clock pin
const int dataPin = A5;  // the pin number of the dataPina pin
const int resetPin = A3;  // the pin number of the reset pin

const unsigned int VOLUME_0 = 0xFFF0;
const unsigned int VOLUME_1 = 0xFFF1;
const unsigned int VOLUME_2 = 0xFFF2;
const unsigned int VOLUME_3 = 0xFFF3;
const unsigned int VOLUME_4 = 0xFFF4;
const unsigned int VOLUME_5 = 0xFFF5;
const unsigned int VOLUME_6 = 0xFFF6;
const unsigned int VOLUME_7 = 0xFFF7;

const unsigned int PLAY_PAUSE = 0xFFFE;
const unsigned int STOP = 0xFFFF;

void setup() {
 pinMode(clockPin, OUTPUT);
 pinMode(dataPin, OUTPUT);
 pinMode(resetPin, OUTPUT);

 digitalWrite(clockPin, HIGH);
 digitalWrite(dataPin, LOW);

 // reset the module
 digitalWrite(resetPin, HIGH);
 delay(100);
 digitalWrite(resetPin, LOW);
 delay(10);
 digitalWrite(resetPin, HIGH);
 delay(100);
 delay(500);

}

void loop() {
 sendCommand(0xFFF6);
 // play "0000.ad4"
 sendCommand(0x0001);
 delay(5000);
     sendCommand(STOP);

 // play "0001.ad4"
 sendCommand(0x0002);
 delay(5000);
     sendCommand(STOP);

 // play "0001.ad4"
 sendCommand(0x0003);
 delay(6000);
   sendCommand(STOP);
 
   // play "0001.ad4"
 sendCommand(0x0004);
 delay(5000);
     sendCommand(STOP);
 
   // play "0001.ad4"
 sendCommand(0x0005);
 delay(9000);
   sendCommand(STOP);
     sendCommand(0x0003);
 delay(1000);
   sendCommand(STOP);
     sendCommand(0x0003);
 delay(1000);
   sendCommand(STOP);
 delay(1000);
}

void sendCommand(int addr)
{
 digitalWrite(clockPin, LOW);
 delay(2);
 for (int i=15; i>=0; i--)
 {
   delayMicroseconds(200);
   if((addr>>i)&0x0001 >0)
     {
       digitalWrite(dataPin, HIGH);
       //Serial.print(1);
     }
   else
      {
        digitalWrite(dataPin, LOW);
       // Serial.print(0);
      }
   delayMicroseconds(200);
   digitalWrite(clockPin, HIGH);
   delayMicroseconds(200);
   
   if(i>0)
   digitalWrite(dataPin, LOW);
   else
   digitalWrite(dataPin, HIGH);
   delayMicroseconds(200);
   
   if(i>0)
   digitalWrite(clockPin, LOW);
   else
   digitalWrite(clockPin, HIGH);
 }
 
 delay(30);
}


now next step is the button command to simulate the gun fire sound.
If it will pass the test i will replace the more expensive mp3 WTM-SD module whit this one in my Open Blaster Project.
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 15, 2012, 04:45 pm
my 2° video test and conclusion:

http://www.youtube.com/watch?v=v71YSc0XF3g
code used in this test
Code: [Select]
/*
  SOMO-14D Test
  Control a SOMO-14D module to play sounds

  Reference
  http://www.4dsystems.com.au/prod.php?id=73

  Created 20 October 2009
  By Shigeru Kobayashi
*/

const int clockPin = A4;  // the pin number of the clock pin
const int dataPin = A5;  // the pin number of the dataPina pin
const int resetPin = A3;  // the pin number of the reset pin

const int buttonPinFire = 8;   // FIRE
const int ledPin = 11;      // LED FIRE (RED)

const unsigned int VOLUME_0 = 0xFFF0;
const unsigned int VOLUME_1 = 0xFFF1;
const unsigned int VOLUME_2 = 0xFFF2;
const unsigned int VOLUME_3 = 0xFFF3;
const unsigned int VOLUME_4 = 0xFFF4;
const unsigned int VOLUME_5 = 0xFFF5;
const unsigned int VOLUME_6 = 0xFFF6;
const unsigned int VOLUME_7 = 0xFFF7;

const unsigned int PLAY_PAUSE = 0xFFFE;
const unsigned int STOP = 0xFFFF;

int buttonState = 0;         // current state of the button

void setup() {
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
  pinMode(resetPin, OUTPUT);
 
  pinMode(buttonPinFire, INPUT);
  pinMode(ledPin, OUTPUT);
 
  digitalWrite(ledPin, LOW);

  digitalWrite(clockPin, HIGH);
  digitalWrite(dataPin, LOW);

  // reset the module
  digitalWrite(resetPin, HIGH);
  delay(100);
  digitalWrite(resetPin, LOW);
  delay(10);
  digitalWrite(resetPin, HIGH);
  delay(100);
  delay(500);
sendCommand(0xFFF6);
}

void loop() {
  buttonState = digitalRead(buttonPinFire);
  if (buttonState == HIGH) {

   
  // play "0000.ad4"
  sendCommand(0x000);
   digitalWrite(ledPin, HIGH);
     delay(50);
    digitalWrite(ledPin, LOW);
    delay(150);


}
}
void sendCommand(int addr)
{
  digitalWrite(clockPin, LOW);
  delay(2);
  for (int i=15; i>=0; i--)
  {
    delayMicroseconds(200);
    if((addr>>i)&0x0001 >0)
      {
        digitalWrite(dataPin, HIGH);
        //Serial.print(1);
      }
    else
       {
         digitalWrite(dataPin, LOW);
        // Serial.print(0);
       }
    delayMicroseconds(200);
    digitalWrite(clockPin, HIGH);
    delayMicroseconds(200);
   
    if(i>0)
    digitalWrite(dataPin, LOW);
    else
    digitalWrite(dataPin, HIGH);
    delayMicroseconds(200);
   
    if(i>0)
    digitalWrite(clockPin, LOW);
    else
    digitalWrite(clockPin, HIGH);
  }
 
  delay(30);
}


1. the sound board connected to the mini amplifier generates a lot of background noises, needs attenuator!
2. there is some lag between the button  pressed and emitted sound
3. if button is pressed more than once, the board soon stop to work correctly

conclusion:
i will not include this board on my Blaster project, i will keep the more expensive (and bigger sic) WTM-SD mp3 sound module.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 15, 2012, 06:06 pm
I really love you work, but I think the bug is in the source code, which I love to fix IF my sound module were working for me. Reading the manuals carefully, I read that after reset the board, you should wait a certain time to let the module to read the sd card. About 300ms. But I am not sure, If this time is always the same or depends of the quantity of voices stored in the card. This is why you should include the reading of the busy pin to know when the module is available to play the next voice. After that, every time you send a command, you should wait until is available for the next track. If not, you will be stopping the current voice. Have to test and debug a good library once I get my new memory card. Keep you posted but I must say u r doing an amazing job with that blaster.
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 15, 2012, 06:30 pm
thanks rebel-agent
i am sure the transmission code can be improved, but as you see it's only me and you here.. nobody help ..
and it's strange because this card is very cheap and mount a very popular IC (WTV020-SD) wich is the same we find in more expensive audio modules that do the same things (such as SOMO14)

anyway the transmission protocol is the I2C wich needs its specific code in the program.

The other sound module (http://www.emartee.com/Attachment.php?name=41932.pdf) i tested in my Project use Standard RS232 serial communication, decoded by arduino ATmega8U2 USB-to-TTL Serial chip.

That means only the corresponding RX pin is used on Arduino and no additionl code is needed. The only down side of that module is the Mp3 format: that compression needs always a very small pause at beginning of each track.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 16, 2012, 05:19 am
I was able to score two original uSD cards, one Kingstone and a Sandisc in our local eBay site. Will be collecting them in these days. Keep you posted. Getting crazy to get my hands on them. That WTM-SD CARD MODULE was manufactured by the same guys that WTV020-SD series. Will keep you posted about any mod or improvement I do.
Title: Re: cheap sound module: what version is this?
Post by: karan2012singh on Jul 16, 2012, 11:13 am
i have a two pin microphone...and i want that microphone listens to my clap,and then arduino process this audio to do some action.... plzz help,how to connect and how to do that....
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 16, 2012, 10:18 pm

i have a two pin microphone...and i want that microphone listens to my clap,and then arduino process this audio to do some action.... plzz help,how to connect and how to do that....

Please check here, http://www.dtic.upf.edu/~jlozano/interfaces/blow_sensor.html. But I do think this was not the place to post that question. :smiley-roll:
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 17, 2012, 08:06 am
As Anakin would say: Is working! Is working! The problem was the microSD card from the very beginning.

http://www.youtube.com/watch?v=AheImnEsvTc

Source code here:

Code: [Select]
/*
  WTV020-SD-16P Test
  Control a WTV020-SD-16P module to play sounds from an Arduino UNO.
*/

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

int busyPinState = HIGH;

void setup() {
  pinMode(resetPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
  pinMode(busyPin, INPUT);

  digitalWrite(resetPin, HIGH);
  digitalWrite(clockPin, HIGH);
  digitalWrite(dataPin, LOW);
}

void loop() {
  playSong(0x0000);
  playSong(0x0001);
  playSong(0x0002);
  playSong(0x0003);
  playSong(0x0004);
}

void playSong(int trackNumber){
  resetModule();
  sendCommand(trackNumber);
  busyPinState=digitalRead(busyPin);
  while(busyPinState==HIGH){
    busyPinState=digitalRead(busyPin);
  }
}

void resetModule(){ 
  digitalWrite(resetPin, LOW);
  delay(5);
  digitalWrite(resetPin, HIGH);
  delay(300);
}

void sendCommand(int address)
{
  digitalWrite(clockPin, LOW);
  delay(2);
  for (int mask=15; mask>=0; mask--)
  {
    delayMicroseconds(200);
    if((address>>mask)&0x0001 >0)
    {
      digitalWrite(dataPin, HIGH);
    }
    else
    {
      digitalWrite(dataPin, LOW);
    }
    delayMicroseconds(200);
    digitalWrite(clockPin, HIGH);
    delayMicroseconds(200);
    if(mask>0)
    {
      digitalWrite(dataPin, LOW);
    }
    else
    {
      digitalWrite(dataPin, HIGH);
      delayMicroseconds(200);
    }
    if(mask>0)
    {   
      digitalWrite(clockPin, LOW);
    }
    else
    {   
      digitalWrite(clockPin, HIGH);
    }
  }
  delay(29);
}


This code plays the songs synchronously. It means you don't need to know the length of each track cause I implemented the busy pin. I know some of you are running out of inputs/outputs, but there is not other way to use this sound module. sendCommand void is not perfect yet, but now that I have my board working, I will be fixing it.This is why you have to reset the module before play each song, to synchronize the Arduino and the sound module to receive the proper address. If you don't want to use the busy pin, will have to use delay(), which I found an horrible way to control your sound module. Hope this helps.
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 17, 2012, 05:23 pm
finally! the sd card was the last try to get it work and u made it ;)
now happy work on code!
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 18, 2012, 05:46 am
yeah, finally. I was really tired, but as usual, did work after I changed the first thing I thought It was wrong. Tonight, I put a new original Kingstone and did not work. Had reading problems I think. So, so far, original or not, did not like Kingstone at all. The only memory that seems to work is Sandisc 1gb. Skyone, you were trying with that very same memory right?
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 18, 2012, 06:53 am
Firing a laser gun:

http://www.youtube.com/watch?v=DOMBtW3PMeo

Code: [Select]
/*
  WTV020-SD-16P Test
Control a WTV020-SD-16P module to play sounds from an Arduino UNO.
*/

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

int busyPinState = HIGH;
int fireButtonPinState = LOW;

void setup() {
  pinMode(resetPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
  pinMode(busyPin, INPUT);
  pinMode(fireButtonPin, INPUT);

  digitalWrite(resetPin, HIGH);
  digitalWrite(clockPin, HIGH);
  digitalWrite(dataPin, LOW);
}

void loop() {
  fireButtonPinState=digitalRead(fireButtonPin);
  if (fireButtonPinState==HIGH){
    playSong(0x0005);
  }
}

void playSong(int trackNumber){
  resetModule();
  sendCommand(trackNumber);
  busyPinState=digitalRead(busyPin);
  while(busyPinState==HIGH){
    busyPinState=digitalRead(busyPin);
  }
}

void resetModule(){ 
  digitalWrite(resetPin, LOW);
  delay(5);
  digitalWrite(resetPin, HIGH);
  delay(300);
}

void sendCommand(int address)
{
  digitalWrite(clockPin, LOW);
  delay(2);
  for (int mask=15; mask>=0; mask--)
  {
    delayMicroseconds(200);
    if((address>>mask)&0x0001 >0)
    {
      digitalWrite(dataPin, HIGH);
    }
    else
    {
      digitalWrite(dataPin, LOW);
    }
    delayMicroseconds(200);
    digitalWrite(clockPin, HIGH);
    delayMicroseconds(200);
    if(mask>0)
    {
      digitalWrite(dataPin, LOW);
    }
    else
    {
      digitalWrite(dataPin, HIGH);
      delayMicroseconds(200);
    }
    if(mask>0)
    {   
      digitalWrite(clockPin, LOW);
    }
    else
    {   
      digitalWrite(clockPin, HIGH);
    }
  }
  delay(30);
}


I am attaching the ad4 file If you want to try this. Next step, to write a good library for sync and asyn ad4 reproduction.
Title: Re: cheap sound module: what version is this?
Post by: xl97 on Jul 18, 2012, 02:30 pm
good job!..

(time for the E-11)...

(sidenote.. saw you are member on the RFP too!)   (cool!)  (I make sabers sometimes.. with CF's/PC's..etc)

I am also playing with my waveshield (and custom waveplayer + arduino all-in-one board).

trying to get a grip on the code.. and seeing if it can be done a bit more 'seamlessly'..

good job on the sound player module.. (do NOT use .wav files...right?)
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 18, 2012, 02:39 pm
Small world. Thanks for the cumpliments, but this teama work. Indeed can play wav files, but the chip is very pesky about bit rate. Just check previous post about tech info. I would recommend to use ad4 files for this chip.
Title: Re: cheap sound module: what version is this?
Post by: onesky on Jul 18, 2012, 04:04 pm

yeah, finally. I was really tired, but as usual, did work after I changed the first thing I thought It was wrong. Tonight, I put a new original Kingstone and did not work. Had reading problems I think. So, so far, original or not, did not like Kingstone at all. The only memory that seems to work is Sandisc 1gb. Skyone, you were trying with that very same memory right?
yep, i am using a sandisk 1gb, had to buy on ebay because i couldn't find in the shops.



(time for the E-11)...

look here: http://arduino.cc/forum/index.php/topic,109432.0.html


Small world. Thanks for the cumpliments, but this teama work. Indeed can play wav files, but the chip is very pesky about bit rate. Just check previous post about tech info. I would recommend to use ad4 files for this chip.

in the last test i converted into ad4 also wav files encoded at 44100 hz using the option of encoding "as original"
so, it seems it plays also ad4 at 44100 hz
i used the UsbRecorder free software for conversion.
Title: Re: cheap sound module: what version is this?
Post by: xl97 on Jul 18, 2012, 04:36 pm

small world indeed!..

nice E-11 project/work!..

I went a different route, with a custom board based off the Adafruit WaveShield & Arduino (merged together, two boards in one) :)

.75 x 1.85 in size.. (very small)

microSD socket on bottom..
(http://dmstudios.net/misc/scab_assembly/flash_board.jpg)



Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 18, 2012, 04:53 pm
Wow! how much did pay for that? or did you build it yourself? Our sound module is 6 dollars shipping included. You have to put your uSD card.
Title: Re: cheap sound module: what version is this?
Post by: xl97 on Jul 18, 2012, 05:02 pm
Yeah made it myself.. got some pcb's...stencil, placed..etc..etc  & re-flowed in wal-mart toaster oven. ;)

definately not as cheap as $6.00 however..lol

but its also an Arduino as well.. so you need to count that cost as well. :)


I dont know what you mean about the uSD?  (its on the bottom of the board) ;)
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 18, 2012, 05:05 pm
I meant that you have to provide the uSD card. So 6 dollars + uSD card. That's the cost.
Title: Re: cheap sound module: what version is this?
Post by: xl97 on Jul 18, 2012, 05:11 pm
ahh.. got it!  :)


(plus Arduino cost).. 


I think its awesome either way....  $6.00 is great!

I'll need some help tearing apart the WaveHC lib and the demo/examples on Adafruit soon..  to see about a seamless loop possibility..

as well as an 'auto fire' type playing.. if the button is pressed, and held..etc..etc..


(not so good at C code yet..LOL)


Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 18, 2012, 05:13 pm
No problem.
Title: Re: cheap sound module: what version is this?
Post by: ced_french on Jul 19, 2012, 09:36 pm
hello everybody.

I'm french and I'm sorry because my english is very bad.

I need your help: i have the same module. I want to connect to +5V.

My project: use the basicstamp to control this module with the Two-line serial control mode.

i want try this module. In the first time, just with button connect to P2,P3,P4,P5 and P6 is the pin busy.

What is the schematic? What is the audio format with this schematic?

I have a sd cart 8go  but i format this: FAT16 and 990Mo. Is not a problem?

Thank you.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 19, 2012, 09:48 pm
This is the connection diagram:

(http://img560.imageshack.us/img560/7879/1wto.jpg)

I really encourage you to put a LED, cause It will be very useful to know If the module is working on not. About the micro SD card, the only one I got working was a Sandisk 1gb. Don't know about other brands. Since there are no lights to indicate that the module is reading the card, you will have to check that using the Busy LED. If after reset the module, the LED blinks and turn off, sd card was OK. IF you see the busy LED turned on for a while, your SD card was not that lucky and means you will have to replace it. Hope this helps. About 5v Vcc, you can put two diodes 4007 in serial or change the soldered pin from 3.3 to 5.

Title: Re: cheap sound module: what version is this?
Post by: ced_french on Jul 19, 2012, 10:11 pm

This is the connection diagram:

(http://img560.imageshack.us/img560/7879/1wto.jpg)
If after reset the module, the LED blinks and turn off, sd card was OK. IF you see the busy LED turned on for a while, your SD card was not that lucky and means you will have to replace it. Hope this helps. About 5v Vcc, you can put two diodes 4007 in serial or change the soldered pin from 3.3 to 5.


thank you.

ok it's mean I have to replace sd card beause the led stay turn on during 13seconds.

I can use this module just with button? withing arduino module?

thank you and sorry for my english.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 19, 2012, 10:14 pm
Yup, not reading the SD card. There is a seller on eBay from Germany selling Sandisk 1gb micro cards that could possible work If they are original. If you bought the module from the link we did, only serial mode will be enable. Did not try mp3 mode yet, but I assume won't work. Don't worry about your English, I am from Argentina and still after 10 years or more speaking and writing in English, still sucks. ;)
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 20, 2012, 10:17 pm
Have been working in the code for this board. Want to create a library. Since I am not at home right now, I can't test this with my Arduino. Could someone test this for me?

Code: [Select]
/*
  WTV020-SD-16P Test
Control a WTV020-SD-16P module to play sounds from an Arduino board.

Created July 2012.
By Diego J. Arevalo.
*/

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

int busyPinState = HIGH;

void setup() {
  pinMode(resetPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
  pinMode(busyPin, INPUT);
  resetModule();
}

void loop() {
  playSong(0);
  delay(5);
}

void playSong(int trackNumber){
  sendCommand(trackNumber);
  busyPinState=digitalRead(busyPin);
  while(busyPinState==HIGH){
    busyPinState=digitalRead(busyPin);
  }
}

void resetModule(){
  //Reset pulse.
  digitalWrite(resetPin, HIGH); 
  digitalWrite(resetPin, LOW);
  delay(5);
  digitalWrite(resetPin, HIGH);
  //Reset idle to start bit.
  digitalWrite(clockPin,HIGH);
  delay(300);
}

void sendCommand(unsigned int command) {
  //Start bit Low level pulse.
  digitalWrite(clockPin, LOW);
  delay(2);
  for (unsigned int mask = 0x8000; mask > 0; mask >>= 1) {
    //Write data setup.
    if (command & mask) {
      digitalWrite(dataPin, HIGH);
    }
    else {
      digitalWrite(dataPin, LOW);
    }
    //Write data hold.
    delayMicroseconds(50);
    //Clock high level pulse.
    digitalWrite(clockPin, HIGH);
    if (mask > 0x0001){
      delayMicroseconds(100);
      //Clock low level pulse.
      digitalWrite(clockPin, LOW);
      delayMicroseconds(100);
    }
    else{
      //Stop bit high level pulse.
      delay(2);
      digitalWrite(clockPin, LOW);
    }
  }
  //Busy active high from last data bit latch.
  delay(20);
}



Basically plays voice 0000.x every 5 seconds and only reset the device once. Busy pin must be connected cause this is sync play mode.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 21, 2012, 07:06 pm
Fixed code:

Code: [Select]
/*
  WTV020-SD-16P Test
Control a WTV020-SD-16P module to play sounds from an Arduino board.

Created July 21 2012.
By Diego J. Arevalo.
*/

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

int busyPinState = HIGH;

void setup() {
  pinMode(resetPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
  pinMode(busyPin, INPUT);
  resetModule();
}

void loop() {
  playAsyncSong(1);
  delay(5000);
  playSong(1);
}

void playSong(int voiceNumber){ 
  sendCommand(voiceNumber);
  busyPinState=digitalRead(busyPin);
  while(busyPinState==HIGH){
    busyPinState=digitalRead(busyPin);
  }
}

void playAsyncSong(int voiceNumber){
  sendCommand(voiceNumber);
}

void resetModule(){
  digitalWrite(clockPin, LOW);
  digitalWrite(resetPin, HIGH);
  //Reset pulse.}
  digitalWrite(resetPin, LOW);
  delay(5);
  digitalWrite(resetPin, HIGH);
  //Reset idle to start bit.
  digitalWrite(clockPin, HIGH);
  delay(300);
}

void sendCommand(unsigned int command) {
  //Start bit Low level pulse.
  digitalWrite(clockPin, LOW);
  delay(2);
  for (unsigned int mask = 0x8000; mask > 0; mask >>= 1) {
    //Clock low level pulse.
    digitalWrite(clockPin, LOW);
    delayMicroseconds(50);
    //Write data setup.
    if (command & mask) {
      digitalWrite(dataPin, HIGH);
    }
    else {
      digitalWrite(dataPin, LOW);
    }
    //Write data hold.
    delayMicroseconds(50);
    //Clock high level pulse.
    digitalWrite(clockPin, HIGH);
    delayMicroseconds(100);
    if (mask>0x0001){
      //Stop bit high level pulse.
      delay(2);     
    }
  }
  //Busy active high from last data bit latch.
  delay(20);
}


Attached sample file. This module is very pesky about microsd cards and ad4 files. This one works really good. I converted some other files that only plays 5 seconds and die.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 22, 2012, 06:14 pm
Optimized source code that plays with the volume and play/pause command:

Code: [Select]
/*
  WTV020-SD-16P Test
Control a WTV020-SD-16P module to play sounds from an Arduino board.

Created July 22 2012.
By Diego J. Arevalo.
*/

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

int busyPinState = HIGH;

void setup() {
  pinMode(resetPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
  pinMode(busyPin, INPUT);
  resetModule();
}

void loop() {
  sendCommand(0xfff0);
  playAsyncSong(0);
  delay(1000);
  sendCommand(0xfff1);
  playAsyncSong(0);
  delay(1000);
  sendCommand(0xfff2);
  playAsyncSong(0);
  delay(1000);
  sendCommand(0xfff3);
  playAsyncSong(0);
  delay(1000);
  sendCommand(0xfff4);
  playAsyncSong(0);
  delay(1000);
  sendCommand(0xfff5);
  playAsyncSong(0);
  delay(1000);
  sendCommand(0xfff6);
  playAsyncSong(0);
  delay(1000);
  sendCommand(0xfff7);
  playAsyncSong(0);
  delay(1000);
  playAsyncSong(0);
  delay(5000);
  sendCommand(0xfffe);
  delay(2000);
  sendCommand(0xfffe);
  delay(5000); 
  sendCommand(0xffff);
  sendCommand(0xfff0);
}

void resetModule(){
  digitalWrite(clockPin, LOW);
  digitalWrite(resetPin, HIGH);
  //Reset pulse.}
  digitalWrite(resetPin, LOW);
  delay(5);
  digitalWrite(resetPin, HIGH);
  //Reset idle to start bit.
  digitalWrite(clockPin, HIGH);
  delay(300);
}

void playSong(int voiceNumber){ 
  sendCommand(voiceNumber);
  busyPinState=digitalRead(busyPin);
  while(busyPinState==HIGH){
    busyPinState=digitalRead(busyPin);
  }
}

void playAsyncSong(int voiceNumber){
  sendCommand(voiceNumber);
}

void sendCommand(unsigned int command) {
  //Start bit Low level pulse.
  digitalWrite(clockPin, LOW);
  delay(2);
  for (unsigned int mask = 0x8000; mask > 0; mask >>= 1) {
    //Clock low level pulse.
    digitalWrite(clockPin, LOW);
    delayMicroseconds(50);
    //Write data setup.
    if (command & mask) {
      digitalWrite(dataPin, HIGH);
    }
    else {
      digitalWrite(dataPin, LOW);
    }
    //Write data hold.
    delayMicroseconds(50);
    //Clock high level pulse.
    digitalWrite(clockPin, HIGH);
    delayMicroseconds(100);
    if (mask>0x0001){
      //Stop bit high level pulse.
      delay(2);     
    }
  }
}


Will be write a library to do even more easy to code this. It will be seamless. playAsyncSong don't need busy pin connected.
Title: Re: cheap sound module: what version is this?
Post by: bobafett1 on Jul 25, 2012, 04:31 am
Hi Boys,I am a little late getting to the party here.  I have been trying to get my sound module to work using the serial write.
    mySerial.write(0x7E);
    mySerial.write(0x07);
    mySerial.write(0xB0);
    mySerial.write(0x30);
    mySerial.write(0x31);
    mySerial.write(0x30);
    mySerial.write(0x30);
    mySerial.write(0x32);
    mySerial.write(0x7E);

So far I have not had any luck.
I know you guys discussed moving the solder jumper to 5V. Did you ever determine if it was ok to leave it at 3.3v?

I think I will try your method. 1 Question though. What pins on the sound module are you connecting to the below Arduino pins.
const int clockPin = 6;  // the pin number of the clock pin
const int dataPin = 9;  // the pin number of the dataPin pin
const int resetPin = 3;  // the pin number of the reset pin
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 25, 2012, 05:19 am
This is my pin setup:

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

Optional in asynchronous playing:
busyPin = 5;  // The pin number of the busy pin.

About the soldered pin, we decided to move to 5V cause we were using Arduino Vcc, that's all. And about that myserial.write, I am pretty sure won't work, since I tried somo-14d source code for this baby and did not work. Hope this helps.
Title: Re: cheap sound module: what version is this?
Post by: bobafett1 on Jul 25, 2012, 05:27 am
Do you put your wav file in any special folder of are the just sitting on the SD card in not additional folder.

The reason I ask is because with the serial write I was trying, it says to follow the below structure

If you want to control the mp3 player with serial port commands with arduino, first you must put the cof.mp3 file with number 1 inside the advert1 folder.

The busy pin does not tell you when the player stop, is for connecting a blinking led.

This is sample code for playing folder advert01, song 002.mp3 in arduino?

mySerial.print(0x7E,BYTE);
mySerial.print(0x07,BYTE );
mySerial.print(0xB0,BYTE);
mySerial.print(0x30,BYTE);
mySerial.print(0x31,BYTE);
mySerial.print(0x30,BYTE);
mySerial.print(0x30,BYTE);
mySerial.print(0x32,BYTE);
mySerial.print(0x7E,BYTE);
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 25, 2012, 05:33 am
For our sound module, as for somo-14d and compatibles, music/voice files should be stored in the root folder. I read that document you read, but I am pretty sure those instructions are for another sound module. Also, you must be sure about control mode. We bought serial control mode. Did you buy the same control mode?
Title: Re: cheap sound module: what version is this?
Post by: bobafett1 on Jul 25, 2012, 05:38 am
To be honest with you have have no idea what version I got. I just bought one off of ebay. It looks identical to the one that you guys got, but that does not mean its serial mode
Title: Re: cheap sound module: what version is this?
Post by: bobafett1 on Jul 26, 2012, 01:03 am
Since you have yours working have you gone back to give those sd cards you thought were not working a second try? what happens with your busy light when you try to use those bad cards. My light is stays off  I would like to know if my card is really the problem before I order a new one
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 26, 2012, 01:12 am
Yup, obviously tried them all again. Only Sandisk one did work. Busy light is off when playing. If your busy light keeps on after resetting, please, change the sd card.
Title: Re: cheap sound module: what version is this?
Post by: bobafett1 on Jul 26, 2012, 01:20 am
Update, I misread your diagram, I hooked up to analog pins 2-4 and you used digital. I switch my pin hook and now I am at the point of getting nothing but little quit beeps when the track tries to read.
Title: Re: cheap sound module: what version is this?
Post by: bobafett1 on Jul 26, 2012, 04:45 am
and I am up and working.  I am surprised your SD cards do not work. My card is pretty generic, it does not even have a brand name on it, it came out of my phone.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 26, 2012, 07:08 pm
I am so happy for that. Are you using my source code?

Last night I re-formatted the sd cards using SD-formatter application. Copied 19 sound files in each one. Original Kingston did work this time, but only for a few seconds for each file. Sandisk did the same, but each song was a few more seconds long than Kingstone.

Those are the ones working so far despite the playback problem:

(http://dl.dropbox.com/u/51142578/2012-07-25_00-50-10_115.jpg)

(http://dl.dropbox.com/u/51142578/2012-07-25_00-47-18_348.jpg)

and a fake one that did not work:

(http://dl.dropbox.com/u/51142578/2012-07-25_00-49-54_826.jpg)

Could take a picture of yours?

Attached one of the audio files I am trying to play.
Title: Re: cheap sound module: what version is this?
Post by: bobafett1 on Jul 27, 2012, 05:53 am
I used some of your code, basically just the reset module and the piece that actaully plays the sounds. I taylored it to meet my needs by playing on button push that I have hooked up to a switch so that I can switch between blast and stun sounds. I also added leds for when each of the sounds play as well as a button debounce.

here is a 2gb version of the card I am using. The modules can only handly 1gb and that is what I currently have in there but the 2gb looks just like my 1gb
(http://farm8.staticflickr.com/7256/7654247532_b8bfae4fb6.jpg)
Title: Re: cheap sound module: what version is this?
Post by: bobafett1 on Jul 27, 2012, 06:00 am
I have my board configured for another project right now so I won't be able to test your sound for a few days. I currently have 2 arduinos and am probably going to order a third (1 of mine I leave hooked up to program ATtiny chips so really I only have 1 board to . It will just be easier so I don't have to keep changing stuff out.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 27, 2012, 06:46 am
Wow, so basically my code really works for other devices than mine and your micro sd card is really oem. I contacted the chip manufacturer and the eBay vendor asking for directions about SD brands. eBay vendor just told me that probably is about reading speed. Testing my cards right now to check reading speed. Manufacturer told me that they will handle me manual for V 1.5 asap they have it updated.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 27, 2012, 07:39 am
Faster sd card I have is 7.4 Mb/sec. Kingston fakes are 6.17 Mb/sec. Read testing of course. What about you? You can check your read/write transfer rate using ht2 app for windows or f3 for linux.
Title: Re: cheap sound module: what version is this?
Post by: bobafett1 on Jul 28, 2012, 09:44 pm
I am not sure the read speed is your issue with that one card.
My card is only reading at around 2.5mbs
Title: Re: cheap sound module: what version is this?
Post by: bobafett1 on Jul 28, 2012, 09:50 pm
I did go ahead and order one of those WTM-20  sound modules. If I can't notice a large difference in sound quality I will stick with the WTV for my project simply because the price difference.
It looks like the WTM modules use that serialwrite protocall with the advert01 folder and config files that I was first trying to use the the WTV.
Title: Re: cheap sound module: what version is this?
Post by: lost_and_confused on Jul 29, 2012, 01:42 am
Hi guys.

I'm kind of wanting to go down this path myself.

One thing which I find "interesting".

Why do you have buttons on the actual sound card?

As the Arduino is the engine of this, why not connect the inputs to unused Arduino output pins and have the Arduino FULLY control the card?

Just asking.

Title: Re: cheap sound module: what version is this?
Post by: bobafett1 on Jul 29, 2012, 02:24 am


Why do you have buttons on the actual sound card?

As the Arduino is the engine of this, why not connect the inputs to unused Arduino output pins and have the Arduino FULLY control the card?



There are not buttons on the actaul sound module, I connected a button to my arduino so that I could play a sound on button push.

The reason for using the module vs rigging up pins to the card is simply a convience also you only have to connect 3 pins using the module vs having to connect how many pins the card has
Title: Re: cheap sound module: what version is this?
Post by: lost_and_confused on Jul 29, 2012, 02:34 am
Yeah, fair enough in a lot of ways:
If the unit has buttons, why make other ones and lose inputs on the Arduino.

However, *IF* there are existing input/s buttons/switches already on the Arduino to do other things, you could use them anyway.  Just with a menu option or something.

Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 29, 2012, 06:31 am

I am not sure the read speed is your issue with that one card.
My card is only reading at around 2.5mbs

Only at 2.5MB/sec? OMG, that  third of mine and still working. Got another memory today from Germany. Sandisk which is 7.38MB/sec. Did not have the chance to test it, but It is quite similar like the one I already have. Still waiting an answer from the vendor or/and manufacturer. :~
Title: Re: cheap sound module: what version is this?
Post by: bobafett1 on Jul 29, 2012, 05:43 pm
Well if you think about it, the size of the AD4 files that we are playing are only like 21kb. that is such a small fraction compared to 2.5mb per second.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Jul 30, 2012, 03:18 pm
I played small ad4 files and got the same error. Even the SOMO samples files failed to play entirely. Will try to get one of those generic memories. Were you able to try that 2gb memory? IF SOMO 14d works with 2gb, and this module is sharing the same chip. Maybe could work. A coworker is lending me a 2gb card today. Will try to test it.
Title: Re: cheap sound module: what version is this?
Post by: bobafett1 on Aug 01, 2012, 03:38 am
I read somewhere the the modules would only support up to a 1GB card
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Aug 01, 2012, 05:10 pm
I know, but worth the try. Last night I tried my new Sandisk. Same weird behavior. I took the wavs from Windows OS, small ones, and ad4 files only were 2kb long. Converted 16 tracks, some of them played great, other same defect. Only for a few seconds. It is not about the size, there is something wrong with the micro sd card brand, model or the audio module is defective. I requested a new one from eBay vendor.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Aug 02, 2012, 08:28 pm
Posted the library here:
http://arduino.cc/forum/index.php/topic,117009.new.html#new
Title: Re: cheap sound module: what version is this?
Post by: onesky on Aug 04, 2012, 11:16 am

I know, but worth the try. Last night I tried my new Sandisk. Same weird behavior. I took the wavs from Windows OS, small ones, and ad4 files only were 2kb long. Converted 16 tracks, some of them played great, other same defect. Only for a few seconds. It is not about the size, there is something wrong with the micro sd card brand, model or the audio module is defective. I requested a new one from eBay vendor.
i had same beahaviour, i solved  first encoding the wave into 32khz then converting to AD4
Title: Re: cheap sound module: what version is this?
Post by: wanderlg on Aug 04, 2012, 02:36 pm
Texo original em portugues.

A Paz meus amigos.

Amigos, eu necessito muito da ajuda de vocês. Comprei 2 modulos WTV020-SD-Mini. Já tem 8 meses que venho tentando fazer esse modulo funcionar e perdi a esperança.
Vi que vocês conseguiram, teria como algum de vocês fazerem um teste para eu saber se meu problema é realmente o cartão de memória. Veja: ele esta tocando se eu apertar play. (Colocando 0 no pino 9) ou seja por botões ele funciona, mas pelo microcontrolador não consigo. Tem como você testar com o microsd Kingston e verificar se ele toca apertando play? (colocando 0 no pino 9) aqui toca e posso mudar de ad4. coloquei 6 arquivos. 0000.ad4 a 0006.ad4 esse é meu código:

-------------------------------------------------------------------------------
text translated by google

Peace my friends.

Friends, I really need your help. I bought two modules WTV020-SD-Mini. Already have eight months I have been trying to make this module work and lost hope.
I saw what you did, would any of you do a test so I know if my problem is really the memory card. You see, he is playing if I hit play. (Put 0 on pin 9) or by buttons it works, but can not by the microcontroller. Its you test with Kingston MicroSD and see if he plays pressing play? (putting 0 on pin 9) plays here and I can change ad4. I put six files. 0000.ad4 the 0006.ad4 this is my code:


Device = 16F628A
Xtal=4
Config CP_OFF, WDT_Off, PWRTE_ON, LVP_OFF, MCLRE_On, BODEN_off, xt_osc
All_Digital=true

Symbol Reset = PORTA.0
Symbol CLK = PORTA.1
Symbol DI = PORTA.2

Dim Dados As Word
Dim X As Byte
Dim T As Word

'Iniciando Modulo
Input Reset
Input CLK
Low DI
DelayMS 100

Inicio:

Dados = 3 'play 0003.ad4
GoSub Resete
GoSub EnviaDados

Stop

GoTo Inicio

;---------------------------------------------------------------------------
EnviaDados:
Low CLK
DelayMS 2
  For X = 15 To 0 Step -1 
    Low CLK                 
    If GetBit Dados,X = 1 Then         
      Input DI
    Else
      Low DI             
    EndIf
   DelayUS 200     
   Input CLK               
   DelayUS 200
Next X                   
Input DI 
DelayMS 29
Return

'--------------------------------------------------------------------------------

Resete:
Input Reset
Low Reset
DelayMS 5
Input Reset
DelayMS 300
Return

End
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Aug 04, 2012, 05:35 pm


I know, but worth the try. Last night I tried my new Sandisk. Same weird behavior. I took the wavs from Windows OS, small ones, and ad4 files only were 2kb long. Converted 16 tracks, some of them played great, other same defect. Only for a few seconds. It is not about the size, there is something wrong with the micro sd card brand, model or the audio module is defective. I requested a new one from eBay vendor.
i had same beahaviour, i solved  first encoding the wave into 32khz then converting to AD4

Which program are you using to convert/tranform wav? Audacy? I tried all of them last week and got same results.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Aug 04, 2012, 05:37 pm
#wanderlg, your EnviarDatos() is wrong. Why don't you translate my library posted here:
http://arduino.cc/forum/index.php/topic,117009.0.html

Pretty sure I will work. And I can not test mp3 mode cause my module is only serial control mode.
Title: Re: cheap sound module: what version is this?
Post by: wanderlg on Aug 04, 2012, 05:38 pm
the strange thing is that he is playing the files using the buttons. touches not only using serial data. which may be? already tested it with 2GB sandisk microsd, but not yet tested it with microsd sandisk 1GB or less. help.
Title: Re: cheap sound module: what version is this?
Post by: wanderlg on Aug 04, 2012, 05:47 pm
# Argentina. enviadados on routine. I've tried many ways and nothing. not seem to be wrong, but already modified in every way. I've got your routine and remade in basic, but still not play.
Title: Re: cheap sound module: what version is this?
Post by: wanderlg on Aug 04, 2012, 05:49 pm
# Argentina. if it is not asking too much, you have to send me a 2 files already converted me to see if this is my problem?
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Aug 04, 2012, 05:58 pm
Try to translate my latest version. Early version was not good. Had to reset it every time I played a voice. I am attaching a file for you. This one plays more than 10 secs for me.  And BTW, I did test a 2gb Kingston card and did not work. Our modules don't support more that 1gb. Are you sure you have the same module?
Title: Re: cheap sound module: what version is this?
Post by: wanderlg on Aug 04, 2012, 06:04 pm
#Argentina. this is my module: WTV020-SD-mini
as you click the one with bit 0 on pin 9, your module does not play?

now I have to leave, but so I'll try to get some more. I've slept and nights without anything. I stopped with 2 modules or 8 months.

thank you for your attention and help.

much peace.
Title: Re: cheap sound module: what version is this?
Post by: onesky on Aug 05, 2012, 01:17 am

#wanderlg, your EnviarDatos() is wrong. Why don't you translate my library posted here:
http://arduino.cc/forum/index.php/topic,117009.0.html

Pretty sure I will work. And I can not test mp3 mode cause my module is only serial control mode.


used goldwave first and then the somo as linked before
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Aug 05, 2012, 05:36 am

#Argentina. this is my module: WTV020-SD-mini
as you click the one with bit 0 on pin 9, your module does not play?

now I have to leave, but so I'll try to get some more. I've slept and nights without anything. I stopped with 2 modules or 8 months.

thank you for your attention and help.

much peace.

Look, It seems you have a control key audio module and we a serial control mode module. Each can't perform both. It is hardwired. You should ask the vendor which mode shipped to you. Mine is serial, so I can't test it in key mode.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Aug 05, 2012, 05:37 am


#wanderlg, your EnviarDatos() is wrong. Why don't you translate my library posted here:
http://arduino.cc/forum/index.php/topic,117009.0.html

Pretty sure I will work. And I can not test mp3 mode cause my module is only serial control mode.


used goldwave first and then the somo as linked before

Will try that. Keep you posted.
Title: Re: cheap sound module: what version is this?
Post by: wanderlg on Aug 05, 2012, 02:04 pm
the strange thing is that my module is the same as you show in a photo and a video. have the same module. My buttons can be configured and also for serial.
Title: Re: cheap sound module: what version is this?
Post by: wanderlg on Aug 05, 2012, 02:15 pm
I use exactly this module.
http://arduino.cc/forum/index.php/topic,117009.0.html
Title: Re: cheap sound module: what version is this?
Post by: wanderlg on Aug 05, 2012, 04:38 pm
I give up. this shit does not work. that sucks. ta giving the will of a sledgehammer on top of that module.
Title: Re: cheap sound module: what version is this?
Post by: wanderlg on Aug 05, 2012, 04:51 pm
see the photo of the module. sorry, I do not know how to put the picture without the link.

waveform signal clk / di
http://www.dropbox.com/s/wt8jymx674uqlpl/dados.jpg

https://www.dropbox.com/s/wt8jymx674uqlpl/dados.jpg
https://www.dropbox.com/s/7050w9rowdzdklx/IMG_20120805_113923.jpg
https://www.dropbox.com/s/nj1luej4mo8v487/IMG_20120805_113939.jpg
https://www.dropbox.com/s/8yy3ztgh80t7q3y/IMG_20120805_113955.jpg
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Aug 06, 2012, 04:54 am
Hey, don't give up. Today got a second audio module and this one really works. My first one was defective. wow, got all the possible defects and got the correct source code to make it work after all. Anyway. Already asked for a replacement for the first one. eBay vendor will honor this word and will send me another one.

From the photos I see that your audio module is older than ours. Mine is version 1.5 released this year. Yours is version 1.3? 1.4? anyway, I don't think they can be setup both ways, serial or key mode. That will explain you can not get serial mode to work.

PS: Tested all the micro sd cards again and fake Kingstone still don't work, but genuine one and two Sandisk do.
Title: Re: cheap sound module: what version is this?
Post by: wanderlg on Aug 06, 2012, 12:38 pm
I do not understand, because the module through key ta touching the 0006.ad4 0000.ad4 files but not play through the serial. and I've tried all the examples and modifying of all forms. neither I nor the seller who is now my friend can do this work through the serial module. only remains for me to try to use the brand Sandisk 1gb microsd. I will buy this one for testing.

Ps: through key works with any brand 512MB to 4GB. I believe that your work too well. mine is version 1.4 - 2008
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Aug 06, 2012, 08:38 pm
Hey, read my words: These modules can't work both ways. Only SOMO14d and SoundOut Audio Module can do that. Your module is working just fine. If you want to control via serial mode, you will have to buy a new one. Try the seller OneSky listed in the first post.
Title: Re: cheap sound module: what version is this?
Post by: wanderlg on Aug 06, 2012, 11:36 pm
then this one is not useless, because a mp3player is much cheaper and more functional than the one I bought. thank you by force.
Title: Re: cheap sound module: what version is this?
Post by: wanderlg on Aug 07, 2012, 12:47 am
is not something that enters my head. vendors and datasheet say that the module accepts serial. and now?
Title: Re: cheap sound module: what version is this?
Post by: wanderlg on Aug 07, 2012, 03:52 am
friend. My module is the same and the same somo14d. what happens is that the chip has somo14d shaved, but the same WTV020 see this:

http://www.embeddedadventures.com/soundout_wtv020_module_mod-1007.html

all use the same chip, the same form of serial data transmission. you're putting your files 0000.ad4 0001.ad4 ... ? you're putting in the root of the microsd? formatted with fat? you have to compress the files that you use your card and send me? my email is: wanderlg@gmail.com
thanks for the help.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Aug 07, 2012, 04:19 am
I am well aware that our generic module shares the same IC than SOMO14 and that compliant one. BUT, I am pretty sure they modify it somehow to support both control modes. Will test mine right away in mp3 key mode to make sure only works in serial mode. Keep you posted. BTW, I updated the library adding new features.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Aug 07, 2012, 04:29 am
You were absolutely right. Mine works in key mode and serial mode. Nevertheless, the seller assured me this was serial-control mode only. Now makes sense for me SOMO14 dual functionality. I can confirm that V 1.5 could work both ways. Not pretty sure about previous versions of this audio module. Tested play, pin 9 to ground, and next, pin 13 to ground. Both worked out just fine. Did try this mode the first time, but since my first sd card was not working, never tried it again. Thanks to you to make me back to test this mode.
Title: Re: cheap sound module: what version is this?
Post by: wanderlg on Aug 07, 2012, 12:39 pm
I do not compriendi. with a module you were stopped, as tested and not operated in serial mode, but now he works as a key? is it? you're with a module that is working just the way key? microsd tested with another brand? My module works with any brand.

friend, you realized that I do not know any English, right? I use google translator. I'm in Brazil. to understand what the google translate this?

ps: I will not stop my tests until the module has burned or run.  :D kkkkkk. it has to work, I'll redo this module as the module soundout

you have to compress and send me the data from your memory card?
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Aug 07, 2012, 07:23 pm
Spanish:
Lo que te quiero decir es que mi modulo funcionó en ambos modos, serie y modo teclas. Te adjunto uno de los ad4 que se que funcionan.

English:
What I meant is that my module worked out in both ways, serial mode and key mode. I am attaching one of the ad4 that I really know is working.

Title: Re: cheap sound module: what version is this?
Post by: wanderlg on Aug 08, 2012, 04:15 am
Obrigado amigo, mas eu desisto. ja nao tenho mais o que fazer, pois até modifiquei o circuito e nao obtive sucesso.


Thanks buddy, but I quit. ja not have what to do, because even modified the circuit and not been successful.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Aug 11, 2012, 07:30 am
Finally did what I wanted to do from the very beginning with this audio module:

http://www.youtube.com/watch?v=AYNur8XLJqQ

Entire post and source code here:
http://arduino.cc/forum/index.php/topic,110328.msg888895.html#msg888895
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Aug 15, 2012, 10:33 pm
Migrated to Arduino Mini Pro Artic Edition:

(http://dl.dropbox.com/u/51142578/IMG20120815_002.jpg)

(http://dl.dropbox.com/u/51142578/IMG20120815_001.jpg)

Will be optimizing the circuit as well the software. But have to report that audio module and library I wrote did work like a charm.
Title: Re: cheap sound module: what version is this?
Post by: onesky on Aug 15, 2012, 11:29 pm
cool!
did u get a replacement or did you buy another module from the same seller? are u still using the 5volts?
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Aug 15, 2012, 11:32 pm
as a matter of fact, that one is the second one I bought. Still waiting for a replacement. 2nd one is working on 3.3v. did not dare to turn to 5v yet until I get a replacement for the first one.  :P
Title: Re: cheap sound module: what version is this?
Post by: onesky on Aug 15, 2012, 11:34 pm
how is the sound quality? the sound is not very loud on the video so i can't judge. As you can hear on my past test-video there is a lot of noise background (i was using also a mini-amp module)
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Aug 15, 2012, 11:39 pm
Pretty decent. Played a few tracks from a PSB album I had converted and they were very cool and loud. I also bought an amp:

(http://i.ebayimg.com/t/Mini-2-3W-4-PAM8803-Class-D-Audio-Amplifier-Board-PIC-AVR-/00/s/MTAwMFgxMDAw/$%28KGrHqRHJDgE+BK88n6cBPw4h3!o,Q~~60_12.JPG)

Still waiting to receive it. Keep you posted.

PS: Volume can be modified by software in this board.
Title: Re: cheap sound module: what version is this?
Post by: onesky on Aug 15, 2012, 11:43 pm
that amplifier uses another PAM IC thanthe one i bought (http://www.ebay.it/itm/Mini-Amplifier-AMP-Board-3W-3W-USB-Power-Supply-DC-5V-/251018468454?pt=US_Home_Audio_Amplifiers_Preamps&hash=item3a71dddc66) (PAM8403)
(http://i.ebayimg.com/t/Mini-Amplifier-AMP-Board-3W-3W-USB-Power-Supply-DC-5V-/00/s/NjAwWDYwMA==/$%28KGrHqV,!gsF!pG5BTJOBQKv57%28b1w~~60_3.JPG)
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Aug 15, 2012, 11:46 pm
Here you have the eBay link:
http://www.ebay.com/itm/170850491058?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649

What attracted me from this amp was that is quite small and have two buttons to control the volume. AND could be controlled by Arduino.
Title: Re: cheap sound module: what version is this?
Post by: onesky on Aug 16, 2012, 12:08 am
ok i see, same output and D-class as mine, seems a step forward for the voltage (a range 3.3-5.5v instead of 5v only), the digital control of vulume and the size.
Also a bit better Signal/Noise Ratio.

http://www.datasheetdir.com/PAM8803NHR+download
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Aug 19, 2012, 05:44 am
Got it today. REALLY small. Soldered pin headers and tried to connect it. I could not, cause I did not have coupling capacitors as recommend in the Wtv020sd16p datasheet. Unfortunately, tomorrow I am flying to Orlando, so won't be able to test it until September. Keep you posted guys.
Title: Re: cheap sound module: what version is this?
Post by: bobafett1 on Aug 28, 2012, 06:40 pm

how is the sound quality? the sound is not very loud on the video so i can't judge. As you can hear on my past test-video there is a lot of noise background (i was using also a mini-amp module)


Did you get your WTM module to work. Mine finally showed up but I am not sure how to connect it. I would like to see if there is a sound quality difference
Title: Re: cheap sound module: what version is this?
Post by: Sn4ke on Sep 10, 2012, 08:47 pm
Hi all,

I also bought these modules.

I want to use them with a 5V Arduino.
As I have V1.5, I can choose between 3,3V and 5V.

But I don't see any 3,3V regulator on the board. As a result, how can the board supply the SD card with 3,3V (remember that SD cards only works with 2,5V-3,6V !) ?

Can anyone confirm that if I change the strap position from 3,3V to 5V and supply it with 5V, my 3,3V SD Card won't burn ?

Other questions, do someone have tried 2GB cards (not 4Gb or more SDHC card) with a 1GB partition ?

Thanks
Title: Re: cheap sound module: what version is this?
Post by: onesky on Sep 12, 2012, 03:22 pm

Hi all,

I also bought these modules.

I want to use them with a 5V Arduino.
As I have V1.5, I can choose between 3,3V and 5V.

But I don't see any 3,3V regulator on the board. As a result, how can the board supply the SD card with 3,3V (remember that SD cards only works with 2,5V-3,6V !) ?

Can anyone confirm that if I change the strap position from 3,3V to 5V and supply it with 5V, my 3,3V SD Card won't burn ?

Other questions, do someone have tried 2GB cards (not 4Gb or more SDHC card) with a 1GB partition ?

Thanks

the IC datasheet says "If MCU is 5V powered , you have to connect 470? resistors between MCU and WTV chips cables , because it is 3.3V power the WTV chip."
so i presume there are resistors on the 1.5 version of this module because mine did not burn and works fine as you can see on my previous videos. But you must change the soldered pin to 5v.
The problem is that the sound quality is low, there is background noise, it doesn't support the much more versatile UART serial communication RS-232 of arduino.
Title: Re: cheap sound module: what version is this?
Post by: Sn4ke on Sep 13, 2012, 11:33 am
Thanks for your answer.

I will use this module to build an alarm clock.  I hope the sound quality will be good enough for this use.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Nov 05, 2012, 06:36 pm

Got it today. REALLY small. Soldered pin headers and tried to connect it. I could not, cause I did not have coupling capacitors as recommend in the Wtv020sd16p datasheet. Unfortunately, tomorrow I am flying to Orlando, so won't be able to test it until September. Keep you posted guys.

Back to work. Will be testing this amp tonight. Keep you posted guys./ Good to be back BTW/
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Nov 06, 2012, 12:48 pm

Pretty decent. Played a few tracks from a PSB album I had converted and they were very cool and loud. I also bought an amp:

(http://i.ebayimg.com/t/Mini-2-3W-4-PAM8803-Class-D-Audio-Amplifier-Board-PIC-AVR-/00/s/MTAwMFgxMDAw/$%28KGrHqRHJDgE+BK88n6cBPw4h3!o,Q~~60_12.JPG)

Still waiting to receive it. Keep you posted.

PS: Volume can be modified by software in this board.

Well, last night tried but could not get it to work. Bought the coupling capacitor, a better power source and nothing. Connected the #4 from the wtv audio module using a .47uf. No sound from the amp. Any ideas in how to test it?

PS: I just noticed that the board already have capacitors soldered. So, I do believe the board is defective.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Nov 07, 2012, 04:01 pm
Did work. It was my fault. I forget to read the manual and connect to 5v the Shutdown pin. Works like a charm. Now, I will write a library to control the volume. Keep you posted guys.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Nov 08, 2012, 05:10 pm
Sounds really loud!

http://www.youtube.com/watch?v=0rdIbUhGxCI
Title: Re: cheap sound module: what version is this?
Post by: Lakes on Nov 08, 2012, 06:25 pm
Have`nt read all of this thread, sorry if this has been asked.

Do you get the the module with an SD card reader, the listing looks like they plug together.

In the video, is it playing without an amplifier?

Only supports 1GB SD cards, but should be plenty for sound effects.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Nov 08, 2012, 06:42 pm
:) You should read all the thread, It is quite handy.
Audio module incorporates the uSD card reader.
In the video I was testing the PAM8803 amplifier.
As far as I know, only 1gb cards. Hope this helps.
Title: Re: cheap sound module: what version is this?
Post by: Lakes on Nov 10, 2012, 04:58 pm
I`ve read through all of the thread this time. :D

Another version of the amplifer
http://www.ebay.co.uk/itm/2-2W-4O-PAM8803-Class-D-Audio-Amplifier-Board-Simple-/350604041652?pt=US_Home_Audio_Amplifiers_Preamps&hash=item51a1a11db4 (http://www.ebay.co.uk/itm/2-2W-4O-PAM8803-Class-D-Audio-Amplifier-Board-Simple-/350604041652?pt=US_Home_Audio_Amplifiers_Preamps&hash=item51a1a11db4)

I wonder if 64 steps volume control is fast enough to do some basic envelope shaping?

Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Nov 12, 2012, 02:13 am
Well, only same cause they are using PAM8803, but two boards are quite different. It is huge compared with the one I bought. If you connect volume up to active low, from the very beginning, the amp starts at its higher level.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Nov 16, 2012, 12:52 pm
Hey guys, anyone using it at 5V? Cause I moved the soldered pin from 3.3 to 5 and could not get it to work. Quite erratically. I did not use any diode cause I believe they are soldered in the pcb board. Any idea?
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Nov 18, 2012, 06:26 am
Here you have a sample from the PAM8803 library:

Pam8803.h:
Code: [Select]
/*
Pam8803.h - Library to control a PAM8803 amplifier module.
Created by Diego J. Arevalo, November 18, 2012.
Released into the public domain.
*/

#ifndef Pam8803_h
#define Pam8803_h

class Pam8803
{
public:
  Pam8803(int resetPin, int volumeUpPin, int volumeDownPin);
  void reset();
  int volumeUp();
  int volumeDown();
  int setVolumeInHalf();
private:
  int _gainSetting;
  int _resetPin;
  int _volumeUpPin;
  int _volumeDownPin;
  void setGainSetting(int volumePin);
};

#endif


Pam8803.cpp:
Code: [Select]
/*
Pam8803.cpp - Library to control a PAM8803 amplifier module.
Created by Diego J. Arevalo, November 18, 2012.
Released into the public domain.
*/

#include "Arduino.h"
#include "Pam8803.h"

const int MIN_GAIN_SETTING = 1;
const int POWER_ON_GAIN_SETTING = 13;
const int MAX_GAIN_SETTING = 64;

Pam8803::Pam8803(int resetPin, int volumeUpPin, int volumeDownPin){
  _gainSetting=POWER_ON_GAIN_SETTING;
  _resetPin=resetPin;
  _volumeUpPin=volumeUpPin;
  _volumeDownPin=volumeDownPin;
  pinMode(_resetPin, OUTPUT);
  pinMode(_volumeUpPin, OUTPUT);
  pinMode(_volumeDownPin, OUTPUT);
  digitalWrite(_resetPin, LOW);
  digitalWrite(_volumeUpPin, HIGH);
  digitalWrite(_volumeDownPin, HIGH);
}

void Pam8803::reset(){
  digitalWrite(_resetPin, LOW);
  digitalWrite(_resetPin, HIGH);
}

int Pam8803::volumeUp(){
  if (_gainSetting<MAX_GAIN_SETTING){
    setGainSetting(_volumeUpPin);
    _gainSetting++;
  }
  return _gainSetting;
}

int Pam8803::volumeDown(){
  if (_gainSetting>MIN_GAIN_SETTING){
    setGainSetting(_volumeDownPin);
    _gainSetting--;
  }
  return _gainSetting;
}

int Pam8803::setVolumeInHalf(){
  if (_gainSetting <= MAX_GAIN_SETTING/2) {
    while (_gainSetting <= MAX_GAIN_SETTING/2) {
      volumeUp();
    }
  }
  else{
    while (_gainSetting >= MAX_GAIN_SETTING/2) {
      volumeDown();
    }
  }
  return _gainSetting;
}

void Pam8803::setGainSetting(int volumePin){
  digitalWrite(volumePin, LOW);
  delay(30*3.5);
  digitalWrite(volumePin, HIGH);
};


and It is working. void setVolumeInHalf is quite useful. Actually using my 8,9 and 10 pin for the amp.

Final library posted here:
http://arduino.cc/forum/index.php/topic,133013.new.html#new
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Nov 19, 2012, 01:35 pm
You are right, your approach seems to be more simpler than mine. I will implement your solution solution ASAP and update my library. Thank you very much. That's why I love to share.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Nov 19, 2012, 09:15 pm
Thanks for taking care of this for me. About delay(30*35), It is cause of the time needed for the pam8803 to process a level up or down active low state. 3.5 clock cycles. Each clock cycle is about 30ms. You can read about it here:

http://www.poweranalog.com/pdf/PAM8803.pdf

There is a way to speed up the volume up/down process. 9.5 times + 2 ms for each level. I am planning to go that way to. But for small increments, 105ms don't sound that bad.

I also would love to continue talking about this here:
http://arduino.cc/forum/index.php/topic,133013.0.html

Don't want to go off-topic here.
Title: Re: cheap sound module: what version is this?
Post by: dmsherazi on Nov 26, 2012, 07:10 am
I am feeding audio from a Sound module wtv020sd-mini which is PWM , to the mic Pins of My GSM Module Sim900, when I hear this sound on a a speaker although its not a high quality still its fair enough, but when I play the same voice and feed it to Sim900 mic and listen to it over a call its quality is very poor, there are alot of humming sounds and voice quality itself is also low.

I wanna use the module for voice response to callers , Is it all because of PWM output ? I used another module from ISD17150 and its voice quality is very nice even on the call.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Nov 26, 2012, 08:12 pm
There is a post about the quality of this audio module from a few month ago. Only suitable for voices or fx, no so much for music given the sampling allowed by this ad4 format.
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Nov 26, 2012, 08:31 pm
Video update about my Arduino project. Now with fire selector: Regular or Stun laser gun.

http://www.youtube.com/watch?v=IpUpi0OmHHI
Title: Re: cheap sound module: what version is this?
Post by: transfinite on Dec 02, 2012, 01:32 am

Hey guys, anyone using it at 5V? Cause I moved the soldered pin from 3.3 to 5 and could not get it to work. Quite erratically. I did not use any diode cause I believe they are soldered in the pcb board. Any idea?


the-rebel-agent, is it working on 5V now?  I've been using your Wtv020sd16p library but with 3.3V.  Did you have to change anything other than the soldered pin on the wtv020 to make it work with 5V?

Thanks,

-transfinite
Title: Re: cheap sound module: what version is this?
Post by: transfinite on Dec 02, 2012, 02:17 am
Ok, nevermind.  I see you answered my question in this post.

  http://arduino.cc/forum/index.php/topic,117009.45.html


-transfinite
Title: Re: cheap sound module: what version is this?
Post by: the-rebel-agent on Dec 02, 2012, 05:10 pm
No problem. If you have anything else to ask, just do it. And as I stated to @onesky, there is no quality difference working on any voltage. And won't be any difference for the library I wrote.
Title: Re: cheap sound module: what version is this?
Post by: Waytronic-Jasmine on Feb 28, 2013, 08:44 am


Don't Arduino nano have a 3.3v output?
yes but .. "when running on external (non-USB) power, the 3.3V output (which is supplied by the FTDI chip) is not available"
http://arduino.cc/en/Main/ArduinoBoardNano

so i think i will try to change the solder to the 5volts pin as suggested by Johnwasser (thank you)


Pls don't use 5 V ,it will destory our module directly ,maybe when you use for a while.the main chip of WTV020-SD module maximum voltage is 3.6V,so work voltage can not beyond 3.6V.
Title: Re: cheap sound module: what version is this?
Post by: onesky on Mar 03, 2013, 05:18 pm

Pls don't use 5 V ,it will destory our module directly ,maybe when you use for a while.the main chip of WTV020-SD module maximum voltage is 3.6V,so work voltage can not beyond 3.6V.


then why on the board there is a pin switch 5v - 3.3v?

(http://img850.imageshack.us/img850/3426/wtv20.jpg)
Title: Re: cheap sound module: what version is this?
Post by: onesky on Mar 03, 2013, 05:23 pm

Did work. It was my fault. I forget to read the manual and connect to 5v the Shutdown pin. Works like a charm. Now, I will write a library to control the volume. Keep you posted guys.


are you sure that the Shut Down pin has to be connected to the arduino 5volts?

this is what datasheet says:
Quote
In order to reduce power consumption while not in use, the PAM8803 contains shutdown circuitry that is used to turn off the amplifier's bias

circuitry. This shutdown feature turns the amplifier off when logic low is placed on the SHDN pin. By switching the SHDN pin connected to GND,

the PAM8803 supply current draw will be minimized in idle mode. The SHDN pin cannot be left floating due to the pull-down internal.


it means, if i am not wrong, that we can shut down the ampli when not in use simply connecting the shutdown pin to a digital pin of Arduino and then set the signal to LOW.
Title: Re: cheap sound module: what version is this?
Post by: jeremixogg on Mar 20, 2013, 08:38 pm
I may post in the wrong topic but anyway, I need to be sure.

This module do play .wav files (16bits, 44,1 Khz) ?
Title: Re: cheap sound module: what version is this?
Post by: task on Mar 21, 2013, 01:18 pm
I am trying to get this one () to work with my Arduino
I am using the sandisk 4GB micro SD card.  The light comes and goes.  It looks like it is doing something.  I ordered a 1GB SD card.  I should probably get it in a month

In case I can get one working, what will I need to do to get 3 working at the same time so that I can play 3 sounds at the same time?  I will be using the Teensy 3 at 96Mhz so I will have alot more speed available if that is an issue.  Will I have to use 4 pins for each module?  It almost looks like I might be able to share at least the reset pin for each module so then I will have to use 3 pins per extra module.  Does that sound about right?
Title: Re: cheap sound module: what version is this?
Post by: jeremixogg on Mar 22, 2013, 01:06 pm

Is this module can play .wav files (16bits, 44,1 Khz) ?
Title: Re: cheap sound module: what version is this?
Post by: onesky on Mar 22, 2013, 07:31 pm
it plays AD4 files format at very low bitrate (low quality)

if you need high quality i suggest a better module like this:
http://arduino.cc/forum/index.php/topic,150535.0.html
Title: Re: cheap sound module: what version is this?
Post by: Realow on Feb 26, 2014, 05:34 am
Hey guys, I read the two topics more than one time, I am using the module WTV020-SD-mini with the jumper in 3.3V and wired to an arduino nano board, I used The (the-rebel-agent)'s code that uses the busy pin of the sound module but the mine stay lit all the time, it blinks twice when I energize the Arduino, and after I press the firing button too, but it stays lit all time and when I press the button it just goes down and lits up again.

Any idea of what should be happening with it? To keep the busy led lit all the time?

Thank you guys!
Title: Re: cheap sound module: what version is this?
Post by: freebird4446 on Dec 23, 2016, 04:12 am
When I use sample .ad4 files I can get them to play for as long as they file goes for. Some of my converted ad4 files play for different length of time and never until the end of the track. Most only play for 5-6 seconds, and others up to 10 seconds. Was this problem ever resolved?



Update with Solution: I found a great site that has a converter for OSX and does everything automatically (lowers the DB, etc). It makes changing to .ad4 files easy and fast for OSX here:

http://makeithappend.org/archives/2247

I found that put putting the sound files on the memory card in the order they go in solved my problem. I did it one by one, moving file 0000 in first, then 0001, etc. Only took four days to figure that out! I have over 100 songs on my list and I used the library made on the link above. Volume control never worked for me. Of the 5 memory cards I ordered only the ones from a specific vendor worked. I found it on amazon in a link on one of these pages from someone else that had success. The link above suggest that the method of formatting the memory card has everything to do with how it work, this is I didn't try because I had a working 2GB card. My memory card cost more then the module!

I initially wrote my own code to skip through the the song by having the Arduino pull the pin low but this was a mistake. To get to songs 1 through ten it worked out with a 30 ms delay. However, the farther down the song list I went, the longer delay that was needed inbetween pulling the pin high to low. This eventually meant you you start to hear the beginnings of songs as you skipped through. All in all awesome once I got it worked, but took a long long time to get there but I am new to arduino. Running it off the 3.3v from the Arduino too.

Another note is to make sure the micro SD card is in all the way. I'm familiar with these card but used to sliding the card in. In this module you have to place it in and there's an exact space for the right grooves in the card, etc.