Audio Triggered AC Outlet

2/21/19
I am a newbie to Arduino. I want to build an ac outlet that is triggered on with line level audio that is being fed to my sub woofer speaker. I have a few questions....

  1. Is this project simple enough for a newbie?

  2. Is there a place that can show me what program I need, and what hardware I need, and a video that shows me how to hook all this up?

Thanks for the help, and advice;

Steve

What is wrong with the answers you got here? Audio Triggered Relay - Project Guidance - Arduino Forum

  1. Is this project simple enough for a newbie?

I would say not because it involves mains wiring. If you are asking for a video of how to do it I would say you are not experienced enough to tackle this safely.

This is super simple.
buy a WiFi enabled plug

Create a listening device that can control the WiFi enable plug.

you never touch mains power
you can always touch your low voltage stuff

I've also seen outlets with relays built in, so you can simply connect your 5V signals to control the relays. No need to touch mains voltages.

brianphoenix:
line level audio that is being fed to my sub woofer speaker

This is more interesting. How do you plan to detect this? Microphone in front of that sub woofer?

Line level audio delivered to a speaker doesn't make any sense, unless that audio is supplied to an amplifier that in turn handles the speaker.

I was not real clear in earlier posts of exactly what I am trying to accomplish. Let me explain in full detail.

The End Result: When I turn on my AV receiver I want my sub-woofer to turn on.

How To Accomplish This:

  1. I want to send the sub-woofer line level audio out from my AV receiver (line level because the sub-woofer is amplified) to an Arduino device that is triggered by the sub-woofer line level audio, and when triggered the Arduino device I build outputs 6volts dc.

  2. The 6volts out will trigger a device I have already built. The device has a 6volt relay in it, and when that relay is triggered it sends 120v ac to an ac outlet that has the sub-woofer plugged into it.

  3. There would have to be an audio live level potentiometer on the Arduino device I build in order to set an audio triggering threshold level for the device.

  4. Also there should be a second potentiometer for setting a time delay. This time delay potentiometer would allow the user to adjust time delay for the output of the 6volts dc between 1 second and 30 seconds. What I mean here is this. If it was set to 30 seconds and there was a pause of 29 seconds or less in the audio being sent to this Arduino device the 6volt out would continue to be output. If the delay potentiometer was set to a 3 second delay and the audio was not present for 4 seconds or more the 6volts would no longer be output.

Any questions: Steve at sphoenixfm@gmail.com, or feel free to call and say hi at (207) 229-9178.

Thanks for the Help;

Steve

this device will allow you to only touch low voltage.
this can switch your high voltage.

if you need to either make a device to recive the signal

or make a device to send the signal, please be direct about what you need.

  1. Is this project simple enough for a newbie?

It's a good beginner project if you are comfortable with dangerous voltages.

  1. Is there a place that can show me what program I need, and what hardware I need, and a video that shows me how to hook all this up?

You might find a similar/example project, but not here.

Otherwise, we can give you suggestions & help and bits-and-pieces for you to put together, but you'll have to do it yourself.

HARDWARE -

At the bottom of [u]my post here[/u] there is a schematic for hooking-up a line-level signal.

You can't drive a relay directly from the Arduino, but here is a [u]MOSFET driver circuit[/u] or a [u]transistor driver circuit[/u]. Since you are only driving a relay coil you can use a "small" transistor or MOSFET with a current rating a little higher than your relay coil requires (for some safety margin). And of course, you'll need a 6V power source for your 6V relay.

SOFTWARE -
**Work on the input, output, and timing separately before putting everything together. **

The output is the easiest. You can test your relay circuit with the [u]Blink Example[/u]. Plug-in a light instead of your subwoofer and it should blink along with the LED.

To test the audio input run the [u]Analog Read Serial Example[/u]. (You can take-out the delay since you want to sample the audio signal as fast as possible to "catch" the peaks.) From the readings you get with, and without, a signal, you can choose a threshold to use with an [u]if statement[/u] so you can do one thing when the signal is present and something else if there is no signal.

Probably the trickiest part is the timing. You'll need to understand how [u]millis()[/u] works.... You need to make a timer that "captures" and saves the time whenever the signal is above threshold. And every time you get a new time, you need to "reset" a timer.

Subtract the current time from the saved-time and you know how long it's been since there is no signal. If there is no signal for a period of time and the timer times-out, you turn-off the relay.

To make variable timing, the Analog Read Serial Example shows you how to read a pot and you can use the [u]map()[/u] function to map the ADC reading to a range of milliseconds.

Any questions: Steve at **@gmail.com, or feel free to call and say hi at () -*. It's a BAD IDEA to post your contact information on the World Wide Web. There are "spam bots" that automatically search for email addresses (and phone numbers and credit card numbers, etc.).

Plus, everybody benefits from reading questions & answers here on the public forum.