Trying to use WT5001M02-28P

Status
Not open for further replies.

taskman

Well-known member
I am trying to use this sound module, discussed here http://forum.arduino.cc/index.php?topic=150535.0

I am able to get it to play sound using the Arduino, but it ignores the messages from the Teensy 3. When I monitor the serial output from the Teensy 3 it looks the same as the Arduino. So not sure what I am doing wrong

This is what I tried
Connect to Teensy 3 power and use TX1, then TX2, then TX3 to send messages
Connect to Arduino power and use TX1, then TX2, then TX3 to send messages
Bought logic level shifter, used Teensy 3 TX's in and then the out to the sound module
Tested that power was coming through the logic converter using an LED and the rails on the breadboard

What does work is using Teensy 3 power and send messages with Arduino.

The photo might look a bit crazy, I started setting up my Teensy 3 to use with my other development, very few of the wires are in use
http://www.flickr.com/photos/92380311@N04/8983705543/


Pin outs in photo
Teensy pin 1 to sound module pin 17 (RX)
Teensy volts and ground to rail on breadboard
Sound module gets its volts and ground from breadboard
Sound module 11 to speaker

If I leave everything as is and just plug the Arduino into the RX I get sound, my Arduino is grounded to the breadboard. So the module is getting power correctly.
 
I took a couple photos of my oscilloscope

This one is from pin 1 TX on the Teensy 3. Just noise. So I must not have something set
http://www.flickr.com/photos/92380311@N04/8985097201/


The white graph on this one is the message on TX from the Arduino. The blue is a pwm pulse I am sending from the Teensy 3 on pin 3 so my measurement method is most likely correct
http://www.flickr.com/photos/92380311@N04/8986289902/


Using the same settings on the oscilloscope I uploaded the mp3 test program again and tested pin 1 again. This picture shows nothing except noise coming from pin 1
http://www.flickr.com/photos/92380311@N04/8986315918/
 
Sorry. I tried with Serial, Serial1, Serial2, Serial3 (ofcourse changing to the right pins for 1/2/3)
I tried with and without .begin()
I tried adding a delay after setup

I just tried another Teensy and it worked
Seems the other one was broken or something, but I was able to get a pwm signal from pin 3. Brand new and out of the bag today. I have another spare that I will test tomorrow. I wonder if I damaged something soldering the wires to the bottom? Not one of my Windows machines registers the Teensy now anymore, not even a sound when I plug it in

Code:
void setup(void) {
  Serial1.begin(9600);

  Serial1.write(0x7E); 
  Serial1.write(0x03); 
  Serial1.write(0xA7);
  Serial1.write(0x1F); //  volume max
  Serial1.write(0x7E);      
  delay(3000);
  
}


void loop() {  

    // start sound
    Serial1.write(0x7E); 
    Serial1.write(0x04); 
    Serial1.write(0xA0); // A0 for SD card
    Serial1.write((byte)0x00);
    Serial1.write(0x01); // track number
    Serial1.write(0x7E);
    delay(3000);
}
 
Code:
void setup(void) {
  Serial1.begin(9600);

  Serial1.write(0x7E); 
  Serial1.write(0x03); 
  Serial1.write(0xA7);
  Serial1.write(0x1F); //  volume max
  Serial1.write(0x7E);      
  delay(3000);
}

I can't help you with the problem, but it might simplify your coding if you put all of the byte commands into a single string:

Code:
void setup(void) {
  Serial1.begin(9600);

  Serial1.print ("\x73\x03\xA7\x1F\x7E");
  delay(3000);
}

Or even using the gluing together of adjacent strings (after the comments are removed) feature:

Code:
void setup(void) {
  Serial1.begin(9600);

  Serial1.print ("\x73\x03\xA7"
                     "\x1F"               // volume max
                     "\x7E");
  delay(3000);
}

Now, you wouldn't be able to write null bytes with this approach, but you could still group the others together

Code:
void loop() {  

    // start sound (A0 for SD card)
    Serial1.print ("\x7E\x04\xA0");
    Serial1.write((byte)0x00);
    Serial1.print ("\x01\x7E");               // track number
    delay(3000);
}
 
That looks good, thank you. I will probably make constants for the different files, since I can't read the files from the SD card. Not great, but best I can do. Ran out of pins now so can't connect to the sound card using SPI

I did blow up the Teensy I believe. I made a rule for myself now to never run anything from the Teensy again. I can do anything with transistors that I need, it will keep my Teensy safe. I bought a power supply for my breadboard, still waiting for my Hobbyking batteries. So now I have 4.5V coming in from a AA battery pack. I am using that to run the sound card. Lost 2 days, now back to working on my range
 
