Hi everyone,
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