I'll start saying that I'm almost noob on electronics, so that's why I'm here. I'm looking for a smart way to check the state of an RF relay module remotely. This is the relay module:

RF Module image

The module has its own remote control that opens or closes the relay contacts. My goal is to activate the relay with a RF trasmitter linked to the Raspberry Pi, instead using the remote control. I'm often out of home, so I need to do some tests through the Raspberry and check if it activates or not.

I thought about reading state of a GPIO in some way connected to the relay, but I have no idea how to do it?

  • 2
    \$\begingroup\$ Welcome to electronics.stackexchange: Your description is a bit short of details and it isn't very clear what your precise question is. Can you edit your Q to include a block-level diagram of what you want to achieve? Part numbers and circuit diagrams are likely to be needed by anyone wanting to help you. \$\endgroup\$ – RedGrittyBrick Aug 12 '13 at 10:22
  • \$\begingroup\$ Define "smart way to check the state of an RF relay module remotely." Most common solutions will require running a cable from the relay to the Raspberry Pi. If you want a wireless solution, it will be a lot more complicated. \$\endgroup\$ – Passerby Aug 12 '13 at 20:04
  • \$\begingroup\$ Maybe describing the whole project is more clear: The RF Relay module will be connected to a heating thermostat, to switch on and off the heating boiler. The relay is activated with a remote control (that comes with the module). All this already works. My goal is to replace the "job" of the remote control with a RF transmitter managed by the pi. I know I have to sniff the remote control RF code and I already have sample projects to follow. My question is to find a way to check relay state while I'm out of home, during my attempts to send the correct RF code with the transmitter and the pi \$\endgroup\$ – merfe Aug 13 '13 at 7:44

If all you require is to test if the relay is closed then simply monitor the voltage across the load. An opto isolator (any common type such as a 4n25 would do) would be useful to separate the Pi from the receiver/relay circuit.

The output from the collector will be normally HIGH. When the relay is activated this will become LOW. R2 limits the diode current to just over a mA.

enter image description here

| improve this answer | |
  • \$\begingroup\$ This does beg the question, if you can connect a wire from the relay to the Pi, why go to the trouble of the RF interface when you could just trigger the relay from the GPIO of the Pi (or use a Pi IO board), that would also remove the need to monitor the relay state as it would be linked to the state of the GPIO pin. \$\endgroup\$ – John U Aug 12 '13 at 15:28
  • \$\begingroup\$ @JohnU This connection (according to the question) is for testing purposes only to ensure that the relay is actually being controlled remotely by the Pi using its own RF transmitter. \$\endgroup\$ – JIm Dearden Aug 12 '13 at 16:16
  • \$\begingroup\$ @JohnU because they already have the wireless relay and don't want to spend more on another one? Ask a simple q... \$\endgroup\$ – Passerby Aug 12 '13 at 20:00
  • \$\begingroup\$ @JImDearden - the temporary nature of the test connection was ambiguous in the OP, it seemed to me like it was "to ensure the RF link has worked" in an ongoing fashion, rather than a one-off (which is kinda pointless IMHO, for a few tests you can just observe the relay clicking on the bench or connect a meter) \$\endgroup\$ – John U Aug 13 '13 at 10:16
  • \$\begingroup\$ @Passerby - ...but relays are not exactly difficult or expensive to come across, and a regular one wired directly to the pi would be a much simpler and more reliable prospect. Hell, I'd unsolder the relay from the RF module at a push, or just jumper to one of the module's IO pins. Simplify and add lightness! \$\endgroup\$ – John U Aug 13 '13 at 10:17

Instead of hooking up a load, connect the common contact to a 1K resistor to the raspberry pi's 3.3v pin on the gpio header, and also to a gpio input pin. Connect the normally open or normally closed pin (whichever you plan to use) to it's ground.

You can then read the connection state from a /sys node in accordance with the raspberry pi gpio docs.

Remember to disconnect this test circuit before connecting your real load and it's supply!

Additionally, that is not an "RF relay" which is a special device for switching Radio Frequency energy. Rather it appears to be a fairly ordinary pair of small relays which apparently have been connected to an RF remote control.

| improve this answer | |
  • \$\begingroup\$ The module switches the relay only if connected to 12V .. do you mean this for "real load"? Don't want to overload the pi.. \$\endgroup\$ – merfe Aug 12 '13 at 12:49
  • \$\begingroup\$ The power supply for the on-board electronics (relay coils and their drivers) should not be forced to have any connection to the relay contacts, however we can't be sure if that is the case for your particular board. \$\endgroup\$ – Chris Stratton Aug 12 '13 at 15:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.