Photon and how to create sound

Hey guys! So I’m new to using a Photon and I was wondering if anyone knew how to create sound using the Photon alone or with a speaker. This is is something that I needed because I will want to make a alarm using the Photon, TFT shield, and a speaker. Thank you! :grin:

Have you tried searching the docs and/or the community yet, since there are some topics on this already…

From experience I can say that this works a treat: A great & very cheap MP3 sound module without need for a library!

1 Like

To play a simple alert tone, I’ve used something like [this Piezo buzzer from Adafruit] ( They’re inexpensive and you can play specific frequencies using the Photon’s [tone()] ( function. It might not be loud enough for an alarm, though.
Also, I second the recommendation from Moors7. That’s a nice module.

1 Like

You could also do PWM, but that’s processor-intensive and, unless you like that " ‘classic’ 8 bit effect" Moors’ notion trumps it … Especially at that price, I paid more than that for the last SPI microsd reader module I bought!

I’d probably want to amplify it too for an alarm. Some little LM395-driven amp would do the job… ?

1 Like

I just plugged some really really cheap battery powered speakers into it and never had it on full volume I believe. It’s plenty loud on its own. (Then again, I could also not know that there might be an amp inside the speakers, so forgive me on that one if so)

If it’s just for an alarm and need a high volume speaker only, then have a Google for “120db alarm”, and you should find plenty that you can hook up. Cheap and extremely loud. You’ll just need a 12V power source and something to switch that with, like a relay or a mosfet.

1 Like

“Powered Speakers” == “Amplified”. Actually, since they were battery-powered, and cheap, they were probably LM3* amps. Typically milli-to-single-digit watts. A tens-of-watts option would be the TD* amps. I have a little 35 watt/channel TD* that I tossed together on my desk at home that really sounds fairly decent with a reasonably set of bookshelf speakers.

To the topic, though, a little 1-3 watt amp can be assembled for around $3 out of China, hardly worth not doing it just 'cause.

I built an alarm clock for a friend way back in college - it charged a little air cylinder all day just to deafen you (and most of the dorm) for a couple seconds every morning. :wink: