iSheepsters / sheep-brain

The brains of the Sheep
2 stars 1 forks source link

Basic MP3 audio module software #2

Open objectiveSee opened 6 years ago

objectiveSee commented 6 years ago

Purchase and assemble circuit to play audio from ESP32 or Arduino using a MP3 module. Determine if this will satisfy our project needs. They can be purchased on Amazon for $5-$10

https://www.dfrobot.com/product-1121.html

Documentation: https://www.dfrobot.com/wiki/index.php/DFPlayer_Mini_SKU:DFR0299

Code: https://github.com/DFRobot/DFRobotDFPlayerMini/blob/master/examples/FullFunction/FullFunction.ino

Can we write to the SD card via SPI? Would be useful for data logging but likely not possible.

objectiveSee commented 6 years ago

Some parts we can try:

Amplifier:

I don't know what power or other requirements we will demand for amp. We could just use a small one for our testing, and figure out the final one later.

https://www.amazon.com/5V-12V-Amplifier-Module-Arduino-EK1236/dp/B01FDD3FYQ/ref=sr_1_4?ie=UTF8&qid=1523860302&sr=8-4&keywords=LM386#customerReviews

Documentation: https://www.adafruit.com/product/987

or

https://www.amazon.com/Audio-Development-Tools-Stereo-Amplifier/dp/B00N42NP6W/ref=sr_1_1?ie=UTF8&qid=1523860736&sr=8-1&keywords=MAX98306

MP3 Module:

https://www.amazon.com/Longruner-DFPlayer-Player-Arduino-LK01/dp/B01MXOFAE4/ref=sr_1_4?ie=UTF8&qid=1523860546&sr=8-4&keywords=mp3+arduino+dfplayer#customerReviews

Speaker IDK anything this... but some cheap-o one should do for our preliminary hacking.

https://www.amazon.com/Adafruit-Stereo-Enclosed-Speaker-Set/dp/B00QSJ1HA4/ref=sr_1_14?ie=UTF8&qid=1523860625&sr=8-14&keywords=3W+speaker

jslabovitz commented 6 years ago

I'm feeling that we should use weatherproof speakers. The cones are plastic instead of paper, and other parts are generally better sealed and protected.

Here's one that's reasonably priced @ $12.50/pair == $6.25 each:

https://www.parts-express.com/pyle-plmr41w-4-dual-cone-waterproof-speaker-pair-white--267-7024

jslabovitz commented 6 years ago

It appears that the MP3 module can not write to the SD card. Nor can the data on the card be accessed in any way other than being a folder/file reference for the player module.

This is probably for the best, as SD cards are easily corrupted in the field. Treating the audio SD card as read-only (from the sheep's point of view) is probably best for reliability. (Though it would still be a good idea to have a pile of SD duplicates while at BRC for easy swap-out.)