last day (15 days later) » 

2:33 PM
1
A: How to protect GPIO from back current? Diode?

tlfong01Question The OP is learning how to use Rpi to control a 12V DC motor using a 5V relay without any optical isolation. To adjust motor speed and direction, He uses a PWM controller and a DPDT reverse polarity relay to switch the 12V power supply. So far so looking good, but he has already fried tw...

 
@tlfong01 FYI, the relay is a 3.3V control one (not 5V). There is absolutely nothing connected to any of the 5V rails on my Rpi. Not sure if it changes anything in the schematic.
 
@JRE, Well, but #that-ben has been running it months. His circuit design is not at all that of a friendly newbie, but a ninja grade industrial level innovation, also future proof. His Albert Einstein style ugly drawings show the beauty of the harmony of the Universe. I see him as a prophet without honour in other forums (Mark 6:1-6).
Ah, let me see, There are two relays here. For D4184, VGS(th) is 1.7V min, 2.1V typ, 2.6V max, so is Rpi 3V3 logic friendly. The OP does not tell us if his 5V relay is High or Low trigger. If High Trig, then everything should go well. If Low Trig, then there are a couple of workarounds. See Refs 10, 11.
 
There is no 5V relay anywhere in my project. The Rpi relay (marked BESTEP) is control 3.3V and outputs 12V to the inverse polarity relay which is control 12V output 12V.
 
Ah, there seems to be some confusion. I mean 5V relays are usually powered by 5V power, but the control signal at the IN terminal is 3V3. You might like to read Ref 11 to clarify.
 
OK but it's not the case with my relay. It's a JQC3F-03VDC-C (3.3V). There is zero 5V rail anywhere in my project. On the FIRST version yes there was a 5V relay and a 5V rail, but those have been replaced in the SECOND version as shown in Q.
 
2:33 PM
Ah, I overlooked that your relay is actually 3V3, not 5V. My apologies. I will correct the error later. Cheers.
Now the good news. The so called "PWM module" is actually only a high frequency (20kHz) current switch with two power MOSFETs connected in parallel. The good news is that both MOSFETs have built in flyback diodes. So you don't need to take care of that.
 
I'm trying to draw the schematic for the 2 other SE users who asked for it.
 
As you suggested, you can replaced your cheapy no optocoupler relay by one with optocoupler, or even with JD-Vcc jumper for "Total Optical Isolation".
 
Yes I was thinking about doing this yesterday evening. I ordered this. Do you think it's a good alternative? --> aliexpress.com/item/4001103712937.html
LR7843 (max 30V/161A)
 
@that-ben Ah your schematic looks good.
 
It's not done yet.
The issue I'm facing now is that the components in Circuit-Diagram.org are good, but the DPDT does not have one with 8 pins
In my setup, my DPDT has 8 pins and I cross linked +/- in a X shape to make it a reverse polarity relay which enables my robot to spin the motor forward and backward.
I think I should order diodes even if I have optocoupler PWM. What do you think?
 
2:45 PM
Ah, please read Ref 2 where I commented that you choice of flyback diode does not seem a good. You may like to read two more reference below on how to select a flyback diode. But as I just pointed out, the fake PWM module already has flyback's so you don't need to bother.
 
Oh really?
So you think the Rpi did not fry because of the PWM?
I don't see any diode on the PWM module tough!
There are 3 resistors, 1 LED and 2 transistors.
 
Yes, don't reinvent wheels. Double flyback looks stupid.
 
Also the description (even on different AliExpress store pages) never mention diode protection :?
on the PWM modules
I am freaking out, because I received a new Rpi 3A and I AM NOT CONNECTING IT until I am 100% sure it's not going to fry :(
 
Ah, the flyback is built into the big black guy. See my schematic v0.3.
 
You mean this:
So, to you, it is obvious that the PWM module already has built in diodes?
How do you know this?
 
2:55 PM
Ah, I have inserted the D4148 power MOSTFET datasheet in the reference list as Ref 1. Look at the pictures there! Ah, bed time! So I call it a day. Nice learning new things with you. Good night and cheers.
 
Thank you so much for your time. I hope I can accept your answer on SE. I still wonder what fried the Rpi since it's not the MOSFET :(
Good night
 
Ah, yes, I have been playing with power MOSFETs and power NPN BJTs as switches for some time. I noticed that all huge current switches has built in flybacks, otherwise the customers will curse half of the Universe. Bye.
 

last day (15 days later) »