5v Relay Module Schematic

0 views
Skip to first unread message

Jeremias Resendez

unread,
Aug 3, 2024, 10:54:01 AM8/3/24
to ladeconcums

I also tried 3v instead of 5, and connecting to another Power supply the JD-VCC. Nothing worksI tested with the multimeter and all the pins I connected are getting power, so either I am missing something (very probable) or I both boards are broken

(1) Usually if an external power supply for the relay module, it is important to short the Arduno/Rpi signal ground with the external power ground, so that Rpi signal has the common ground with the external power supply ground.

(2) However, for this "total opto isolation configuration", the Rpi ground should not be shorted to the external power ground, because the Rpi uses the optical coupler independent of any part of the electrical of the relay module. Rpi Vcc sources current through 1k to the LED which inputs optical signal to the opto transistor on the other side. No electrical current ground is used for reference. A case with Rpi powered by a battery, the Rpi's ground can be "floating" and not connected electrically to the relay module.

The OP's 4 channel relay module is "Low Logical Level Triggerable" (Low Trigger) with the "JD-Vcc jumper" to suit different configurations of relay power and control signal levels. One very simple wiring method is shown below.

Using the 3V3 Raspberry Pi (or 3V3 Arduino) as an example, The Songle relay switch power is from external 5V power source, Vcc is connect to Rpi's 3V3 logic power, and IN is connected to an Rpi GPIO pin in output mode.

The simple wiring and operation described in the short answer above does not involve the JD-Vcc jumper which is a very clever electronic circuit design. The long answer below describes the JD-Vcc circuit in detail, starting from the most basic ideas of High and Low trigger relays with and without optical isolation.

The over simplified schematics give a rough idea of the operations of High and Low trigger circuit. Real circuits must have a "flyback diode" to absorb the energy of flyback current when switching off energizing current. An "optical isolator" is usually used to prevent/reduce EMI (ElectroMagnetic Interference) noise going back to the signal source (Raspberry Rpi). Noise usually also goes through the ground wires. That is why the "JD-Vcc jumper" coming in, to do "Total Optical Isolation" (More about his later).

I am only making an educated guess that the OP's relay is low level triggered. There is a small chance that his module is actually High level triggered, as shown below. In this circuit, High signal activates/turns on relay switch.

One important clarification is that whether a module is High or Low triggered, if the Rpi/Arduino is not powered, or if GPIO pin is in input mode in booting or otherwise, then no current drives or sinks to activate optocoupler, relay is always off.

Another confusion is between the "relay switch" and the "relay module". The little blue cube is the relay switch, usually marked "Songle" or other brands like TongLing or WV. The relay module, unfortunately, almost always, has no marking of brands or model number.

It is important to note that the optocoupler input is only of the order of 5mA, but the Songle relay switch activating current is about 70mA. The following pictures can help clarify things a bit.

Before a detailed study of the OP's JD-Vcc jumper relay and how to control it, it is important to differentiate between the JD-Vcc jumper and the H/L level select jumper. The schematic of the H/L select jumper relay is shown below. This relay lets the user select the relay as High level or Low level trigger.

Though the OP's question is on his relay which is Low level trigger, optocoupled, JD-Vcc/Vcc jumper configurable power supplies, we need to know the very basics of the opto coupler (EL817C) biasing of High/Low trigger circuits.

Let us focus on the left most two columns, TTL and Arduino. In those were the days, my Arduino friends thought the imperial Arudino empire would live happily ever after, never imagined that some big guys like Rpi would soon appear. So the story goes than the Arduino engineers devised a new logical level standard/specification:

The result is that most devices, say actuators, including relays, solenoids, buzzers, you name it, meet this spec, with (the latter Rpi guys scary) requirement that to do something using High level, you need to give 4.2V or higher.

However, using the JD-Vcc circuit is not just solving the problem by shifting logic level, but actually killing 4 birds with one stone. To explain how one stone can kill 4 birds, we need look at the 4 birds, bird by bird. The first bird is how to turning off the always on relay by the either one of the following two tricks:

This is a common Rpi/3v3 Arduino Mini Pro newbie's sorrow. Many newbies wrongly buy a Low trigger relay designed for Arduino and found the relay always on. The following a is a short description of a real life sad story. (I am using this very simple Arduino relay to explain the workaround. The JD-Vcc relay described in this question actually can use the same trick.)

