Headphone / Speaker Motion Sensing Switch

Hi all,
I’m building a “smart home” speaker stand that accepts a 1/8" audio input (ideally from a phone, etc) and depending if a motion sensor is activated or not, it plays the audio signal through the speakers (if sensor is activated) or through headphones (if sensor is not activated)

I mainly need help trying to figure out how to wire up relays and get a wiring schematic.

Thanks in advance!

rbk202:
Hi all,
I'm building a "smart home" speaker stand that accepts a 1/8" audio input (ideally from a phone, etc) and depending if a motion sensor is activated or not, it plays the audio signal through the speakers (if sensor is activated) or through headphones (if sensor is not activated)

I mainly need help trying to figure out how to wire up relays and get a wiring schematic.

Thanks in advance!

Do you have the Arduino and motion sensor working?

Paul

What do you need help with?

Typically, you'll work on the input (motion sensor) and output (relay) separately...

So for example get the motion sensor working to turn-on an LED. If you use the Arduino's built-in pin-13 LED you won't have to wire one up.

Then, you can wire the (DPDT*) relay to the speakers/headphones and test relay with a direct power connection to the relay coil (no Arduino needed).

Then wire the relay to the Arduino** and test it with the Blink Example sketch (no input required).

Then put everything together with software that reads the motion sensor and activates the relay.

  • A double throw switch (or relay) is a 3-terminal switch. It can be wired with one input (the audio signal) that can switch between two outputs (speakers or headphones). A double-pole, double-throw switch (or relay) is two of these (so you can switch stereo signals).

And a relay is an electrically-operated, and electrically-isolated switch.

** You can't directly drive a relay coil with the Arduino. You'll need a driver circuit, or you can get a relay board with a built-in driver.