Pages: 1 ... 13 14 [15]   Go Down
Author Topic: Arduino library for WTV020-SD-16P audio module  (Read 92816 times)
0 Members and 4 Guests are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello everyone,

May be this is a silly question, but I'm a newbie so.. sorry in advance...
Can I have direct access to the SD card with the WTV020? I mean, read and write files directly with an SD card library like the SD.h...

I want to use this module for two things in my project:
1.- Play some music files
2.- Store some html files for a micro-webserver

Do you think that this is possible or I have to buy another SD card module to store the HTML files?

Thanks!

Logged

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 92
Posts: 4702
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can make an SD adapter pretty cheaply. Google DIY SD card

If your Arduino is 3.3V then you don't have to do any voltage leveling, otherwise you will need a small handful of cheap parts for leveling.

The neatest voltage leveling I've seen uses 3.3V pullups on the SD adapter input pins and diodes on the same pins blocking 5V input. It only wastes a little power on one line.

When a 5V line is HIGH, the SD card reads 3.3V HIGH pullup because the diode blocks the 5V.
When a 5V line is LOW, it takes the pullup current away through the diode and the SD card reads LOW.
Feed the SD card VCC from a voltage divider and use that same line to power the pullups through 10k resistors.
That's 2 resistors for VCC and a resistor and diode for MOSI, SCK and SS.

However you wire it, there are oodles of voltage leveling circuits and chips, the code will be the same.
In your IDE under File->Examples->  you should find the SD examples and they should run.
Logged

I find it harder to express logic in English than in Code.
Sometimes an example says more than many times as many words.

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

Can this module be controlled totally by the arduino? If so what can be eliminated from the circuit? The project that I have in mind for it will require that it operate and change recordings via the arduino. Thanks!

d
Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 84
Posts: 3400
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Basically anything that uses a button can be replaced by the arduino. Volume, next/prev song, pause/play.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

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

What about the schematic? Does the module only need the three connections to the Arduino and the rest of the schematic  can be eliminated? Or do you need additional pins  on the Arduino. Thanks

d
Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 84
Posts: 3400
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Take a look at the attachment below. On page 5, it gives you a layout of what each pin does, and if you look at pin P04 and P05, you will see a secondary function. P04 is the clock, and P05 is the data, so with that, you basically only need two pins to get it to work, but you also need to send the correct data too.

The library was made to send said data, and all you need to do is wire it correctly.

* MP3%20Module.pdf (204.37 KB - downloaded 8 times.)
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

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

Thanks I'll give that a shot.

d
Logged

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

I am trying to get this working and I have a question re: schematic and sketch.  In the schematic it is showing only three pins on the arduino used. Pin 1 of the WTV020-SD-16P going to A3 on the Arduino, Pin 7 of the WTV020-SD-16P going to pin A4 of the Arduino, and Pin 10 of the WTV020-SD-16P going to pin 5 of the Arduino.



But in the sketch there are four pins defined. I wired it up as in the schematic but nothing is working.... What am I missing?

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

Thanks

Dan


* Schematic.jpg (39.06 KB, 1023x311 - viewed 4 times.)
Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 84
Posts: 3400
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

P06 is the busy pin (pin 5), it lets the arduino know when a audio file has ended.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

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

I guess I am confused about the reset which is defined in the sketch as pin 2 but in the schematic it is A3. And A3 in the sketch is defined in the sketch as the clock pin not the reset. Not clear to me at all.

d
Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 84
Posts: 3400
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The pins used in the diagram are just examples, it's the pins in the code you want to go by. Then again, you could always changes those too, but as long as you know which pin is what (clk,data,reset and busy) you can code it to work on any combination of arduino pins. Just note, if you plan on using the serial monitor, don't have anything in digital pins 0 & 1 , otherwise you may get incorrect results.
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Pages: 1 ... 13 14 [15]   Go Up
Jump to: