Author Options:

Using relays to control lighting? Answered

I have one Banner QS18VN6LV Retro-Reflective light interruption sensor, and one Banner QS18VN6D sensor with NPN Relay outputs. How could use the set to say, power on lighting when one is interrupted and power them off when another is interrupted? What I want to do is use them in my home theater, to power on the room lighting, projector and audio equipment and lower the screen when the one at the top of the steps is interrupted, and power off the room lighting, and turn on my ambient LED lighting when the one at the bottom is interrupted. The only problem this may have, is that the retro one is always sensing something till interrupted, and the non-retro one is only sensing something when interrupted.


This is a job for either some simple logic, or a couple of relays. Probably I'd use little relays.

What current do you need to switch for the lights ?

The main lights are fluorescents, needing to switch less than 15 amps at 120 volts, the led's are around .5 amps at 120 volts, the projector is simply sending an ir signal, essentially pressing a button on a remote, and the same thing for the audio system. I'd use a hacked universal remote for those.

Relays: definitely simplest and most robust method. You also need some kind of latching, so that when the top step is crossed, everything STAYS happening, until someone crosses BACK to turn it all off ?

The sensors actually function as solid state relays, that are on the negative lead of the power. I'd attach some more powerful relays. What I need is some sort of latching for the lighting. Basically I want the lights switched on when the first one is crossed, and turned off when the second one is crossed. A servo could be used to simply switch on the lighting when crossed and switch off when crossed. But I would also need the reverse so the lights turn on when going up the stairs. I also need the system to hit a power button for a sound system and a projector. The sound system relay being the top one only and the projector being both, as the projector requires a dual button press to power off, but the double press wont affect it at the start

Maybe I'd use an Arduino, inputs from the photo units, and then you can do what you like with the outputs and a relay card shield.

You could do it with relays, but the momentary action thing would be tricky.

The SIMPLEST method would use a small Millennium III PLC, a rugged unit with the interfaces you need. By the time you've messed around buying Arduinos etc, the PLC option would be running.


For the projector and sound system I could use a DPST NO relay so interruption presses the power button when interrupted. But I still need a latching system for the lighting...

Don't mess around finding "DPST" relays, DPCO are MUCH more common, its not like you're switching a lot of current.

I found a schematic that uses two SPST relays and makes a latching relay system, So I'm going to design 2 of those

Try this. Its very important not to forget the diodes.


Should there be a link in your comment? or are you saying this for mine? and where would the diodes go?

Yes, but I can't post images from here for some weird reason. I'll have to do it from home later.

Aha, fitting away time in the office :)

And that's supposed to toggle on and off when you "press the button" ?


Answer 5 years ago

Theres a bathroom in my basement which is where my theater is haha

Just checking you've thought about it. And there's a Kitchen too, so you will never pass the sensors during a show ???

I was also thinking of having a "disable" switch for when we're playing things like air hockey or foosball or cleaning, that leaves the room lighting on.

This is how the bypass switch would work

Latching relays.png

No kitchen, but a fridge, microwave and snacks


Answer 5 years ago

I can use one opto to cut power and one to act as the switch

Use a DPDT relay and you only need one relay. You HAVE to put a diode across the coil, or you will damage the opto units.

Cathode to +12/ one end of the coil, anode to the other end of the coil, assuming you tie the relays to +12, basically BACKWARDS to the direction of flowing current in the coil.

That's where the diode should be. It would be good practice to fit one to all the relays, and keep the wires short.

What happens when someone goes to the bathroom, mid-show in your home theatre, all the lights are to go on, the projector powered off and the amps shut down ?

Yes, it keeps supplying the coils with 12V after the switch is released

Sorry, my mistake. I took a wrong turn in the diagram.

I thought you wanted one opto to turn it on, and one to turn it off ?

I still think you'd be better with this

The button turns it on, loss of power turns it off

The sensors actually output a relay signal, they're NPN so they sink the source, but they switch between NO and NC so they can both be used as the same sensor, to sense interrupts

Also, for the system, id like to have it power off the audio system and projector also. The projector requires a double button press, so possibly both sensors could trigger that remote so it shuts down upon leaving.