Now the newbie' workaround is a brute force way to just cutoff the activating current by changing the GPIO pin from output mode to input mode. In input mode, not current can sink into the GPIO pin, and so PNP BJT (or photo LED) cut off. Using the GPIO clean up has the same effect of returning GPIO to default input state.

However, there is a severe problem with the brute force workaround: There might be a latching effect caused by "Connecting 5V source through a reistor to the GPIO pin, as show in the diagram below (Appendix D)

We started with the OP's Low Trigger relay, with JD-Vcc jumper, and described how to use the JD-Vcc jumper for two power supplies configuration, and thus solved the Rpi-High-Not-High-Enough, Low-Trig-Relay-Always-On-Cannot-Turn-Off Problem.

We then use the simple Low trig relay as an example to explain how to use the workaround of Switch-To-Input-Mode-To-Turn-Off-Relay. We also explain this workaround might have the latch-up problem, and might fry the Rpi, therefore not recommended.

Question - I have similar module but with "total-isolation" where is the ground pin corresponding to JD-VCC? If you don't connect GND of control and load circuits then you need to connect GND of power supply for load circuit somewhere - but there is no pin for it?

Answer - Ah, the point is that Rpi Gnd is not connected to Relay Gnd. That is the meaning of "Total Opto Isolation" which isolated RpiGnd from RelayGnd (the big Pink X, meaning no physical connection!), and RpiPower from RelayPower.

I can see a diode, transistor, 3 resistors and 2 leds on the photo. Given additional information on the photo that input is active low and 2 leds are power and active an educated guess would be that transistor is p-channel mosfet or pnp used as a switch, diode is there for relay back emf protection, 2 resistors are led current limiting and the last resistor is on transistor gate/base.

Even if you are drawing for yourself, even more so if you are drawing for others, try to adhere to rules of thumb for schematics. Signals should generally go from left to right, components should be placed between the higher voltage and ground, lines should be straight if possible, minimise crossovers and redundant corners. It makes your schematic easier to read and spot errors. There is no need to emulate the physical layout of the circuit, a schematic is a logical representation of the circuit.

A ham radio friend (Dan, KA6RCZ) recently purchased an inexpensive single channel relay module (made by HiLetgo, in this instance) from Amazon, and he wanted to know if it would work in an application he had planned.

Because of local high noise at his location, Dan uses a remote webSDR site (KFS) through his PC for the receive side of his communications, and he wanted some way to turn off the PC's audio (to an external speaker) whenever he was transmitting.

This schematic was created from tracing out the circuitry of the 12 V version of the module, but it is probably applicable to the other voltage versions of the same module (e.g. the 5V relay module), assuming that the only change between different modules is the voltage rating of the relay.

Note that when the jumper is in the 'H' position, the relay turns ON when the IN voltage is raised to about 1.5 V above ground (i.e. 1.5 V above the voltage at the DC- connector). This threshold should be independent of the spec'd relay voltage, assuming that the only component that changes between different voltage-rated modules is the relay.

When the jumper is in the 'L' position, the relay turns ON when the IN voltage is less than about 1.5 V below DCV (where 'DCV' is the DC voltage applied to the module between the DC+ and DC- inputs).

So, for a 5V relay module with 5 VDC applied between the DC+ and DC- connectors, I'd expect the relay to turn ON when the IN voltage is less than about 3.5 V (note: IN voltage level referenced to the DC- pin).

As always, I might have made a mistake in my equations, assumptions, drawings, or interpretations. If you see anything you believe to be in error or if anything is confusing, please feel free to contact me or comment below.

And so I should add -- this information is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I purchased a few of these Yunshan Wifi Relays through ebay for approximately $7.50US. The device should be perfect for use in simple IOT projects which require controlling household AC power. The onboard JQC-3FF relay is rated to 250VAC or 30VDC at up to 12A. There are routered slots between the high voltage PCB traces for circuit isolation and arc-over protection. Transient voltage suppression is incorporated on both the board power supply and the photocoupler (see description below) input line.

The device requires a power supply between 7 and 30V DC. I unsuccessfully attempted to run it with an inexpensive 5V, 2A wall-wort, even though the onboard MP2303 buck converter is rated down to 4.8V. I did get it to operate successfully using a 9VDC wall-wort.

c80f0f1006
Reply all
Reply to author
Forward
0 new messages