Arduino Forum

Using Arduino => Audio => Topic started by: Sanchest_9 on May 16, 2018, 07:31 pm

Title: Audio from SDCard to USB & AudioJack Speaker
Post by: Sanchest_9 on May 16, 2018, 07:31 pm
Hello there!

I had an idea of a speaker playing a song as soon as I open the gate of my garage. I made some notes but I still couldn't figure out how it will work.

These are the objects I think could make this possible:

- Battery Snap to barrel plug, so I can power the Arduino Uno:
(https://images-na.ssl-images-amazon.com/images/I/41Km5pRH7cL.jpg)
- MicroSD Card Module, so the Arduino can get the Music:
(https://img.staticbg.com/thumb/view/upload/2012/lidanpo/SKU122168a.JPG)
- Male to Female jumper wires, so I can connect the MicroSD Card module and other modules:
(https://images-na.ssl-images-amazon.com/images/I/61nHxQZGSTL._SX355_.jpg)
- Trust Ziva USB Speaker, to play the sound:
(https://images-eu.ssl-images-amazon.com/images/I/41T7DCapj%2BL._SL500_AC_SS350_.jpg)
- USB Module, to connect the speakers to the Arduino Uno:

(https://www.robotistan.com/ch375b-usb-flash-disk-readwrite-module-for-arduino-21048-64-B.jpg)

- 3.5mm Audio Jack module, to connect the speakers to the Arduino Uno:

(https://s4.sywcdn.net/getImage?url=http%3A%2F%2Fc.shld.net%2Frpx%2Fi%2Fs%2Fpi%2Fmp%2F10152378%2Fprod_16555413224%3Fsrc%3Dhttps%253A%252F%252Fimages-na.ssl-images- amazon.com%252Fimages%252FI%252F51AXYDk9-lL._SL1024_.jpg%26d%3Db55dfb648ee831da24f4601e3aca9824e819c6e1&t=Product&w=1000&h=1000&qlt=100&mrg=1&str=1&s=71f703d1ab186695d271ac846711efef)

I don't know a lot about the Arduino so it might help explaining in detail if somebody is willing to help.
Title: Re: Audio from SDCard to USB & AudioJack Speaker
Post by: DVDdoug on May 16, 2018, 09:05 pm
USB speakers require a USB driver (Typically running under Windows, OS-X, or Linux).    And, the UNO is a USB device (like the USB speaker) not a USB host.

Your best bet is an audio shield (https://www.sparkfun.com/products/12660).   (Maybe that's what you have...  Your image doesn't show-up in my browser.)  They come with various features, but they all have a memory slot, a sample-rate clock, a DAC, and all of the necessary firmware, etc., to "make sound".   The Arduino is just a "master controller", and in some cases the audio shield can work without a microcontroller.

An audio shield will work with regular (analog) powered computer speakers, or with an amplifier and speakers.   Or, some audio shields can drive a passive 8-Ohm speaker (at low power).