To be honest, those modules are a big disaster! The datasheet (someone call datashit) it's a waste of time and was writed by a chinese psycho or his girlfriend. I unfortunately get one of this modules and get working easily by using 5V, serial at 9600 and (most important) a branded SD card level 4 of 2 giga. Apart that, nothing else works with this chip, it has tons of pins but almost all useless because not functional or undocumented.
Il will go to VT1053 or similar if you want something much better (at almost same price), with SPI and quality.
 
You seem to be right when it comes to the 5V. I was lucky I have a 4GB SD card that works with the module. I think it is a Sandisk.

My circuit was down to about 3.7V and I had to put the volume very low to get sound out of the card. I am now at 4.9V and I can almost get full volume. I looked at using an amp to boost the sound when running at 3.7V, but it seemed so much added things I decided I will just use 3 batteries rather than 2. It is going to make life alot easier it seems. I need to order schottky diode and replace my normal diode. I use the diode to drop the voltage a bit, because my circuit is now at 5.6V. The change in diode should give me the extra 0.3V that I need. The manufacturer said the max voltage is 5.2V

I will have a look at your recommended sound card/chip, thank you. I searched for VT1053 chip/VT1053 IC/VT1053 sound/VT1053 module. Can you please post a link to the module?

I figured out how I blew up my Teensy. I ran the sound card right from the Teensy and connected the speaker incorrectly, well would have blown it even if I connected the speaker correctly, because it draws 30mA if you do it right. I connected the negative of the speaker to ground and the positive to the one output on the sound card. That made the sound card draw 170mA when playing. Ofcourse the Teensy didn't like that much :)
 
If you look at the WM datashit(!) you will see the limit it's 2Gig but who can trust them? If you look at some forum posts on arduino site you will see that many people had troubles with sd cards and this chip, looks like it prefer branded type but I have 2 san disk level 4 (2gig) that simple freeze out chip (no matter formatting or whatever).
I think the chinese design this mainly for toys or miserable products, it has a clock function inside (documented but untested) so it prolly used in alarm clock as well.
About supply, those cards has an internal LDO for 3.3v and looks inside the main chip, the other 2 chip are a LM4890 for amp and a 16M spi eeprom memory. I suspect they add the SPI pins for program the spi eeprom only so this module it's a tiny monument of an chinese failure.
About teensy, did you checked the internal LDO? Maybe you blew up just that, in that case you can still using it in someway.

About VS1053.
I have used this http://www.ebay.it/itm/1PCS-MP3-Mod...382?pt=LH_DefaultDomain_0&hash=item3a77ca56de as player and works perfectly with arduino, it should work as is with teensy since it uses only SPI and board has it's internal LDO for the 3.3v. Pay attention that you need to add a sd card board since it's not included. It's again a chinese pos (piece of ...) product but it's cheap and works. This has the ability to record but I don't use it so I de-soldered some components.
I used the board as sound effects player in a star-trek style interface, loaded more than 300 tiny mp3 in a SD and used a an ATmega328p dedicated and Ethernet chip for trigger sounds by I2C and Ethernet with the main processor that drive the interface.
Here's a link to the chip datasheet: http://www.vlsi.fi/en/products/vs1053.html
This chip it's pretty interesting, it has internal wavetables so it can be used as midi player and can decode many audio format, I saw somewhere a link to play synthesized sound with it.
It's interesting the plugin page for this chip http://www.vlsi.fi/en/support/software/vs10xxplugins.html, I saw an eq, spectrum analyzer, etc. I think the b version of this chip has a programmable area where can be stored plugins, really interesting. Since it has I2S as well it may be nice experimenting more on this chip especially with teensy 3 I2S and hardware SPI capabilities
I must have somewhere the code I've used, if you need it.
 
What I like about this sound card is that I can communicate using just 1 pin, but it seems I might need to use RX and TX because when I send commands they don't seem to always be executed. When I press my trigger I send a repeat command and after releasing the trigger I send a stop command. The stop command doesn't always register if I press/release/press/release very very fast so the module keeps on playing after I release. Don't think anybody in the real world will be pressing the trigger like that, but I do want it perfect. So I will see if I can interrogate the module to see if the sound has stopped and if it hasn't I will send stop again. I might also build a flag into the code so that it doesn't try to send another command while it is busy in the process. I will do that first before using another pin

These are my pins at the moment
https://docs.google.com/spreadsheet/ccc?key=0AjYcEd1WlkqCdFA3eWltT2wzZ3dxTG5QdDJib0xVZkE&usp=sharing

Everything LCD related will change when I start integrating the tiny memory display of Adafruit (http://www.adafruit.com/products/1393). I believe it will use my SPI pins

I will also probably not have 2 sound cards anymore, because I might need the pins and it uses alot of battery power. Not sure how much your sound card uses, mine uses 30mA. I tried to disable the power to the sound card and then just enable it when I need sound, but it takes too long to start up so I will probably just switch it off when my gun hasn't moved for a minute or so
 
I did use it before, but I think my code is bad. Going to rewrite it. I have an idea of what I will do
 
Status
Not open for further replies.
Back
Top