Go Down

Topic: Audio chip options? (Read 893 times) previous topic - next topic

xl97

May 28, 2019, 04:42 pm Last Edit: May 28, 2019, 05:22 pm by xl97
Hey gang-

I am looking for some feedback here.. as audio has always been something very difficult for me to grasp (hi/lo pass filters..etc)

In the past.. I have created custom boards/pcbs that either:

a.) were a merge of an Arduino and Adafruit waveshield (all SMD and merged into one board)

or

b.) have use the DFPlayer mini board  (more so my go-to solution as of late)

cons:

a = the Arduino does most of the heavy lifting here... and doesnt leave much room to do too much else.

b = the YX5200 chip is a 'serial' interface chip (send it some serial/hex value, and it plays the song.. or loops.. or skips...etc  yadda yadda)...   but you can NOT use the micro SD card to house/read any sort of text file (so no parameter setting can be done via .txt file for the program)

I have also never take the core components that make up the DFPayer  (yx5200 chip, amp..etc), and merged them into an all-in-one board before..  (I still need to look up the amp chip used)


The DFPlayer mini board is dead simple to use.. does all the heavy lifting/audio playing..  and are quite cheap.

(outside of my never merging the circuit into a pcb that also have an Arduino compatible circuit before.. and it not allowing to read .txt files from the uSD card... this is an acceptable solution for me)

That being said.. are there any other recommended chips out there that other have used?

* Simple to use
* not many components required
* allows for reading not only .wav files.. but .txt files as well

Any feedback is appreciated.

Thanks!



current course is to course and see how to incorporate the:

Audio chip:
YX5200-24SS:
https://forum.arduino.cc/index.php?topic=349317
Chinese datasheet:
https://www.dropbox.com/s/jmtd9y465pn2olo/yx5200%E8%8A%AF%E7%89%87%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E%E4%B9%A6V1.0.pdf?dl=0


3W amp:
YX8002-8S:

https://forum.arduino.cc/index.php?topic=349310.0
Datasheet:
http://www.ti.com/lit/ds/symlink/lm4871.pdf


* YX8002-8S  = Interchangeable with LM4871/XPT4871.

** How so?  the image in one shows many more pins that the LMx variant?

wvmarle

https://github.com/TMRh20/TMRpcm
Sound quality is not exactly HiFi but on my simple speaker it's actually pretty decent, and barely any external parts needed.

Besides, nothing wrong with just taking the DF Player (or a cheap clone) and soldering it onto your custom PCB. I'd consider redesigning that into my own only for a project I'd need hundreds of. And even then. It's compact, really inexpensive, and it gets the job done very well.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

xl97

#2
May 28, 2019, 11:29 pm Last Edit: May 28, 2019, 11:33 pm by xl97
I agree...  (re: just soldering a DFPlayer module onto the PCB)..

but space will be limited....  and I'd like a 'solution' for when it does come time to make a custom PCB with audio capabilities..


re: https://github.com/TMRh20/TMRpcm

I -think- (I'd have to go back and look, its been years) I used this on a SpiderMan webshooter project.

8 MHZ
3.3v
no amp
micro SD card..

was NOT loud at all.. but made the 'thwip' sound decently enough..

I made this one:
https://www.dmstudios.net/misc/scab_assembly/all-in-one_2.jpg

(on the left.. merger together.. vs the Arduino UNO & Shield to the right)

If I can source those amps..  and the YX5200 chips.. I might just order some to see what it takes to get them all set up properly and working.


(hmm.. wonder if they make breadboard friendly versions.. or just SMD packages?)

wvmarle

Easy enough to amplify that sound :-)

For the DF player you're going to have a hard time making it take up less space than with the module, considering both sides of it are pretty thoroughly used. If your PCB design is single sided you're probably going to need more board area overall.
If you raise the DF player a little bit up from the board you could use the space of your board that's covered by it for other components. Makes the board area smaller, but the overall project a bit thicker.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

xl97

#4
May 29, 2019, 08:46 pm Last Edit: Nov 13, 2019, 05:38 pm by xl97
all good points.

I'm -not- 100% opposed to adding the DFPlayer board with some single sided or through hole pins..

and true the DF board IS populated on both sides..

hmm..

I'd still like to learn how to incorporate the raw parts... but maybe not for this project now.. LOL

Rykkers

Let us know what you did in the end. I'm just considering the same problem myself. Whether to add the DFPlayer to a custom board, with through-holes.

Or to deconstruct and make my own, and get it all assembled on one board

MorganS

