Go Down

Topic: Controlling an AC outlet and reacting to audio levels (Read 1 time) previous topic - next topic

Blondelefty

Hello, this is my first post here on the arduino forums and am looking forward to enhancing my experience with the arduino I recently purchased. Now onto my question. I apologize since I know this question has probably been answered a million times, but how do I go about toggling an ac outlet on and off with an adruino uno? I have checked these forums to see if I could find an answer to this but I couldn't find anything unfortunately. I've read somewhere that you can use solid state relays (ssr's) somehow but I wanted to consult the more experienced users on here and make sure I get the correct necessities. I only would like to control ~3-5 outlets for now; just to play around with.

Also, while I am asking, I was curious if anybody knew about a way to have the arduino toggle the ac outlets based on sound level coming from a specified source (audio file, audio input, or the computers audio). As I know that the majority of the arduino community is on windows, I think I should note that I am using a Macintosh. I know this is a pretty advanced second question but I wanted to know if anybody already knew before I pursued my own attempt to figure it out. Apologies for any amateur mistakes I have made anywhere and thanks for reading and thank you in advance for your replies. :)

JimboZA

#1
Mar 23, 2013, 12:26 pm Last Edit: Mar 23, 2013, 12:28 pm by JimboZA Reason: 1
A way that has been suggested here on a number of threads, is to use one of these. Unless you have the experience to dabble with the mains side of the relay, it's probably best to go for an off-the-shelf solution.

That said, we're not the house-wiring-police, so yes it's feasible to use an SSR or even a mechanical relay.  This tutorial shows a coil relay and needs a diode across the coil, and a transistor to provide enough current for the relay to trip. Make sure, of course, that your relay is rated for the appropriate AC voltage and current....

E&OE. YMMV....
Roy from ITCrowd: Have you tried turning it off an on again?
I'm on LinkedIn: http://www.linkedin.com/in/jimbrownza

Blondelefty


A way that has been suggested here on a number of threads, is to use one of these. Unless you have the experience to dabble with the mains side of the relay, it's probably best to go for an off-the-shelf solution.

That said, we're not the house-wiring-police, so yes it's feasible to use an SSR or even a mechanical relay.  This tutorial shows a coil relay and needs a diode across the coil, and a transistor to provide enough current for the relay to trip. Make sure, of course, that your relay is rated for the appropriate AC voltage and current....

E&OE. YMMV....


I looked at the power switch tail... It looks nice but the only issue I have with it is that it's $26 to control one outlet. Technically I could use an extension cord to add more to it but I wouldn't be able to control devices individually, which is what I'm looking for. So I suppose I will have to go with an ssr. Any objections?

Runaway Pancake

X10 is a pretty good deal.
There's an X10 Arduino library, too.
"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

zoomkat

The below x10 kit with the FireCracker CM17A and TM751 Transceiver are super simple to use with the arduino.

http://www.ebay.com/itm/X10-POWERHOUSE-WIRELESS-REMOTE-TRANSCEIVER-SYSTEM-HR12A-TM751-CM17A-FIRECRACKER-/271176100820?pt=Home_Automation_Kits&hash=item3f235aebd4
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

michinyon

Do you just want to turn the power on,  and off,   when the sound level changes ?

Or do you want to control the power level in some way (  for example flashing lights or
making them brighter or dimmer ), when the sound level changes ?

These are actually different questions and the best ( and safest, when dealing with mains
power ) answer depends on what you are trying to do.

Blondelefty


Do you just want to turn the power on,  and off,   when the sound level changes ?

Or do you want to control the power level in some way (  for example flashing lights or
making them brighter or dimmer ), when the sound level changes ?

These are actually different questions and the best ( and safest, when dealing with mains
power ) answer depends on what you are trying to do.


I just wanted to turn the power on and off when sound level changes. If I remember correctly, you need special lights that can dim? I'd prefer dimming if its not going to cost me a fortune but other than that just blinking. Thanks

Runaway Pancake

First it was about "toggling", but now it's to work like a VU (signal) meter?
"Toggling" is one matter, but the other is considerably more complicated.
"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

michinyon

Quote
I just wanted to turn the power on and off when sound level changes. If I remember correctly, you need special lights that can dim? I'd prefer dimming if its not going to cost me a fortune but other than that just blinking. Thanks


Well there are plenty of lights that you can dim,  but thats not really the point.

You can use a relay to turn AC on and off.   But that's it.  On or Off,  and not very often because the relay will wear out.

But if you want to vary the "level" of the AC ( whatever that is actually supposed to mean ?? voltage ? current ?  duty cycle ? ) ,  it's not actually that simple  and you need a different sort of electronic device all together - such as a "dimmer".

So you just want to turn the power on and off -  well that is clarified then.   The next question is,  what do you mean by "when the sound level changes" ?   Do you want to turn the power on and off for every "doof" of your doof-doof music ?   Or do you want to turn it on when there is heavy traffic on the nearby freeway,   and off when there isn't ?

