Arduino Music shield noise

Talk about Arduino board, sheilds. Sharing Arduino projects, program, problems, solutions, suggestions..... many more, all are welcome.

Arduino Music shield noise

Postby cookietiau » Sun Dec 07, 2014 8:17 pm

Dear Expert,

I have an issue with my music shield where it produces the "noise" (i think they call it as white noise) whenever i play the sound. It happened both with my Mega and Uno.

I have also tested with iPhone earphone as well as my desktop PC speaker. Could it be due to grounding issue?

Do you have the same experience and if anybody know how to overcome this?

Thanks in advance.

Best Regards
Cookie
cookietiau
Newbie
 
Posts: 8
Joined: Sun Dec 07, 2014 8:13 pm

Re: Arduino Music shield noise

Postby ober » Sun Dec 07, 2014 8:18 pm

Which music shield? Can you provide the link of the shield or Maybe a photo of actual hardware?
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: Arduino Music shield noise

Postby cookietiau » Mon Dec 08, 2014 6:23 pm

Hello,

Thanks for your reply. It is cytron mp3 shield. The link would be:

http://cytron.com.my/p-shield-mp3?search=Music%20shield

Best regards
Cookie.
cookietiau
Newbie
 
Posts: 8
Joined: Sun Dec 07, 2014 8:13 pm

Re: Arduino Music shield noise

Postby Idris » Tue Dec 09, 2014 9:53 am

Hi cookietiau,

We have try the Cytron MP3 Shield with Speaker 8R 0.25W and we record it. You can refer to this youtube video.

So, if you can record your music played by Cytron MP3 Shield and share with us, at least we have something to compare.
Cytron Technologies invest time and resources providing tutorial, training and support for STEM education and maker movement. We need your support by purchasing products from Cytron Technologies. Thanks.
http://www.cytron.com.my
User avatar
Idris
Moderator
 
Posts: 409
Joined: Thu Mar 22, 2012 5:28 pm
Location: Pulau Pinang

Re: Arduino Music shield noise

Postby cookietiau » Tue Dec 09, 2014 11:01 am

Hi Idris,

Thanks for your reply.

Basically I have tested with both desktop speaker and Iphone earphone. Both are consistent with the issue.

I will record the sound and will provide the link but I can only do that later.

I noticed if you set the volume to 240 and above, the sound is not that visible but let say for testing purposes where I put the volume to 150, then the sound is very visible.

Best Regards
Cookie
cookietiau
Newbie
 
Posts: 8
Joined: Sun Dec 07, 2014 8:13 pm

Re: Arduino Music shield noise

Postby cookietiau » Fri Dec 12, 2014 8:42 am

Dear Expert,

I have uploaded the video in youtube. Basically i have purposely set the volume low to make the noise "visible". I have tested with Uno and Mega board and so far both are also showing the same behavior.

https://www.youtube.com/watch?v=Q5Q_Urpon48

Best Regards
Cookie
cookietiau
Newbie
 
Posts: 8
Joined: Sun Dec 07, 2014 8:13 pm

Re: Arduino Music shield noise

Postby yonghui » Fri Dec 12, 2014 11:34 pm

Hi, can your share your arduino code? and the schematic of your circuit?
thanks&regards,
yh
yonghui
Moderator
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: Arduino Music shield noise

Postby cookietiau » Sun Dec 14, 2014 9:29 pm

Hi yonghui,

Below are my codes. Im using the shield with a mega board.

CODE: SELECT_ALL_CODE
#include <MP3Player.h>

MP3Player playerone(3, 2);

int button1 = 0;
int button2 = 0;
int state;
byte mute=0;
byte play_pause=1;

long debouncing_time = 15; //Debouncing Time in Milliseconds
volatile unsigned long last_micros;


void setup()
{
  //initialize the player: setup STA013 from STA013.cfg file in SD card, print status to through serial terminal
  playerone.Init(); 
  playerone.Volume(240);
  pinMode(6, INPUT);
  pinMode(7, INPUT);
  attachInterrupt(0, debounceInterrupt, RISING);
  state = 0;
}

void loop()
{
  button1 = digitalRead(7);
  delay(10);
  button2 = digitalRead(6);
  delay(10);

  if(state == 0)
  {
    play_nature();
  }
  else if(state == 1)
  {
    play_train();
  }
   
}

void play_nature()
{
  playerone.Init();
  playerone.Volume(245);

  playerone.Play("nature.mp3"); 
}

void play_train()
{
  playerone.Init();
  playerone.Volume(240);
  playerone.Play("train.mp3");
  state = 0;
}

void play_next()
{
  change();
  playerone.PLAY=false;
}

void change()
{
  state = 1;
}

void debounceInterrupt() {
  if((long)(micros() - last_micros) >= debouncing_time * 1000) {
    Interrupt();
    last_micros = micros();
  }
}

void Interrupt() {
  change();
  playerone.PLAY=false;
}


As for schematic, it is not that complicated as i only used 1 button to pin 2 to trigger the interrupt and with that setup i also include the pulldown resistor to flush the line.

Together with this shield, i am also having some "clicking" sound whenever it changed the mp3 track but not as visible when i press the interrupt button. (i have created another thread for that issue.)

Best Regards
Cookietiau
cookietiau
Newbie
 
Posts: 8
Joined: Sun Dec 07, 2014 8:13 pm

Re: Arduino Music shield noise

Postby yonghui » Sun Dec 14, 2014 11:25 pm

for the hardware button, i think u can add a 0.1UF multilayer or ceramic cap accross the push button as debouncing for the signal to replace the software debounce method.
the click sound i think is because u directly stop the audio, the speaker facing a sudden lost of signal/volume can cause click sound. mayb u try slowing down the volume slowly in 1 seconds then only stop the audio.
thanks&regards,
yh
yonghui
Moderator
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: Arduino Music shield noise

Postby ober » Mon Dec 15, 2014 9:31 am

cookietiau WROTE:Hi yonghui,

Together with this shield, i am also having some "clicking" sound whenever it changed the mp3 track but not as visible when i press the interrupt button. (i have created another thread for that issue.)

Best Regards
Cookietiau


I guess the noise occur when interrupt button is press is due Arduino stop reading the MP3 file in SD right? As it need to serve the interrupt by going into ISR. Though I do not know what is being done in ISR, but it will definitely affect the main program to read the MP3 file and further send it to MP3 decoder. Am I right?
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Next

Return to Arduino Based

Who is online

Users browsing this forum: No registered users and 26 guests

cron