Advanced search FAQ Register Login

It is currently Tue Feb 20, 2018 2:44 am

 

Postby Streamed » Wed Aug 16, 2017 5:34 pm

Hi Guys/Girls,

100% new to this Raspberry Pi stuff, but I’m looking to make an audio switch (like a doorbell) so when you press the button it makes what ever sound I choose; I wont be using for a doorbell though.

I’m unsure what items I will need to buy, obviously a Pi board but the other bits I have no clue. Would you be able to point me in the right direction.

Thanks in advance,

Ryan

Streamed
n00b

Posts: 2

Joined: Wed Aug 16, 2017 5:29 pm

Postby Dave » Thu Aug 17, 2017 9:53 am

Sounds like you'll need a button (not a latching one) - https://www.modmypi.com/adafruit-indust ... ts/buttons

A speaker - https://www.modmypi.com/adafruit-indust ... ch=speaker

And a Pi as mentioned, but that's pretty much it I think.

Wire up the button to your GPIO pins, write a bit of code to detect a button press and play a sound when pressed. Simples!

Dave
ModMyPi

User avatar

Posts: 2154

Joined: Wed Jul 22, 2015 11:36 am

Forum Administrator & Technical Support

Postby Streamed » Thu Aug 17, 2017 3:11 pm

Thanks for the reply! Much appreciated.

I plan on making a wooden box for all this to sit in so it will need a power source, had a look on this website and found a few options, Lipo batts and 9v batts, any ideas which will be best doesnt have to last days; maybe a couple of hours each time.

Also will I need any cables for this?

Sorry to be a pain and asking all these questions, I only have a couple weeks to make this before the purpose I'm making it for :lol:

Thanks Again.
Ryan

Streamed
n00b

Posts: 2

Joined: Wed Aug 16, 2017 5:29 pm

Postby BMS Doug » Wed Aug 30, 2017 8:49 am

any button should ideally have a 1k resistor attached (prevents shorting out the GPIO if you accidently program it to be an output) , I would also recommend using a 10k resistor to pull up (or down) the input while the button is waiting to be pressed.

Image
https://www.cl.cam.ac.uk/projects/raspb ... _switches/

BMS Doug
31337

Posts: 273

Joined: Tue Sep 08, 2015 3:55 pm

Location: London

Doug.

Volunteer Moderator.

Postby BMS Doug » Wed Aug 30, 2017 9:00 am

you could use a single channel of this breakout board to provide your button with both pullup (or pulldown) resistor and current limiting resistor. (Thats exactly the purpose that this board is designed for).

Full disclosure, I designed the board and will financially benefit if you buy one.

BMS Doug
31337

Posts: 273

Joined: Tue Sep 08, 2015 3:55 pm

Location: London

Doug.

Volunteer Moderator.

Who is online

Users browsing this forum: No registered users and 2 guests

Board index

The teamDelete all board cookies • All times are UTC [ DST ]