If you want this device to operate very often,  you want to avoid a relay,  because they will wear out quickly.  You want to consider some kind of solid state relay,  which usually costs more.



Blondelefty


Quote
I just wanted to turn the power on and off when sound level changes. If I remember correctly, you need special lights that can dim? I'd prefer dimming if its not going to cost me a fortune but other than that just blinking. Thanks


Well there are plenty of lights that you can dim,  but thats not really the point.

You can use a relay to turn AC on and off.   But that's it.  On or Off,  and not very often because the relay will wear out.

But if you want to vary the "level" of the AC ( whatever that is actually supposed to mean ?? voltage ? current ?  duty cycle ? ) ,  it's not actually that simple  and you need a different sort of electronic device all together - such as a "dimmer".

So you just want to turn the power on and off -  well that is clarified then.   The next question is,  what do you mean by "when the sound level changes" ?   Do you want to turn the power on and off for every "doof" of your doof-doof music ?   Or do you want to turn it on when there is heavy traffic on the nearby freeway,   and off when there isn't ?

If you want this device to operate very often,  you want to avoid a relay,  because they will wear out quickly.  You want to consider some kind of solid state relay,  which usually costs more.





For every "doof" is what I was looking for.

Blondelefty


First it was about "toggling", but now it's to work like a VU (signal) meter?
"Toggling" is one matter, but the other is considerably more complicated.


Originally I was asking about toggling and if anyone knew about a Vu meter. Now I am more interested in a Vu meter. Sorry about the indecisiveness :( hope that is cleared now

DVDdoug

Solid state relays are not difficult to wire-up (4 wires), but they are not that cheap either.  This type can handle just about anything you can plug-in, and the screw-terminals make it easy to connect-to.   And it's relatively safe, because you just have to make sure AC goes to the AC terminals, and DC goes to the DC terminals.

This type is a bit cheaper, but this one can only handle 2 Amps and it has to be soldered. 

The least expensive solution would be to build your own solid state relays with  optical isolators especially designed to drive a TRIAC.    This is a bit more risky, since there is more wiring/soldering of the high-voltage circuitry, and more possibility of making an error that could harm you or your Arduino....  The datasheet for the opto-isolator will show you how to wire it to the TRIAC and the AC voltage & AC load.  I'm just starting a project that will have 4 TRIACS & 4 opto-isolators built-into an electrical outlet box (the kind of electrical box that's normally inside your wall).

Quote
Now I am more interested in a Vu meter.
A VU meter with AC lamps???  I suggest you take one step at a time...  Start with LEDs and then add the AC lamps and associated circuitry.  Or, at least program your Arduino to blink an LED with the beat/loudness before messing with the AC stuff.

I'm just finishing-up a "Giant VU Meter Effect" that uses 24 high-brightness LEDs spaced a few inches apart in an 8-foot black plastic pipe.   (To keep things interesting, it randomly does some other blinking/sequencing effects, and the meter can be reverses amd/or invertes, and switches between "bargraph" and "dot" modes.)








Blondelefty


Solid state relays are not difficult to wire-up (4 wires), but they are not that cheap either.  This type can handle just about anything you can plug-in, and the screw-terminals make it easy to connect-to.   And it's relatively safe, because you just have to make sure AC goes to the AC terminals, and DC goes to the DC terminals.

This type is a bit cheaper, but this one can only handle 2 Amps and it has to be soldered. 

The least expensive solution would be to build your own solid state relays with  optical isolators especially designed to drive a TRIAC.    This is a bit more risky, since there is more wiring/soldering of the high-voltage circuitry, and more possibility of making an error that could harm you or your Arduino....  The datasheet for the opto-isolator will show you how to wire it to the TRIAC and the AC voltage & AC load.  I'm just starting a project that will have 4 TRIACS & 4 opto-isolators built-into an electrical outlet box (the kind of electrical box that's normally inside your wall).

Quote
Now I am more interested in a Vu meter.
A VU meter with AC lamps???  I suggest you take one step at a time...  Start with LEDs and then add the AC lamps and associated circuitry.  Or, at least program your Arduino to blink an LED with the beat/loudness before messing with the AC stuff.

I'm just finishing-up a "Giant VU Meter Effect" that uses 24 high-brightness LEDs spaced a few inches apart in an 8-foot black plastic pipe.   (To keep things interesting, it randomly does some other blinking/sequencing effects, and the meter can be reverses amd/or invertes, and switches between "bargraph" and "dot" modes.)










Thanks for the info. I think because of simplicity I am going to go with your first option. Since I've never used an ssr I would like to know how many ac outlets I can actually control with one of these and where I can find info on how to hook the ssr up to my arduino. Sorry for there amateur questions.

Go Up