Thumb Drive as Storage - Direct Wired

Hey guys, pretty new to arduinos, just wondering if it's possible to wire a thumb drive into my board to act as storage. Basically playing around trying to find a poor mans storage device to hold .wav files that I can play off speakers, but I can't find anything about doing it online.

Thanks!

Thumb drives are USB which is a pretty difficult interface to implement on a microcontroller.

Generally people use SD/microSD cards for mass storage on Arduino and there are tutorials available for doing this sort of thing.

Yeah I've seen tons of tutorials on SD cards, was more curious if a thumb drive could be hacked and wired into the board. I may have to shift my focus to SD.

Thanks for the quick reply!

No. A thumb drive needs an operating system and a driver.

You can get an SD card shield.

to hold .wav files that I can play off speakers,

Do you know the regular Arduino doesn't have a DAC?

Usually, the best way to get sound from an Arduino is with an audio shield. The audio shield has memory, a DAC, a clock for the digital audio, and sometimes an MP3 decoder. So the audio shield does all the "hard work" Arduino just acts as a master-controller.

There is a https://www.arduinolibraries.info/libraries/tm-rpcm[/b]TMRpcm to "simulate analog" with PWM so you don't need a DAC or audio shield. I've never used it and in most applications it wouldn't be my 1st choice. Some people say the sound quality is OK and some people have trouble with the sound quality. And if the PWM is not properly filtered it can burn-up your amplifier.

The Arduino can directly-drive a Piezo transducer but if you want to drive regular 4 or 8 Ohm speakers, you'll need an amplifier (or some audio shields have a small built-in amp) or you can use regular "powered" computer speakers.

DVDdoug: Do you know the regular Arduino doesn't have a DAC?

Oh it doesn't? I have an Uno R3, and was not aware of this; good to know.

DVDdoug: or you can use regular "powered" computer speakers.

I am currently using a hacked set of computer speakers (4 Ohm 2W) but I'm simply using the speakers directly into the breadboard, with a 10K resistor and using tone() for now, it does work but playing .wav or .mp3 won't? Should I be using the board from inside the speakers as well? Pardon my ignorance.

Do an ebay search for "arduino wav module" and you will find several options (some better than others) that have an SD card slot and MP3/WAV audio decoder/players. Give more details of what you want from the WAV audio and someone can maybe suggest a specific module to use.

Riva: Give more details of what you want from the WAV audio and someone can maybe suggest a specific module to use.

Yeah! Good idea!

All I want to do is have sound files play on specific actions.

Now, it sounds really silly, but the final project is going to be a prop "bomb" for Airsoft. I have pretty much all of the core game designed and working, I just want a sound file to play "Bomb Armed"/"Bomb Disarmed", or something of the like when such action is performed.

Right now I have tones that play when the arm/disarm button is initiated and a deep tone when the arm/disarm fails, but having some audio bytes would add some fun to it.

After some research, I'm leaning towards this? My speakers are 4Ohm 2W (each).

https://www.amazon.ca/GPD2846A-Decoder-Amplifier-Module-Arduino/dp/B07NTSB31H/ref=sr_1_2?keywords=arduino+amplifier+2W&qid=1553622918&s=gateway&sr=8-2

Maybe you can get away with just using the Talkie library and maybe an audio amplifier. It uses quite a bit of flash memory but as you only need a limited vocabulary it may be good enough.

Riva:
Maybe you can get away with just using the Talkie library and maybe an audio amplifier. It uses quite a bit of flash memory but as you only need a limited vocabulary it may be good enough.

Okay that is pretty cool! Something I’m definitely going to look into! Thanks!

Another option is to use the TMRPCM library. That will let you play .WAV files from an SD card.

Use an audio shield or MP3-player module. There are some insanely cheap MP3 player modules on ebay (like, cheaper than a cup of coffee) - they all take an SD card (or more frequently micro SD card). This is the correct way to play sound files under control of an arduino.

Using a thumb drive for storage on an Arduino is possible, but you need a USB host board (which costs more than an arduino from the same supplier, eg, 30+ from adafruit/$parkfun, 5+ on ebay), and interfacing with them is resource intensive and awkward. USB host on a microcontroller is awkward, expensive, and except for very common USB devices (HID, mass storage, that kind of thing) with generic interfaces, often hard/impossible to make work because you need drivers, which are only provided for the major OS's. So if you wanted something exotic, you'd need to write your own driver, which would require information that the manufacturer may not make available. But in any case, even once you get the sound file off the thumb drive, it's hard to turn that into sound on an Arduino with acceptable fidelity. So what I'm saying is, host shields exist to interface with USB devices that are meant to plug into a computer - but they are expensive and hard to use and almost never the right tool for the job. And generating decent-quality sound from an Arduino is hard too.

DrAzzy: Use an audio shield or MP3-player module. There are some insanely cheap MP3 player modules on ebay (like, cheaper than a cup of coffee) - they all take an SD card (or more frequently micro SD card). This is the correct way to play sound files under control of an arduino.

I've noticed several that should work for what I need. I'm, hopefully, going to run 2 x 4 Ohm 2W speakers and I think this one should work as an all in one solution? It has an amplifier built in, which is what I'm going to need to play the files loud enough without hurting the controller. It looks simple enough to use.

https://www.amazon.ca/dp/B075XD85FT/?coliid=IH62IA5FT3QHP&colid=2RBUUEF8A8WAT&psc=0&ref_=lv_ov_lig_dp_it

Viper_Airsoft: going to run 2 x 4 Ohm 2W speakers...

Seems these mono MP3 modules can only drive one 4ohm speaker. Leo..