cheap sound module: what version is this?

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?

Here you have a sample from the PAM8803 library:

Pam8803.h:

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

/*
 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

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.

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.

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.

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.

Video update about my Arduino project. Now with fire selector: Regular or Stun laser gun.

the-rebel-agent:
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

Ok, nevermind. I see you answered my question in this post.

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

-transfinite

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.

onesky:

the-rebel-agent:
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.

Waytronic-Jasmine(Li):
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?

the-rebel-agent:
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:

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.

I may post in the wrong topic but anyway, I need to be sure.

This module do play .wav files (16bits, 44,1 Khz) ?

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?

Is this module can play .wav files (16bits, 44,1 Khz) ?

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

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!

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.