0
\$\begingroup\$

This video exhibits a hack to make a 5 V relay module work with under-powered trigger signal from single-board computer like a Rapsbperry Pi. He adds a potentiometer at the base of the transistor in the relay module (IN pin). However, he doesn't explain why it works. Anyone can give me resources as to how it helps in triggering relay by adding resistance as large as 20 k?

https://m.youtube.com/watch?v=p7wmzAzDX-Q

Secondly I have a solid state high level trigger relay

https://www.amazon.in/xcluma-Channel-Omron-Level-Module/dp/B072TC8LQX

When I set it up with my Orange Pi the VCC pin is at 5.3 V & the IN trigger PIN is at 3.27 V. When I trigger it Channel 1 (or 2) LED lights up but my external circuit (a 5 V fan) do not run? The fan is powered externally with a mobile charger.

I also tested the fan without relay 1st & it ran at full speed with mobile charger

I have recorded a video of my setup. The weird thing is that if I check voltage across terminal of mobile charger (external circuit) fan nudges & tries to run??

https://imgur.com/a/aCZ49Vi

\$\endgroup\$
3
  • 2
    \$\begingroup\$ You should only ask one question at a time. \$\endgroup\$ Commented May 31 at 13:02
  • 1
    \$\begingroup\$ "Secondly I have a solid state high level trigger relay". That's a different question. Please start a new thread and ask that question. In StackExchange, you can only as a single question per thread. \$\endgroup\$ Commented May 31 at 13:16
  • 1
    \$\begingroup\$ I still think you should move either the 1st or 2nd question to a new post. These posts are for everyone and having 2 questions in one post makes it hard for others to benefit from the questions and answers. Regardless, an SSR is not like a Relay Module. Inside it likely uses a triac or power mosfet to control the power. And likely an optical coupler to control the triac or power mosfet. So biasing up the 0 to 3V3 swing may not work. And trying to pass low Voltage DC through something design to switch high Voltage AC may not work either. Buy the correct part. It will be much easier. \$\endgroup\$ Commented May 31 at 13:46

3 Answers 3

2
\$\begingroup\$

Don't do the mod like in the Youtube video

As they say, it's a hack, and moreover, an incorrect hack instead of solving the issue properly. That hack in the Youtube video will always try to push current into the MCU IO pin, and that should not be done for IO pins that are outputs. The hack works because the MCU does not damage from such low current trying to pull the output higher than 3.3V supply, but it's still wrong. An the problem is not that the 3.3V MCU output is "weak", it's because original circuit requires near 5V signal to turn off, and so the 3.3V output voltage will already drive the transistor on. The mod with larger base resistor drops more voltage over the resistor so the transistor has a chance to turn off even with 3.3V input voltage.

But your module is different, and you would need to reverse-engineer the circuit if you can do the same, but like already mentioned, it is never worth following improper circuits that may degrade your MCU and cause problems. And as explained below, your SSR output can't control the 5V fan to begin with, so it's possible that your SSR input does not even need modding, it might work perfectly, it's the SSR output that's not compatible switching 5V DC.

The module is an SSR module. It is not a relay module, it is not a bare SSR nor a bare relay.

Why it does not work switching your 5V fan is because the SSR is intended to switch mains AC voltage, i.e. 100 to 240 VAC (or whatever the datasheet says). It's not intended to switch DC as it contains AC zero crossing circuitry and will not work with such low voltage of 5V to the fan.

So it could be possible to use some level shifters or transitors between your 3.3V MCU board to drive the module input, but it might be simpler to buy a module that does what you want out of the box, i.e. accept 3.3V drive signal and use actual relays to switch loads.

Or if you simply want to drive the fan, forget such modules, and drive it with a transistor directly.

\$\endgroup\$
0
\$\begingroup\$

(This answer only addresses the first question the OP posted. Consider moving the second question a new post.)

The linked to video indicates a design using an PNP transistor which may conduct from the Emitter to the Collector when the Emitter to Base is forward biased. Typically this junction is forward biased when the Base voltage is more than 0.7 Volts less then the Emitter voltage. Assuming the Base is either at 0 Volts or 3.3 Volts and the Emitter is always 5 Volts, this is always the case. The transistor is always on.

