3

I got this relay to make an IoT lamp but I can't decipher the labelling on it. There is no labelled GND, VCC, or JD-VDD just 'L' and 'H'. I wired 'IN' to an I/O pin, GND to GND, and the jumpered pin to the right to 5V (assuming it was VCC) and running the script still did not activate the relay.

Am I missing something? This relay looks a little different than the ones in other tutorials..

enter image description here

tlfong01
  • 2,766
  • 1
  • 9
  • 17
patriciajlim
  • 31
  • 1
  • 2
  • 3
    It's generally recommended not to by such devices which do not come with full documentation and a schematic, and without the question is technically off-topic here. Set the pi aside for a moment, supply 5v across the DC+ and DC- and try connecting the "in" to one or other while playing with the jumper and see if you can get it to click. Involving the pi would be a complication to consider only once you get that far. – Chris Stratton Jun 24 '20 at 04:29
  • 1
    The jumper you connected to 5V is defining whether your relais is normally open or normally closed, the 5V have to go into the DC+ connector, GND into DC- and your IO goes to IN. But as Chris mentioned, start without the Pi – po.pe Jun 24 '20 at 06:03
  • Two quick comments: (1) You don't usually find the JDVcc jumper on relay boards. There are less than 10% of relay boards have such a jumper, (2) Your relay board has the High/Low logic level select jumper. There are less than 10% of relay boards with such a H/L jumper. When you set jumper to L, the relay becomes Low level triggered, and similarly, H for High level triggered. – tlfong01 Jun 26 '20 at 01:45
  • You might find my following post on High/Low trigger selectable relay useful: (1) "High/Low Trigger Selectable Relay Module - rpi.org.forum 2018jun13": https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=77158&start=50#p1327656. Please feel free to ask me any following up questions. Cheers. – tlfong01 Jun 26 '20 at 02:17
  • 1
    One warning to Rpi newbies using H/L select relay: (1) High trigger mode works OK with Rpi, (2) ***Low trigger mode does NOT work for Rpi***, because though Rpi's Low can turn on relay, but its 3V High is not high enough to turn off the relay (which requires 3.5V+ to turn off. – tlfong01 Jun 26 '20 at 02:22
  • Usually those US$1 cheapie relays from Amazon, AliExpress, and eBay do not come with any user manual, not to mention a schematic. If you prefer relay with good documentation, you might consider industrial/professional grade relays, but they are usually ten times more expensive. You might like find Appendix A of my answer to the following Q&A useful: (2) "Newbie Relay Selection Guide - rpi.stackExchange 2019jun26": https://raspberrypi.stackexchange.com/questions/99988/rpi-gpio-controlling-5v-relay-problem. Cheers. – tlfong01 Jun 26 '20 at 02:44
  • 1
    @tlfong01 If H/L denote high and low trigger, exactly which pin is GND? – patriciajlim Jun 26 '20 at 16:49
  • @patriciajlim, Ah, a very short but slightly misleading answer is this: (1) DC- is ground. A slightly longer is this. (2) The wiring should go like this: (a) DC+ connected to +5V (preferably not the Rpi's 5V rail, but an external power source which should provide at least 100mA to turn on the Songle relay switch, (b) DC- connected to the Ground of the +5V source, (c) IN connected to a Rpi GPIO pin in output mode, (d) Newbies must alwasy remember - connected the Ground of the power in (a) to Rpi's [logic/signal] ground, to make a ***"Common Ground"***. – tlfong01 Jun 27 '20 at 00:55
  • @patriciajlim, you asked why there is no JD-Vcc jumper but the H/L jumper instead. As I pointed out in my first quick comment, relay with JD-Vcc jumper is another a bit unusual relay and as tricky to handle as the H/L jumper relay. For clarification, comparison and contrast, you might like to read my following two posts about JD-Vcc relays: (1) "Forbes Low Level Trigger Relay Module with JD-Vcc jumper Basics - rpi.org.forum 2018jul14": https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=77158&start=150#p1340696, / to continue, ... – tlfong01 Jun 27 '20 at 13:56
  • (2) "Forbes Low Level Trigger Relay Module with JD-Vcc jumper Wiring - rpi.org.forum 2018jul14": https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=77158&start=150#p1340703. You might find it interesting that the relay power ground is NOT connected to the Rpi signal ground, for "complete total ground isolation". Cheers. – tlfong01 Jun 27 '20 at 13:56

2 Answers2

1

If the relay is a 5V relay, 5v between the IN pin and GND should energize the coil and switch the relay. If it's not a 5V relay, 5V won't switch it. You'll need to apply the correct coil voltage (most relays coils are 5, 12 or 24V).

When the coil is energized, a normally closed relay will open and a normally open relay will close. I think H and L stand for high and low side, with the intention that the current flowing in the relay flows form the H to the L. This is probably done because it is a DC relay and if the direction of the current is specified, the manufacturer can design the contacts accordingly.

Place an ohmmeter across the H and L pins and see if the resistance changes when you energize/de-energize the coil.

  • 2
    Your answer is of limited relevance, as this is not a bare relay but rather a relay hiding behind an optoisolator. As such it requires both a power supply and an input signal (which would feed the LED in the opto, not the relay coil). However the exact details are lacking.f – Chris Stratton Jun 24 '20 at 21:21
0

Answer

(1) The OP's relay has a H/L jumper to select the relay to be High trigger or Low trigger.

(2) If the H/L jumper is set to "H", then the relay becomes High level trigger. If jumper set to Low, then relay becomes is Low trigger.

(3) If set to High trigger, almost always it will work.

(4) However, If set to Low trigger, AND if you are using 3V3 powered Arduino, or 3V3 powered Raspberry Pi, then there is 50% chance that you can switch relay on by Low signal, but cannot switch off by High signal. This the the "3V3 Rpi/Arduino High signal is not high enough to switch off relay". You might like to read Reference (1) for more details.

high low trig


References

(1) How to properly use a relay module with JD-VCC from Arduino/Raspberry?

Notes

(a) Part D explains High/Low level selectable relay using H/L jumper.

(b) Appendix B explains "High level not high enough to switch off relay problem"


tlfong01
  • 2,766
  • 1
  • 9
  • 17