Can the Adafruit Sound board be triggered by motion sensors?

Hey all,

I’m hoping to purchase this:

However, it looks like I can only trigger audio by pushing buttons (reference: Triggering Audio | Adafruit Audio FX Sound Board | Adafruit Learning System)

Is it possible to trigger the audio using motion sensors instead? Or other types of triggers besides buttons?

Thank you!

Tina (Arduino newbie)

1 Like

Hi Tina,

That board actually features control over UART as an option, so you can either use an Arduino to read your sensors and send commands over UART, or use a switch IC (I’ve never worked with them but I’ve got colleagues who swear by them).

Take a look at the Adafruit tutorial to get an idea how you’d go about this one:

-James

3 Likes

The trigger inputs are GPIO pins wired for active low operation. That means that they are at a high logic level by default, and operate when pulled to a low logic level. The switch does this by connecting the pin to GND. Any device that can create a low logic level signal can be connected to a trigger. The Audio FX Remote Conrol example shows how to use a device that operates with an active high logic level by using a logic inverter.

This is an example of a sensor that operates with an active low logic signal:

4 Likes

Hi James!
Thank you for your response and that helpful link.
I read through it and went on a 30 min adventure learning what GPIO and UARTs were.

Just to clarify, when you say I can control my speakers by UART.
Do you mean I need to have my Arduino connected to my computer at all times? And I need to type my commands into the serial monitor to control the speakers?

I was hoping to not have it connected to my computer, as I wanted my robot to sing on its own.

3 Likes

No, you don’t need to have your computer connected to your Arduino, UART (Universal asynchronous receiver-transmitter) simply infers the serial connection between the Arduino and the FX Sound Board uses this protocol for communication (it’s not really a protocol and more of a description of the standards of operation of a particular device over serial, but that’s the simplest way to describe it in this case)

So you can write code on your Uno to send serial either at certain times, when certain conditions are met, or both in Arduscript (Basically C :sweat_smile:) and control the breakout that way. As Jeff suggested, you can use a PIR sensor such as the one he linked as a potential input for your Arduino which you can then detect with a digitalRead() appropriately.

2 Likes

Hi Teena,

You’re absolutely not locked into sending commands over a terminal! That’s just the easiest way to see how your Arduino and FX board can interact (hence why it’s used in the tutorial).

You’d use Serial.println("your command to your fx board") or similar to make it do your Arduino’s bidding using it’s TX and RX pins

Good luck!
-James

2 Likes

Thank you Jeff!

That was an awesome article you sent, I read through it all.

I had 2 q’s:

  • Should I use the remote method or the UART method mentioned (mentioned by james in this thread)
  • How can I find the code to put in my Arduino IDE, so I can use my remote to control the speakers?
1 Like

Thank you James!

Do you by any chance have the TX and RX pin code?

As I’ve never worked with TX and RX before, and am not sure how to use Serial.prinln to communicate with these pins.

Also, thank you for explaining the workings behind the logic levels.

I’ve never heard of logic levels before, so you fleshing it out made it easier for a newbie like me to digest.

Thank you Bryce! :smiley:

I hope I’m understanding what you’re saying.

But just to clarify: I can use that motion sensor as a trigger for the Adafruit soundboard?

What code would you recommend I follow, to connect the motion sensor with the soundboard? Because I believe the ones Adafruit provide are assuming you’re using pushbuttons as triggers.

Hey again Jeff,

Sorry about the wall of text. I keep thinking of things to write to you.

But just to clarify your post - you’re saying I can using that motion sensor to trigger the Adafruit soundboard?

Also, would you recommend using a remote control or a motion sensor to build a singing robot? :robot:

1 Like

Hi Teena,

You’re a bit spoiled for choice with options here. I believe Jeff’s final suggestion was the most basic way to trigger the board. You connect the alarm pin of the Digital Infrared Motion Sensor to the trigger input, when the motion sensor detects motion it will drag the logic level of the trigger input low.
This is exactly what a push-button switch does (for active low systems).

1 Like

The two are not exclusive. Remote control can be a simple on/off command, like a garage door opener. It can have more more than one on/off button, like a TV remote control. Control through the UART could be by wireless and involves any sort of command you can think of, providing the receiving device is configured to understand that command.

But a simple on/off switch, a switch panel, or a UART device could be directly wired into the receiving device, avoiding any need for a remote communication such as infrared or wireless.

That is a whole nother topic… Generally, you would use what someone has already done for something similar, and modify it for your particular setup, so it will involve a certain amount of programming knowledge. There is unlikely to be an off-the-shelf solution, although with the volume of material available you would probably find something pretty close.

3 Likes

Thank you for all your help Jeff! :smiley:

I’ve learned a lot today from you and the community

2 Likes

Haha yes, a buffet of choices!

Awesome, I might go with that option - thank you Trent! :smiley:

2 Likes