Rodarg
Posts: 1
Joined: Thu Mar 23, 2023 6:01 pm

Did i fry my PI with this relay?

Thu Mar 23, 2023 6:14 pm

Hey guys,

So i was building a project of mine with a raspberry pi and a relay (https://www.faranux.com/product/single- ... ule-com41/) when i attached the 5v to the 5v and the ground to ground and the IN to GPIO 4 i got it working once. When i tried again the relay would just turn on immediately and will only turn off when i disconnect the GPIO pin. I then tried it on another pi to check if the relay was the problem and then that pi's gpio pins also stopped working. So i think i just screwed up 2 of my raspberry pi's :|

But can anyone double check why it stopped working and what i did wrong, i'm not a very electrical guy i just know the basics so i didnt think connecting a 5v relay to a 5v port on the pi and then just turning it on and off once could screw up my pi but i have a feeling i just wasted about 100$ by screwing around with this relay (im stupid i know).

Next question is: can i still use the pi when the GPIO ports are fried or should i throw it away? because the pi itself is still working and can run programs but the GPIO is just fried i guess.

pcmanbob
Posts: 13563
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Did i fry my PI with this relay?

Fri Mar 24, 2023 8:48 am

So first off the pi's gpio pins are not 5V tolerant so connecting 5V to them will damage your pi.

Now if you are lucky and your relay board is active low then you could have just run in to the problem that many of these relay boards suffer with,

have a read of this .. /viewtopic.php?f=91&t=83372&p=1225448#p1225448

So this first thing to do is work out if your relay board is active low.

Connect 5V and ground to the pins on the relay board , then just using a simple jumper wire connect the in pin first to the 5V and then to the ground , which one turns the relay on ?

EDIT.. having looked again at the linked site for the relay board I think you should find its active low so you may be lucky and have not damaged your pi.

To test the pi gpio pin just connect an LED and 470 ohm resistor between the gpio pin to be tested and ground then just write a simple test program to make the pin turn on and off while set to output.

report back on your finding and hopefully you pi is undamaged and you just need an interface circuit between the pi gpio pin and the in pin on the relay board , I can post such a circuit if that's all hats needed.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

revell1
Posts: 321
Joined: Fri Sep 23, 2022 10:38 am
Location: Near: Gatwick Aviation Museum - UK

Re: Did i fry my PI with this relay?

Fri Mar 24, 2023 9:19 am

The details on the link site, suggest that the control input should work for control signals between 3 and 5V.
The limited photos suggest that the relay control is probably buffered via some form of transistor, but there is no circuit diagram.

It is hard to tell from the data if it is safe for the GPIO pins.

If you have a volt meter then,

If you connect the relay board to just the 0V and 5V, leave the control input UNCONNECTED.

What voltage do you measure between the 0V and Control Input pin on the relay board?

Hopefully any voltage measured will be below 3.3Volts, as there should be a transistor blocking any voltage coming back out of the control pin.
.

User avatar
rpdom
Posts: 21837
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Did i fry my PI with this relay?

Fri Mar 24, 2023 9:47 am

revell1 wrote:
Fri Mar 24, 2023 9:19 am
The limited photos suggest that the relay control is probably buffered via some form of transistor, but there is no circuit diagram.
I did as much reverse engineering as I could from the photos. It looks like the relay is switched on the 0v side by a transistor which is directly hooked to the IN pin. No pull-up to 5V that I can see. From that I suspect it should easily work with the Pi's GPIO output (depends on the spec of that transistor of course).
Unreadable squiggle

ame
Posts: 7144
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: Did i fry my PI with this relay?

Fri Mar 24, 2023 9:51 am

rpdom wrote:
Fri Mar 24, 2023 9:47 am
revell1 wrote:
Fri Mar 24, 2023 9:19 am
The limited photos suggest that the relay control is probably buffered via some form of transistor, but there is no circuit diagram.
I did as much reverse engineering as I could from the photos. It looks like the relay is switched on the 0v side by a transistor which is directly hooked to the IN pin. No pull-up to 5V that I can see. From that I suspect it should easily work with the Pi's GPIO output (depends on the spec of that transistor of course).
I actually have one of those boards, and I drew the schematic and posted about it somewhere. Unfortunately I can't find my post, so I'll do it again.

I'm disappointed that many of these cheap modules have no easily found schematics. It would make things a lot easier.
Hmm. What can I put here?

User avatar
rpdom
Posts: 21837
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Did i fry my PI with this relay?

Fri Mar 24, 2023 10:06 am

ame wrote:
Fri Mar 24, 2023 9:51 am
I actually have one of those boards, and I drew the schematic and posted about it somewhere. Unfortunately I can't find my post, so I'll do it again.
That would be handy.
I'm disappointed that many of these cheap modules have no easily found schematics. It would make things a lot easier.
Definitely. Especially when they can be good ones, as this appears to be.
Unreadable squiggle

ame
Posts: 7144
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: Did i fry my PI with this relay?

Fri Mar 24, 2023 7:32 pm

Ok, at first glance my board looks the same, but on mine the drive transistor is next to the green led and back-EMF protection diode. It might be the same circuit, laid out differently, but it might not.

It's also possible that OP's relay is different to the picture and the same as mine.
Hmm. What can I put here?

ame
Posts: 7144
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: Did i fry my PI with this relay?

Fri Mar 24, 2023 8:20 pm

Ok. I trawled through several pages on my favourite Chinese vending site and found this:

https://m.aliexpress.com/item/1005002328799917.html

The photo matches the OP's supplier photo, and there is a schematic! It is specified to be active high. This is a classic design, and would be safe with a 5V relay supply and a 3.3V GPIO signal.

This is a similar module from the same vendor:
https://m.aliexpress.com/item/4000674977288.html

This is the active low version, but there's no schematic, so I can't comment on its operation. I could draw the circuit from the one I have.

So, there are two modules, active high, and active low, which look similar, but have different component placements.

It's possible that the OP received a module that looks different to the one in his supplier's picture. We need OP to post a photo of the actual model he has.
Hmm. What can I put here?

Return to “Troubleshooting”