You are dealing with an old man, from a pre-digital age, so be patient.. I want to trigger a security light to come on when the mains power goes out. I have a relay module. There are a number of pictorial diagrams on the web showing how to connect an Arduino, through a breadboard connection, to a relay module, and I reckon that with a bit of work I could puzzle out how all this works. But it seems to me that the Arduino itself may not be needed at all - tell me if I am wrong: The relay module has 3 pins. I need to provide a voltage between the pins marked VCC and GND, (to power the module itself). If I then provide a voltage to the pin marked IN, it will trigger the relay; if I cut the power to the IN pin, the relay will drop back to its resting state. Can I simply connect my relay module directly to a power supply connected to the mains, (in my case 12 V DC, the rating of my module), and also connect the IN pin to this same 12 V input, (or does the control current need to be something different such as 5 V?). That way, as long as the mains power is working the relay is held active, (in my case, actually "open"), but when the power goes out, the relay drops back to its resting state, (closing the circuit for the battery-powered lights). If all the Arduino is doing is controlling a voltage applied to the IN pin, (HIGH/LOW), I can achieve this same effect simply by feeding power directly from a power supply plugged into the mains. When the power goes out, the power provided to the IN pin drops to the ultimate LOW, ie. zero, and the relay drops out. So I have 2 questions: 1) is my reasoning valid, and I don't need an Arduino at all? and 2) With a relay module rated for 12 V, is the trigger voltage also 12 V? (The relay itself is marked JQC-3FF-S-Z, if that is any help)
sounds like you could get by just using a 12vdc automotive relay. Or if you wanted to get rid of the 12vdc power supply, get a relay that has a coil rated for the mains voltage.
So you do not need the module - just a relay and the corresponding DC power supply.
Yes, if a relay module is to hand, connect "In" to whichever side of the power - Gnd or Vcc - that actuates the relay. For many modules, you need to connect "In" to ground and a few have a link to choose which way it expects the input.
Thank you so much. This was immensely helpful - I would never have thought of needing to ground the trigger, (as opposed to powering it).
And, in response to the, very logical, suggestion to simply use a mains powered relay, this project is buried inside an existing security light unit, in which the original board, (which has additional functions like sensing whether it is daylight and inhibiting the light turning on), is malfunctioning, and I am splicing it into the end of what is a malfunctioning process. The power reaching my light unit is already dropped to 12 V, and if I were to use a mains connection I would need to run a 110V wire back to a plug.
I thank you all so much.