It is usually better to use the module as-is. Don't try to copy the design onto your PCB without thoroughly understanding everything about how the module works.

It also saves space to have a second PCB stacked because now you can put your own components under the footprint of the module.
"The problem is in the code you didn't post."

xl97

I had already created board(s) that used the DFPlayer with through hole pins...


I was/am looking to save even more space by using SMD headers  (so the pro-mini and DFPlayer can be stacked 'on top of one another' (so to speak)..  with a 'connecting' PCB in between...

or

trying to merge the basic 'arduino compatible' circuit and DFPlayer components into a custom PCB board/design..  (still not off the table I suppose)

I'll sending off option #1 above to get the boards soon

I still hate this missing feature when going the DFPlayer router over my custom (or even the legit shield from Adafruit) Waveshield board

----------------
ie: (I dub'd it s.c.a.b)
https://www.dmstudios.net/misc/scab_assembly/all-in-one_2.jpg

compares the Adafruit Waveshield stacked on an UNO and my all-in-one board  (both combined basically..lol)

* assembled using my $17 toaster oven at home..  ha!
----------------

Is that the DFPLayer does not allow you read/store any .txt files on the SD card.. (well I guess you could put one there..but it would be useless to access)..

Because its a serial based chip..

I think I posted on this in the past to chit-chat about how to go about also connecting the SD card to the SPi pins.. and trying to toggle access between the DFPlayer chip (YX5200).. and the SPI bus to attempt both..     but really seemed to complicated.  (and I'm just a hobbyist at best!)  :)




AidanRTaylor

#8
Nov 13, 2019, 03:59 pm Last Edit: Nov 13, 2019, 05:10 pm by AidanRTaylor
I'm just dropping in to say I am very interested to see how you get on and I am probably going to try this in parallel. I have been working with Teensy for the last couple of years for research related projects - sometimes Teensy is necessary for dynamic sound or other things that Teensy does very well, but often a project will just require the ability to play a sound from memory with reasonable quality and have some standard GPIO available for other things.

Some of the things I have been working on lately have been more at 'evaluation' stage requiring about 50 units for user testing - dropping a Teensy in makes this pretty expensive, and of course adds some annoying vertical depth in your electronic design. For simple audio playback I would love a cheapo option that could be driven by an ATTiny85 or something similar!

Probably a start is to try to make a generic YX5200-24SS module a bit like the DFPlayer - do you know if the YX5200-24SS needs flashing in any way or is it fully configured from factory?

Diolch yn fawr

Edit: as a little update - I ordered some YX5200-24SS and some SSOP24 adaptors for breadboarding

xl97

There is an open source project floating around (posted here as well I believe).....that was a community/group effort for a lightsaber project that used the YX5200 chip set in a custom PCB..

* (vendor even posted here what DAC was used and other documentation for the components)

My only gripe with that is the SD card can ONLY be used to hold the .wav/.mp3 files..  and not any other assets (ie: .txt files or something)


An older custom approach I did was the following:

Arduino & WaveShield 'all-in-one' approach:
https://www.dmstudios.net/misc/scab_assembly/all-in-one_2.jpg

This was a better approach as far as being able to house .txt file for parameters to be used in the code..  (customizable in a way)  however.. this still used the main 328 chip to process things..   (YUK!)..




I like that the DFPlayer module handles all the playback stuff.. and that simple serial commands control it!!!
Hate that because its serial based, there is no way to access any other content on the SD card

I like that the WaveShield can do playback and as well and treats the SD card like a normal SD card.. so you -can- put .txt files on it
Hate that it makes the mioan 328 chip do the processing..etc..


Not sure what the middle ground is here?  (if any)


My understanding is the yX5200 chip does NOT need flashing..  

AidanRTaylor

#10
Nov 27, 2019, 01:44 pm Last Edit: Nov 27, 2019, 01:56 pm by AidanRTaylor


YX5200 chips arrived, I soldered to a breakout and have some other scrap modules to get it working with Arduino. I will move over to ATTIny at some point, but the USB Serial interface is handy at the moment. I have this working ok.

I get a lot of noise in the audio signal which isn't there with the DFPlayer Mini. It seems to be SD card related, as it only happens during playback - it is making a consistent clicky grindy noise. I have made the wires almost as short as I can, and tried decoupling caps in a few places with no luck so far. It is hard to tell if this is just 'breadboard' noise or something else - any suggestions?

EDIT: Sorry, I posted too soon - resistors were too big on audio line, much better S/N ratio now! :)

wvmarle

I had to place 1k resistors in the Tx/Rx lines between Arduino and DF Player. Can try the same in your setup. It'll dampen noise coming from the Arduino.
A 100 nF cap soldered between the Vcc and GND pins onto your breakout is another recommendation. It's a digital chip so needs good decoupling. The electrolytic that's placed right to the board I guess is between GND and Vcc as well, this is good, keep it.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

AidanRTaylor

#12
Nov 27, 2019, 02:44 pm Last Edit: Nov 27, 2019, 02:46 pm by AidanRTaylor
I had to place 1k resistors in the Tx/Rx lines between Arduino and DF Player. Can try the same in your setup. It'll dampen noise coming from the Arduino.
A 100 nF cap soldered between the Vcc and GND pins onto your breakout is another recommendation. It's a digital chip so needs good decoupling. The electrolytic that's placed right to the board I guess is between GND and Vcc as well, this is good, keep it.
Thanks wvmarle - The VCOM pin (23) needed suitable decoupling - that turned out to be the biggest culprit. I had too much load in my audio signal path, when I fixed this the noise was reduced but didn't go away. I have a 10uF and 100nf cap decoupling the VCOM pin and this has made a good improvement - good enough for a chip that has cost $0.90 anyway!

I found the datasheet for the YX5200 and google docs allows you to translate, for some reason it doesn't translate the latter half of the  doc - lots of good info in here though: Datasheet

xl97

#13
Nov 27, 2019, 03:31 pm Last Edit: Nov 27, 2019, 03:37 pm by xl97
You need the resistors..

they even show you that in almost every wiring diagram too.

What DAC and AMP are you currently using then?  Same as used on the DFPlayer module?


Speaking of DFPlayer..

I was recently making a project using one (a prop, that behaves an ALIENS Pulse Rifle)..

and I think the DFPlayer has some problems with repeated 'play' commands..

It sorta 'glitches'..   (not sure how else to describe it)


Try this trimmed down example please:

** what I am looking for feedback on is:

* if you hole down the button.. do you/anyone get a CONSISTENT sounding playback?

It should sound like a 'machine gun' with the same 'timing/rhythm'  but it DOES NOT.
For some 'bursts' it sounds normal.. but when you hold down the trigger/fire button for more than just a quick press.. you will notice the audio is not consistent and gives this glitch every other couple 'playbacks'


Code: [Select]

//#include "Arduino.h"
#include "SoftwareSerial.h"

//create DFPlayer instance

//power broker
#include <DFPlayerMini_Fast.h>
DFPlayerMini_Fast myDFPlayer;

//default
//#include "DFRobotDFPlayerMini.h"
//DFRobotDFPlayerMini myDFPlayer;

SoftwareSerial myDFPlayerSerialConn(7, 8);

//project (firing) variables (global)
long previousFireMillis = 0;
byte fireSpeed = 96; //mSeconds: 1000 = 1 second  //96 was decent


void setup() {
  byte i;
  //debug (monitor)
  Serial.begin(115200);
  
  //talk to DFPlayer
  myDFPlayerSerialConn.begin(9600);

  Serial.println(F("Initializing DFPlayer ... (May take 3~5 seconds)"));
  if (!myDFPlayer.begin(myDFPlayerSerialConn)) {
    Serial.println(F("Unable to begin:"));
    Serial.println(F(" - Please recheck the connection!"));
    Serial.println(F(" - Please insert the SD card!"));
    while (true);
  }
  Serial.println(F("DFPlayer Mini online."));
  //myDFPlayer.setTimeOut(500); //doesnt work with power_broker version?
  myDFPlayer.volume(7);
  //myDFPlayer.EQ(DFPLAYER_EQ_ROCK); //doesnt work with power_broker version?
  //myDFPlayer.outputDevice(DFPLAYER_DEVICE_SD); //doesnt work with power_broker version?

  //play boot sound (not used any more)
  myDFPlayer.play(1);// (1) - boot
  delay(500); // (yuk) but gives time for boot sound to play un interrupted
 
  // Whew! We got past the set up stuff
  Serial.println(F("Ready!"));  

}



void loop() {
  
  unsigned long currentFireMillis = millis();
  if(currentFireMillis - previousFireMillis > fireSpeed) {
        
        //update the last time you shot (blinked the LED)
        previousFireMillis = currentFireMillis;

        //fire (sound)
        myDFPlayer.play(5); // (2) - auto fire
  }

}


I'm interested in feedback.

Thanks


wvmarle

I experienced glitches before (see here): it won't always start playing at the start of the track. Very irritating when playing short samples (like your gun sounds), or when timing of the start is very important (as it was for my application).
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Go Up