niner wrote:
Question 2 : How can I use AC to give the arduino high/low input? When main switch is on high, when off low? Like the sensors we use with DC?
Thanks
DON'T DO THAT
Please understand the difference between using and Arduino to control a 5V relay used as a switch for the mains AC (the two circuits are isolated, you may figure the Arduino pressing a button) and feeding 220V AC into the Arduino. You don't need to apologize for your English but you need to understand what we are telling you.
rockwallaby wrote:
If you are going to be playing around with AC as you mentioned, and if that is mains voltage AC, then you better get very clear about what you are wanting to achieve and how you will do this. Understand the risks involved with mains voltage or do not even attempt this if you have no skills or understanding.
Question 2 : How can I use AC to give the arduino high/low input? When main switch is on high, when off low? Like the sensors we use with DC?
As previously pointed out, you can't just connect it. However, I don't think that's what you meant. You probably want to know how to sample to see if mains voltage is available somewhere (like after a switch). Here's a pretty good way to do it, and it can be done pretty safely this way:
draythomp:
OK, a relay can switch AC (mains) current as well as DC. You will need to consider the current and voltage ratings of the relay contacts you want to use as well as the current draw of the relay coil. Some of those little relay boards for the arduino pull a lot of power when you have two or three of them activated and it can suck down your power supply. Most of the relays will run the lights and the fan. Ceiling fans use less than 100 watts and CFL lights or fluorescent tubes are less than that also, so a relay that has contacts that can handle a couple of amps will do fine.
draythomp:
The problem that is difficult to overcome is having your wall switch work as well as the arduino. For example, you can turn the lights on from the switch, then turn them off from the remote control. But then, when you want to turn them on from the switch again, it won't work. This takes special wiring considerations. This kind of thing is exactly like the lights in a hallway with a switch at each end; there are things you have to do special to make it work.
That is exactly why I want to see if the switch is on or not. I can override it by turning the switch off and then on, this would tell the arduino to switch the relay on.
draythomp:
Ceiling fans are the same basic way. If your control of the fan means you want to vary the speed as well, there are special things you have to do. If you have a remote control for the fan, you can leverage the remote such that the arduino can do things with it.
I don't have a remote control for the fan. It is an old electric regulator, but I am not sure so I'll leave that for the moment.
spatula:
niner wrote:
Question 2 : How can I use AC to give the arduino high/low input? When main switch is on high, when off low? Like the sensors we use with DC?
Thanks
DON'T DO THAT
Please understand the difference between using and Arduino to control a 5V relay used as a switch for the mains AC (the two circuits are isolated, you may figure the Arduino pressing a button) and feeding 220V AC into the Arduino. You don't need to apologize for your English but you need to understand what we are telling you.
rockwallaby wrote:
If you are going to be playing around with AC as you mentioned, and if that is mains voltage AC, then you better get very clear about what you are wanting to achieve and how you will do this. Understand the risks involved with mains voltage or do not even attempt this if you have no skills or understanding.
I was not apologizing for my English I was apologizing for not being clear.
draythomp:
Question 2 : How can I use AC to give the arduino high/low input? When main switch is on high, when off low? Like the sensors we use with DC?
As previously pointed out, you can't just connect it. However, I don't think that's what you meant. You probably want to know how to sample to see if mains voltage is available somewhere (like after a switch). Here's a pretty good way to do it, and it can be done pretty safely this way:
Another way is socket/plug with IR remote control.You can decode IR signals from remote control and send it from arduino with an IR led.More easy and safe way no relays,no cables....AC 220 Volt is danger!!!If you think is difficult decode IR signals connect directly remote control with arduino.First the safe and your life and after your project.Inside arduino sketch you can put extra code for TV,Hi-fi,A/C and with bluetooth shield you can make all in one remote control for all your devices from android smartphone!No wires,no cables.
User ----> Android+Bluetooth------->Bluetooth shield+Arduino+IR led----->Send IR signals devices ( small local home automation )
antkan:
Another way is socket/plug with IR remote control.You can decode IR signals from remote control and send it from arduino with an IR led.More easy and safe way no relays,no cables....AC 220 Volt is danger!!!If you think is difficult decode IR signals connect directly remote control with arduino.First the safe and your life and after your project.Inside arduino sketch you can put extra code for TV,Hi-fi,A/C and with bluetooth shield you can make all in one remote control all your devices from android smartphone!No wires,no cables.
OR gate mean if a=on and b=off the device is on
if a=off and b=on the device is on
if a=off and b=off the device is off
if a=on and b=on the device is on
a,b is your switches parallels...remote and not remote...
OK, let me try if I can get some understanding here on what you are wanting to do.
Firstly, ask yourself, do you really need to use an Arduino to turn a lamp or fan on?
Is there some fancy reason you need to use a computer to light a lamp?
If you are very sure that there is, then I will talk about the lamp for the example, and would like for you to read and accurately confirm each question.
To confirm, you have a lamp which is existing and is wired in as a normal house lamp on mains AC system, with switch on the wall?
You wish to control this lamp by two means, one is using the existing wall switch, and secondly, by an output from the Arduino?
The control is to be independent, whether from the wall switch or the control output of the Arduino?
To make the necessary changes to the existing wiring, you will most likely need to have access to the wiring at either the switch or the lamp, can you?
Next question is, at the existing wall switch, is there both the un-switched active and the neutral mains wires available?
If not, is it available at the location of the lamp?
If the answer is no to both of these questions, then I believe you will have difficulty doing this at all, and you would be advised to look into some form of smart switch possibly with inbuilt remote control circuitry that you can have the Arduino link into. (This would be my preference anyhow).
If you do have un-switched mains available then the next question,
7. Again, to make necessary changes to allow the additional control of the lamp you may need to install a small box with a certain amount of electronic circuitry in the wiring circuit between the switch and the lamp, possibly in the wall near the switch or near the lamp, is this possible, is there room enough to do this?
Only if you can meet the requirements of the above questions and not only for the lamp, but the fan you mention as well, only then is it feasible to discuss some methods on how to do this.
antkan wrote:
Why loose? Work as OR gate you do not loose the remote function....
'Antkan', you misunderstand niner, he does not mean loose the function of the remote, he means what happens if he misplaces the remote control unit, or the dog eats it. 'Antkan', I know you are keen and excited, especially with your own projects and you are trying in your own way to help, but I notice you are just adding more confusion to the topic.
Maybe, I wasn't clear. The link you show WILL work. Well, if the board actually works as advertised, it will
Yes! This is exactly what I meant. Is there another way to achieve this? Maybe with relays?
Actually there is. You disconnect the lamp from the switch, use a relay to control the lamp instead. Then, you control the relay with the switch using DC. It's easy to tell if the DC is there for the relay by sampling it. Actually, there's a special kin of relay called a latching relay. If you were to control the light with a latching relay, a pulse from the switch, or a pulse from the arduino could cause it to activate. You might have to switch the kind of wall switch you have though. Lady Ada did a demonstration of this kind of thing in a video at:
She uses XBees, but an arduino will work. Think a bit about how you might install something like this though. Hiding the circuitry could be a annoying.
When i say parallels two switches i mean connect parallels to hot line both switches.Maybe remote control socket ac have manual switch....
A good link for switches AC is Switch - New World Encyclopedia
I create a full universal remote control application to control all your IR signal devices (TV,HI-Fi,BLU-RAY,A/C,Remote Lights,...) from android with this https://play.google.com/store/apps/details?id=power.remote.control for small home room automation.Android send bluetooth signal to arduino with bluetooth shield and arduino with IR led send IR signals to IR devices inside your room.You must decode IR signals from your device.For example i had decode my A/C Toyotomi and create a library IR pulses Toyotomi.Also you can control and arduino with connected relays or you can add remote control sockets or Xbee with relays and control lights,coffee maker,....robots,rc car,ip camera....This is my simple sketch for receive the bluetooth signals...SUPER IR ANDROID APPLICATIONS - ARDUINO PROJECTS
Thanks.