Pages: 1 ... 3 4 [5] 6 7 ... 12   Go Down
Author Topic: cheap sound module: what version is this?  (Read 32914 times)
0 Members and 1 Guest are viewing this topic.
Argentina
Offline Offline
Full Member
***
Karma: 5
Posts: 160
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Italy
Offline Offline
Full Member
***
Karma: 3
Posts: 151
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 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.
Logged

Argentina
Offline Offline
Full Member
***
Karma: 5
Posts: 160
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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....
Logged

Argentina
Offline Offline
Full Member
***
Karma: 5
Posts: 160
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Argentina
Offline Offline
Full Member
***
Karma: 5
Posts: 160
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

As Anakin would say: Is working! Is working! The problem was the microSD card from the very beginning.



Source code here:

Code:
/*
  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.
« Last Edit: July 17, 2012, 01:10:22 am by the-rebel-agent » Logged

Italy
Offline Offline
Full Member
***
Karma: 3
Posts: 151
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

finally! the sd card was the last try to get it work and u made it smiley-wink
now happy work on code!
Logged

Argentina
Offline Offline
Full Member
***
Karma: 5
Posts: 160
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Argentina
Offline Offline
Full Member
***
Karma: 5
Posts: 160
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Firing a laser gun:



Code:
/*
  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.

* 0511.AD4 (13.35 KB - downloaded 35 times.)
Logged

0
Offline Offline
Edison Member
*
Karma: 7
Posts: 1235
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?)
« Last Edit: July 18, 2012, 09:28:44 am by xl97 » Logged


Argentina
Offline Offline
Full Member
***
Karma: 5
Posts: 160
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Italy
Offline Offline
Full Member
***
Karma: 3
Posts: 151
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: July 18, 2012, 09:12:16 am by onesky » Logged

0
Offline Offline
Edison Member
*
Karma: 7
Posts: 1235
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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) smiley

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

microSD socket on bottom..




Logged


Argentina
Offline Offline
Full Member
***
Karma: 5
Posts: 160
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Edison Member
*
Karma: 7
Posts: 1235
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yeah made it myself.. got some pcb's...stencil, placed..etc..etc  & re-flowed in wal-mart toaster oven. smiley-wink

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. smiley


I dont know what you mean about the uSD?  (its on the bottom of the board) smiley-wink
Logged


Pages: 1 ... 3 4 [5] 6 7 ... 12   Go Up
Jump to: