Hello, newbie with a question here, please bear with me
Here's what I want to do...
I want to build a custom light switch unit whereby when the light switch is flicked, the light comes on but a specific sound is also played through an included speaker ... and, if feasible, to play a different sound when the switch is turned off.
Can I do this with the materials available on this site?
How might I do this (simple?) thing?
What kind of internal space do I need to make for this within my light switch unit so that all the parts are hidden away (without the box looking huge and bulky)? With the exception of the speaker -- I want it to be quite audible HD quality.
Technical descriptions are better than flowery crap. Switches aren't "flicked". They are on or off.
The Arduino can tell which state the switch is in. The Arduino can make sounds - single tones - as needed. It can not play songs, multiple notes, etc. It CAN direct other hardware, such as wav shields or mp3 shields, to do THAT.
Can I do this with the materials available on this site?
If the light is of the correct voltage and current, yes. Otherwise, you'll need other hardware.
How might I do this (simple?) thing?
One step at a time, starting with much better requirements. "but a specific sound is also played through an included speaker" is a wish. "The Arduino should play a 3839 Hz tone, for 12 seconds, using pin 8, to which an op-amp driving an 8 ohm speaker is attached" is a requirement.
What kind of internal space do I need to make for this within my light switch unit
The amount of space needed depends on what additional hardware you need. Your requirements are nowhere good enough for us to answer this.
Part of bearing with me on my questions/comments is to perhaps translate what I'm saying into the technical jargon in which you wish to discuss this. I understand the words are very important, but I lack the experience to know which ones to specifically use
So, about the "switch" -- I want to wire this unit such that it will be triggered simultaneously with turning on the light switch on the wall, where the act of 'flicking the switch' on the wall would also tell my unit to do something.
That something would be to play an mp3 file (or HD wav file I guess) --- Or, based on your response, direct something else to play the sound.
Does anyone have experience with this? Perhaps direct me with, "you could use [this part], connect it to [this arduino unit] at [this location], in order for the arduino unit to play an mp3 sound, oh, and [this speaker] can be attached [here].
I have no idea about amps and ohms ... I just want the speaker to be generically loud enough to be heard all through the room when it is triggered.
Is there anyone who can fill in the blanks for me, perhaps using what they would think would work in a normal household set-up?
Before we go any further you need to tell us if there are mains voltages involved. I suspect there are. And because of your lack of experience I think you should get a qualified professional electrician to do the job safely.
I am certainly not prepared to give advice that might be misinterpreted and result in death or injury.
I have done plenty of electrical work in my days as a homeowner-- and surviving to tell the story
This includes wiring whole circuits-worth of various appliances, fixtures, and outlets right from the breaker.
I think there's a disconnect between that kind of wiring and the 'circuit-board' kind of wiring, but again maybe not.
So, to answer your question (I think), I'm certain that whatever-I'm-using would be experiencing the same kind of voltage that all the other outlets and fixtures would that are on the same circuit in my breaker box. Does that make sense?
but I lack the experience to know which ones to specifically use
It isn't difficult to say "turn the switch on" or "turn the switch off" instead of "flick the switch". If you make SOME attempt to stick to standard terminology, we'll cut you some slack if you make a mistake.
I have done plenty of electrical work in my days as a homeowner-- and surviving to tell the story
Still haven't answered the question. What voltage are we talking about? You can NOT input 120 VAC to the Arduino without enclosing it in a ziploc baggy so you don't lose the magic smoke. The Arduino can not turn a 120 VAC device on or off without external hardware.
I think there's a disconnect between that kind of wiring and the 'circuit-board' kind of wiring, but again maybe not.
On your part. Not on ours. We KNOW that you need additional hardware if you are dealing with other than low amperage 5VDC devices. You don't seem to understand that.
Now, you may be perfectly capable of adding relays and other devices to your existing high voltage, high current wiring, but it sure seems like you don't understand that the Arduino can not deal with high voltage alternating current.
Adding relays and other stuff, so you can turn the lights on or off, in the same box as the existing switch is NOT going to happen, unless you have very large boxes.
In addition to what @PaulS has said there is the risk of danger to people if the Arduino code malfunctions - which is very likely.
It is one thing to make something that only you use. It is another thing entirely when there are multiple users. "It is not possible to make something foolproof because fools are so clever"
I don't know how many times I have made something that worked fine for me and the first time a competent friend tried it he sought to do some perfectly sensible thing with it that I had never considered - and it failed.
PaulS:
It isn't difficult to say "turn the switch on" or "turn the switch off" instead of "flick the switch". If you make SOME attempt to stick to standard terminology, we'll cut you some slack if you make a mistake.
I would definitely appreciate some slack. I did say I was a newbie. I might as well clarify that here by further adding that it means I don't know the 'standard terminology'
What voltage are we talking about? You can NOT input 120 VAC to the Arduino without enclosing it in a ziploc baggy so you don't lose the magic smoke. The Arduino can not turn a 120 VAC device on or off without external hardware.
Again... did not know that. Didn't even realize that that was common knowledge. My apologies. However, it would be helpful to already move past that and perhaps assist me with what 'external hardware' would work for my concept when added to the arduino.
We KNOW that you need additional hardware if you are dealing with other than low amperage 5VDC devices. You don't seem to understand that.
Can we move the discussion in that direction then..?
Adding relays and other stuff, so you can turn the lights on or off, in the same box as the existing switch is NOT going to happen, unless you have very large boxes.
...Which is fine. This is information that is helpful. I have the ability to create my own boxes, and encase however much of it inside or outside of the wall.
So then, does anyone have ideas as to how to achieve my goals using arduino technology (and associated external bits of any type that I might need)? Oh, and one final note -- this is definitely something that only I am going to be using. Not for public consumption nor distribution.
If I had to do it, I'd replace the wall switch with a DC switch that a controller reads while controlling the lights through a relay. An opto-isolated 10A relay that a pin can switch directly costs less than $2.
With the right kind of lights I'd throw a dimmer in too.
Hey Sal, try out the Tone example project. With some work you can make better sounds the same basic way.
Salamano:
However, it would be helpful to already move past that and perhaps assist me with what 'external hardware' would work for my concept when added to the arduino.
Without you answering questions posed above (specifically: is it a mains voltage switch?) you won't be able to get any good advice.
It's a good idea to keep mains well separated from the Arduino. A common way of detecting whether power is on is by using a 5V adapter, like an old mobile phone charger. Then the Arduino can simply detect whether there's a voltage there or not. Having it trigger an MP3 board is easy.
If all you want to do is "play a sound when the light is switched on" (another ambiguity of yours, as you prefer "flicking the switch" which can go both ways: do you want to play a sound when the light is switched on, switched off, or at both occasions?) you may not even need an Arduino. Connect an MP3 player with the desired sound to the phone charger and have it play a sound the moment it's powered up, and you have your sound upon switching on the light.
For specific hardware and lots of info on how to use it including libraries and example software, visit the web sites of adafruit and sparfun.