How to create a device that triggers a sound effect when a button is pressed using an arduino or RPi

Thread Starter

Cam2363

Joined Feb 2, 2018
15
I'm trying to make a device for my car that will play an audio file when a button is pressed.

I know the easiest way is to use one of those adafruit soundboards, but I don't have the money to get a bunch of those, so I'm trying to use what I have. I would like to use an Arduino as it would be more compact, but a raspberry pi would work too.

Now, I know nothing about programming, but I do know about creating electrical circuits, so I would need a step by step guide on the programming.

If anyone can help me with this, that would be great!
 

shteii01

Joined Feb 19, 2010
4,644
I believe that none of the boards sold by Arduino Foundation have enough storage space to hold an audio file. Which means you will need an add on board that has sd card reader. Which means that your assumption about compactness might be misplaced.
 

Thread Starter

Cam2363

Joined Feb 2, 2018
15
I believe that none of the boards sold by Arduino Foundation have enough storage space to hold an audio file. Which means you will need an add on board that has sd card reader. Which means that your assumption about compactness might be misplaced.
Ok. I can still use a raspberry pi. any idea with that?
 

BobTPH

Joined Jun 5, 2013
8,813
You can get boards that will play one of 10 different audio files based in button presses. Look on Ebay or Ali Express.

Bob
 

GopherT

Joined Nov 23, 2012
8,009
I'm trying to make a device for my car that will play an audio file when a button is pressed.

I know the easiest way is to use one of those adafruit soundboards, but I don't have the money to get a bunch of those, so I'm trying to use what I have. I would like to use an Arduino as it would be more compact, but a raspberry pi would work too.

Now, I know nothing about programming, but I do know about creating electrical circuits, so I would need a step by step guide on the programming.

If anyone can help me with this, that would be great!
You can certainly create your own sound with an Arduino. It is kind of fun using the PWM output. Modulate the high PWM frequencies to create audible frequency square [saxiphone], triangle [reasonable single tone], or sine [piercing bell] waves.

Over lay several at different frequency ranges using the random function to get "noise".

I made an explosion sound with a PIC, it too some time playing with the frequency ranges but it sounds pretty good.
 

Thread Starter

Cam2363

Joined Feb 2, 2018
15
You can certainly create your own sound with an Arduino. It is kind of fun using the PWM output. Modulate the high PWM frequencies to create audible frequency square [saxiphone], triangle [reasonable single tone], or sine [piercing bell] waves.

Over lay several at different frequency ranges using the random function to get "noise".

I made an explosion sound with a PIC, it too some time playing with the frequency ranges but it sounds pretty good.
Thanks, but im trying to use audio files to have it say something when i have a warning light on in my car. Thanks tho, I messed with that a little before and it was pretty cool
 

Thread Starter

Cam2363

Joined Feb 2, 2018
15
You can get boards that will play one of 10 different audio files based in button presses. Look on Ebay or Ali Express.

Bob
I stated in my question I am aware these things exist, but I dont have a lot of money and im trying to use stuff i already have.
 

kubeek

Joined Sep 20, 2005
5,794
You can use an SD card connected to your processor to store the files. FatFS was a nice library for accesing the files on the card, and reading a wav and playing it should not be too complicated. Just google a bit and you should find what you need.
 

GopherT

Joined Nov 23, 2012
8,009
Ok. I can still use a raspberry pi. any idea with that?
So I suggest you set up your raspberry pi, download Python, a very easy programming language.

Python can just be written and run, it doesn't have to be "compiled" it can be simply interpreted. There are so many tutorials and modules to download that it all becomes quite easy.

If you google raspberry pi and circuits, I'm sure you can even find a part to plug right into the Pi, and a Python script to interface with it.
 

Thread Starter

Cam2363

Joined Feb 2, 2018
15
So I suggest you set up your raspberry pi, download Python, a very easy programming language.

Python can just be written and run, it doesn't have to be "compiled" it can be simply interpreted. There are so many tutorials and modules to download that it all becomes quite easy.

If you google raspberry pi and circuits, I'm sure you can even find a part to plug right into the Pi, and a Python script to interface with it.
Ok. Thanks
 

BobTPH

Joined Jun 5, 2013
8,813
Okay. The Arduino probably does not have enough memory to store the sounds, so, it looks like you will have to use your Raspberry Pi, even though that is sort of like pounding in thumb tacks with a sledge hammer. You will also need an audio amp.

Bob
 
Top