light automation when away

Hi everyone,

I think I first post in the wrong thread, so I post again in this thread.

I read a lot on the forum and I think I found what I was looking for, but would like to confirm just to be sure I don't burn the house.

When my dsc alarm system is armed, I can set an output to notify my Arduino. What I what to do is to turn lights on and off to simulate a presence. I'll control a lot of lights, so I plan tu use shift register. I draw a diagram for 1 light.

The relay 1 is to check if the light is on or of. I don't want to turn off the light when I want it on! If the coil is energized, the relay will made contact and I'll read it on with the shiftin register cd4021.

The relay 2 is to actually turn the light on or off without interfering with the regular switch (future project is home automation with ethernet shield). Since this relay use 80ma and arduino can output only 40ma, I added a transistor 2n2222. What I'm not sure is the use of the diode and if it is in the right polarity. Thoses relays will be controled by a shift out register 74hc595.

For the whole project, I bought a 5v dc with 5a power supply from ebay. I'll power the arduino and relays with it, so all the ground will be attached together.

Do I need to add something between the relay 1 and the shift in register? I based my diagram on an example with push buttons, not relay that will let the current flow freely for hours. Does this will do a kind of shortcut between 5v and arduino because there will be no load?

Will I wire things correctly if I follow the diagram and are my polarity correct?

Thanks for help and advices

The diagram...

What I what to do is to turn lights on and off to simulate a presence. I'll control a lot of lights, so I plan tu use shift register. I draw a diagram for 1 light.

What will probably kill your project is the wiring needed to control your existing lighting. I suggest you use an x10 setup to control simple lighting that plugs into wall sockets. There have been fairly simple projects posted using the x10 CM17A "firecracker" module.

I read that X10 protocol was:

  1. Not reliable
  2. Can't work with led light (because led light make noise on the line)

I can have access to all switch. Basically, I'll only have to run Cat5 cables for the 5 volts.

I also tought about using X-Bee, but I saw two problems :

  1. Expensive because I have to buy an X-Bee and Arduino for each light (about 50$ minimum)
  2. I need to fit an X-Bee module, Arduino mini, a relay and a 5v power supply in an electrical box that already have wires and light switch,

Therefore, running the cables in the ceiling of my basement is much more easy and cheap. I compute that I can control a light for about 5$.

Is relay 1 supposed to be in parallel with the light so it pulls in when the light is on ?
Looking at what you have now , the 110 vac relay coil is in series with the light fixture which will limit the voltage and current to the device.
BobD

You're right, relay 1 is in parallel and its purpose is to know if light is on.

You're also right that I'll have a voltage drop in theory, but will it be noticable?

Whats is the typical resistance of a relay? If only 105 vac goes to light, it will dimm the light a bit. If I use cfl light bulb, will they light anyway?

As long as you have the relay and light in parallel you will be able to monitor the status. The light bulb will see 110 vac and the relay coil will also see 110 vac . The light produces heat , so it will draw more current than the relay coil which draws very little.
BobD

To be in parallel, I'll need to open the dry wall and put the relay between the switch and light. I want to put the relay before ( in the basement)

If I could access between the switch and light without holes in the dry wall, I would have put a usb charger from ebay in parallel with light and plug the 5v dc output to arduino directly.

Qill the relay in serial make a hudge drop? I don't knom the math, but a light bukb of 50 watts on 110v will pull approximatively 0.5a. If I out a relay with a few ohms in the coil, what will be left in volts and watts to the bulb?

It's the only way I found to check if current gi through tge circuit. Acs712 (or something similar) on ebay don't work on ac.

This is an alternative to a relay . It senses the AC current passing through it , and the output can go to an Arduino making the interface easy.
http://aaa.miniinthebox.com/ac-ta12-100-current-sensor-module-for-arduino-works-with-official-arduino-boards_p824517.html?
(swap out the aaa for www)
Before you go too far in this project you would be wise to enlist a qualified electrician to point out any possible code violations or concerns .The last thing you want to do is build this into your home and have it catch fire .
BobD

I just looked at the sensors you suggested and they look like they will work as well . Just have to make sure all the 110 vac wiring is in a proper metal enclosure with the low and high voltage sides separated. Again , that is where the seasoned electrician would come in handy .
BobD