Adding a voltage divider (the potentiometer) as described in the video can move the 0 Volt to 3 Volt swing such that when when the circuit is driven by 0 Volts the Base sees a Voltage less then 5 Volts - 0.7 Volts. While when driven by 3.3 Volts the Base sees a Voltage greater then 5 Volts - 0.7 Volts. Now the transistor can be on or off.

Care should be taken not to exceed the current capabilities of the driver (the single board computer) by bottoming out the potentiometer in such a circuit.

\$\endgroup\$
2
  • \$\begingroup\$ Using this high side transitor with 5V supply and controlling it with a 3.3V MCU, it will always push current into the output of 3.3V MCU pin. Not evem hobbyists should do this. It's literally a hack, an incorrect way of trying to fix the problem at hand, instead of solving it properly. It's amazing how Youtube is full of how to make incorrect circuits. \$\endgroup\$ Commented May 31 at 13:30
  • \$\begingroup\$ Yes, agreed. A level shifter would be better. Even better to redesign the driver transistor circuit to work with a 0 to 3V3 swing. Maybe use a MOSFET. This is why I added the "Care should be taken.." to my answer. But he did ask "how does this work". Not "what's the best way to do this". \$\endgroup\$ Commented May 31 at 13:34
0
\$\begingroup\$

You have two questions. I am only answering the first question. Justme answered your second question.

However, he doesn't explain why it works.

The relay module in that video has a 1 kOhm input resistance to drive the transistor that, in turn drives the relay. That is an ideal resistor value for that circuit. However, it will work with somewhat larger value as well. The author used a pot to find a higher resistance value that doesn't overload the single-board computer yet low enough to provide sufficient drive to the transistor in the relay module. Any higher than that, the transistor will not be driven fully and may overheat; also the relay may not turn on.

by adding resistance as large as 20 k?

That's too high for a standard relay module. You would need to modify the module extensively. But that's not necessary: any self-respecting SBC can drive a lower resistance without a problem.

This video exhibits a hack to make a 5V relay work

No it doesn't. That's not a relay. That's a relay module. They are different!

  • Relay: A single electrical component. It has a coil (or two) and a set of contacts. It receives a relatively high power signal to turn on example
  • Relay module: A complete electronic PCB assembly. It includes a driver and a relay. It receives a relatively high power from a power supply and a low power signal to tell the relay to tun on. It includes a PCB, connectors, transistors, one or more relays, maybe some LEDs; example

I have recorded a video of my setup.

That is an SSR module.

  • SSR: single component
  • SSR module: A complete electronic PCB assembly. It includes a driver and a solid state relay.

In technology, using the right terms matters a lot.

\$\endgroup\$
5
  • \$\begingroup\$ It's not even a relay module, it's a SSR module, yet another animal \$\endgroup\$ Commented May 31 at 13:06
  • \$\begingroup\$ Hmm, look at the first video; it's definitely a relay module (it uses an electromechanical relay), not an SSR (that would use semiconductors). \$\endgroup\$ Commented May 31 at 13:08
  • \$\begingroup\$ The video about OP's circuit with the fan has a board which has a big large silk screen print boasting "2 Solid State Relay" and it carries two Omron G3MB-202P SSRs. So the "relay" boards and their circuitry can't be compared simply without reverse-engineering. \$\endgroup\$ Commented May 31 at 13:15
  • \$\begingroup\$ We're both correct but we're talking about two different videos. OP asked "This video exhibits a hack to make a 5 V relay module work with under-powered trigger signal from single-board computer like a Rapsbperry Pi. ". That's the question I am answering and that's the video I am replying about. That video has a electromechanical relay. Then OP says: "Secondly I have a solid state high level trigger relay". I am not answering the second question because OP should ask a single question per thread. You're talking about the video in the second question. \$\endgroup\$ Commented May 31 at 13:19
  • 1
    \$\begingroup\$ Sure, I agree. However, no amount of modding OP's SSR module will make it work driving the 5VDC fan, thus we don't know if the SSR input even needs modding, it might work perfectly. \$\endgroup\$ Commented May 31 at 13:22

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.