Pages: [1]   Go Down
Author Topic: Controlling Lights  (Read 1877 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am new to Arduino and looking for some guidance in regards to doing some automation with the lights in my house. I would like to modify an existing light switch (on 120 VAC) so that I can control in remotely, but I also want the non technical people in my house to use the switch as normal. I don't necessarily want to go wireless for the controls, instead I want the light to report back to a central server (possibly via ethernet) to report it's status.

My thought is to use a three way light switch with a relay on each leg of the circuit and then use a script to control which relay to control based on the position of the physical switch. My dilemma is that I am unsure of the best way for the switch to report back it's position to the Arduino so the script will run properly.

Of course I may be heading down the wrong path entirely and there may be a much easier way.

For example, if the physical switch is in the on position and the light is on, I want to be able to turn it off remotely or with the physical switch and vice versa.

Any help that you can give me would be appreciated. I've always felt that the best way to learn something is to dive in and work with it and from what I've seen, this is the place to come for questions.
Logged

BCC AZ USA
Offline Offline
God Member
*****
Karma: 21
Posts: 930
It gets hot so it must be working
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Put a light sensor (light dependent resistor, Photo transistor) in the switchbox to sense the light is on or off (or the room is lighted by sunlight).
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Put a light sensor (light dependent resistor, Photo transistor) in the switchbox to sense the light is on or off (or the room is lighted by sunlight).

This could work for me, but what I am really trying to figure out is which side of the outlet is getting power for my sketch to work. Also, I only want to know if the light fixture is on or off so I don't want a false positive from sunlight.
Logged

0
Offline Offline
Tesla Member
***
Karma: 114
Posts: 8924
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
This could work for me, but what I am really trying to figure out is which side of the outlet is getting power for my sketch to work. Also, I only want to know if the light fixture is on or off so I don't want a false positive from sunlight.

A book on DIY home wiring might be useful. An ac relay in parallel with the light could determine if power is being supplied to the light fixture. You might do some reading on the below forum for lighting control ideas.

http://board.homeseer.com/
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

New River, Arizona
Offline Offline
God Member
*****
Karma: 16
Posts: 906
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Frankly, it's a pain in the butt to tell if the light is on.  If you just want to know if there is power there, you can sample the voltage at the wire going to the light, if you want to actually know it's on, you have to sample current at the same point, because the bulb could have quit.  The problem there is the range of current.  A CFL draws a tiny amount and an incandescent draws a lot, so you have to allow for this.

One method is to give up on the three way switching and just wire the light on all the time through the switch boxes, then put a controller at the light itself that is controlled by the switches which you have hooked to little radio transmitters.  I hate this idea because you have to take everything apart and change it to something else.

There are commercial solutions to this out there in the Zwave realm, but they'll cost you a bunch of money and they seem to have problems being set up. 

But, you can use a hall sensor to sense current through a wire by just setting it on top of the wire; this will sense current.  A lot of experimenting will be needed to find the right device and then code for it.  There are also current sensors out there, but they need a special circuit board set up to hook into the circuitry.  Voltage is a pain in that you have to use an opto-isolator to keep from blowing things up and it can get tricky running one off mains power.

Then there's powering the little devices you come up with.  You need DC for the processor and other devices and wall warts won't work because you don't have outlets next to light switches.  It would look silly anyway to do it like that. 

This is the kind of problems I keep running into trying to come up with something to do what you describe.
Logged

Trying to keep my house under control http://www.desert-home.com/

Sydney, Australia
Offline Offline
Sr. Member
****
Karma: 6
Posts: 395
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Put a light sensor (light dependent resistor, Photo transistor) in the switchbox to sense the light is on or off (or the room is lighted by sunlight).

This could work for me, but what I am really trying to figure out is which side of the outlet is getting power for my sketch to work. Also, I only want to know if the light fixture is on or off so I don't want a false positive from sunlight.

Couldn't you put a 2nd switch (space permitting) loose inside the fixture and wire it up as a 2 way switch ? In Australia our 2 way switches (i.e. one switch at the top of the stairs and one at the bottom) have an additional control wire between them - either switch can turn the circuit on or off - regardless of the position of the other switch - you would then put one of the ACS-712 modules on the control wire between them to sense if current was flowing and use a small SSR to make the contacts (or break them.

Craig

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Couldn't you put a 2nd switch (space permitting) loose inside the fixture and wire it up as a 2 way switch ? In Australia our 2 way switches (i.e. one switch at the top of the stairs and one at the bottom) have an additional control wire between them - either switch can turn the circuit on or off - regardless of the position of the other switch - you would then put one of the ACS-712 modules on the control wire between them to sense if current was flowing and use a small SSR to make the contacts (or break them.

Craig



I think this might work. The ACS-715 module is what i was looking for I think. I can add one to one of the carrier wires and depending on if the  module is sensing current, I will know what position the switch is in. Thanks for this!!
« Last Edit: July 01, 2013, 01:26:34 pm by dodonnell » Logged

Napoli
Offline Offline
Sr. Member
****
Karma: 5
Posts: 349
Post fata resurgo
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If your light is controller by your Arduino board, you have yet that information. The tip is simply connect the wall switch to your Arduino (as 3.3V or 5V input) an use it to control a relay that will power on or off your light. Of course, if your board can be accessed via Ethernet or other media, you could even give the ON command from another source.

Have a look to this video, it shows the first release of Souliss framework controlling over Android a couple of lights and an air conditioner. At the top of the buttons there is one feedback indication that is red for OFF and green for ON, while controlling the light it will follow the state coming back from Arduino.

http://youtu.be/VuqOFjQTVYg

This release is pretty slow (the actual one has greater performances) but get the feedback directly from the board, without using nothing special, just an Arduino Ethernet and a couple of relays.

The state of the output pin of your board (its values is in your sketch) is the actual state of the light. This will give you a feedback at actuator level, of course if your light bulb is burned, you will not get any advice. If your Arduino is powered OFF you will not be able to power your light, even from the wall switch.

To have your lights in operation also if your Arduino is powered-off, you can use the following schematic, that needs some external components, in this case a relay with coil at 230V and two 12V coils relays for controlling the light.



With this basically your drive the light through Arduino till the NC relay is open, and with the wall switch when the NC is closed. The wall switch position is reported back with an auxiliary dry contact, that became a 5V input for your Arduino.

This solution is used by the developer of the Android application in the previous video, to have full control also in case of failure of the board.

Regards,
Dario.
Logged

Souliss - Open-source Distributed Home Automation with Arduino and Android

http://www.souliss.net
Follow at @soulissteam

@veseotech

Offline Offline
Edison Member
*
Karma: 20
Posts: 2111
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I learnt something new!!!

Obviously, power the Arduino, and have "soft buttons" 5v > light switch > digital in..... if active high, we have the switch on, if it's low, it's off, problem solved.

 boolean softswitch;
 softswitch = digitalRead(Pin);
if (softswitch == HIGH)
  {
    digitalWrite(pin,HIGH); //switch on light switching on the relay.
  }
}

Ah but what I just learnt .... how to determine if the light is actually *on* never occurred to me to determine if the light is physically working or not without a webcam .... smiley-grin thanks! good tip
Logged

Pages: [1]   Go Up
Jump to: