NSG650
Posts: 6
Joined: Tue Apr 30, 2019 5:21 am

Raspberry Pi 2 died wile connecting a relay module

Tue Apr 30, 2019 6:05 am

I got a raspberry pi from my dad's friend and gave me on one condition that I would do something useful with it so I decided to install google assistant and control its GPIO through it so I did the project and I still ad the raspberry pi 2 and decided that (I had a arduino based irrigation system)what if I can control the Water pump via a relay and use google assistant to turn it on and off. The relay module had all the circuit for the relay to work. So i connected 5 volts to vcc and gnd to gnd so then the raspberry pi rested it self after I removed the connections so i decided to power it from an external power source and connect the signal to the raspberry pi and sharing the gnd so used a 5v regulator to power the relay and when i connected the signal the relay clicked rapidly and then my raspberry pi switched off and it was not turning on the cpu was heating really badly. My father decided to get me a new one but I wanted to know what is the problem

Schematic Link :https://drive.google.com/file/d/1KMnVRd ... qXr06/view


Thanks in Advance
NSG650

Icosagon
Posts: 26
Joined: Sat Apr 13, 2019 12:32 pm

Re: Raspberry Pi 2 died wile connecting a relay module

Tue Apr 30, 2019 8:50 am

Hello NSG650

I guess that the relay was clicking because when the raspberry pi boots its gpio pins are not programmed/ or dont know which state they were last, the gpios maybe high or low.

You could have used arduino with raspberry to control the irrigation system :)

What did you use to power the relay and raspberry :?

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

Re: Raspberry Pi 2 died wile connecting a relay module

Tue Apr 30, 2019 9:26 am

Hi.

So you have no current limiting resistor between the gpio pin and the transistor base, if you were in fact using a PNP transistor then you were sinking 5v on the the pi gpio pin , which would have killed your pi , not to mention that you transistor is connected the wrong way round.

And finally your diode is connected the wrong way round so its passing current all the time.

If you want to drive a relay using a transistor you need to connect it like this using an NPN transistor in this example a 2N2222, the diode is connected in reverse to the normal current flow so that when the relay is switch off it provides a path for the reverse voltage/current generated by the collapsing magnetic field in the relay coil.

Image
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

LTolledo
Posts: 3782
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: Raspberry Pi 2 died wile connecting a relay module

Tue Apr 30, 2019 9:32 am

5v on RPi GPIO, you killed your RPi

let your RPi..... R.i.P.
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

mcnpower
Posts: 5
Joined: Tue Nov 01, 2016 5:41 am

Re: Raspberry Pi 2 died wile connecting a relay module

Wed May 01, 2019 4:44 am

I suggest use Optocoupler for relay control. Like this way your R.Pi will be isolated from any damage.

NSG650
Posts: 6
Joined: Tue Apr 30, 2019 5:21 am

Re: Raspberry Pi 2 died wile connecting a relay module

Wed May 01, 2019 6:10 pm

Oh wait i found the diode is not a normal smd diode it is a zener diode with a 5.1 v zener voltage and it was connected to protect the relay modules pnp fet
(yes it is not a transistor)

Schematic

https://drive.google.com/file/d/1FYJZEF ... sp=sharing

My Schematic for relay module
https://drive.google.com/file/d/1jQt_4S ... sp=sharing


Thanks for the help and ways I could protected my Raspberry Pi

P.S My keyboard my desktop is sometimes glitchy and i am using a laptop for typing

NSG650
Posts: 6
Joined: Tue Apr 30, 2019 5:21 am

Re: Raspberry Pi 2 died wile connecting a relay module

Wed May 01, 2019 6:12 pm

pcmanbob wrote:
Tue Apr 30, 2019 9:26 am
Hi.

So you have no current limiting resistor between the gpio pin and the transistor base, if you were in fact using a PNP transistor then you were sinking 5v on the the pi gpio pin , which would have killed your pi , not to mention that you transistor is connected the wrong way round.

And finally your diode is connected the wrong way round so its passing current all the time.

If you want to drive a relay using a transistor you need to connect it like this using an NPN transistor in this example a 2N2222, the diode is connected in reverse to the normal current flow so that when the relay is switch off it provides a path for the reverse voltage/current generated by the collapsing magnetic field in the relay coil.

Image
Well yes i just drew it wrong and the relay module had that schematic before i posted the new schematic with its circuit
And also i had made a better relay module circuit ;)

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

Re: Raspberry Pi 2 died wile connecting a relay module

Wed May 01, 2019 7:24 pm

Well in you second diagram you are still using a zener according to what you have drawn, I suggest you use a 1N4001 to protect you circuit from the back emf and why have you got a hex inverter gate connected between ground and your 2N3904 transistor base and ground ?
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

LTolledo
Posts: 3782
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: Raspberry Pi 2 died wile connecting a relay module

Wed May 01, 2019 10:29 pm

pcmanbob wrote:
Wed May 01, 2019 7:24 pm
why have you got a hex inverter gate connected between ground and your 2N3904 transistor base and ground ?
Yeah, makes me wonder too..... any link to the source of this?

BTW, is your RPI2B still "alive and kicking" or under ICU?
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

NSG650
Posts: 6
Joined: Tue Apr 30, 2019 5:21 am

Re: Raspberry Pi 2 died wile connecting a relay module

Thu May 02, 2019 10:17 am

LTolledo wrote:
Wed May 01, 2019 10:29 pm
pcmanbob wrote:
Wed May 01, 2019 7:24 pm
why have you got a hex inverter gate connected between ground and your 2N3904 transistor base and ground ?
Yeah, makes me wonder too..... any link to the source of this?

BTW, is your RPI2B still "alive and kicking" or under ICU?
Well the hex inverter is there because the protection system of relay module has a zener diode that turns off the pnp transistor as it turns on when there is 0 volts so the npn transistior turns on when there is a higher voltage so the zenre diode send it high voltage which then converts the the logic high to low and the npn transistor turns off because of this and the raspberry pi 2 has a constant act LED and the the CPU is heating up

BTW I got a new raspberry pi 3 B+ today it is much more faster infact i am typing the reply on my raspberry pi 3 b+ in ubuntu mate :D :D

Still thanks for the help guys

NSG650
Posts: 6
Joined: Tue Apr 30, 2019 5:21 am

Re: Raspberry Pi 2 died wile connecting a relay module

Thu May 02, 2019 10:24 am

pcmanbob wrote:
Wed May 01, 2019 7:24 pm
Well in you second diagram you are still using a zener according to what you have drawn, I suggest you use a 1N4001 to protect you circuit from the back emf and why have you got a hex inverter gate connected between ground and your 2N3904 transistor base and ground ?
Well it is complicated the zener diode is connected to the hex inverter and in my previous post how the protection system is there in the relay module is the reason for having the hex inverter wen vere the zener diode activates the hex inverter inverts the output and turns off the transistor and then the zener diode act as the flyback diode nice design but also really bad fot the raspberry pi

btw i figured out that we can connect a diode at output so whenever the module tries to send something back the diode blocks it ;)

NSG650
Posts: 6
Joined: Tue Apr 30, 2019 5:21 am

Re: Raspberry Pi 2 died wile connecting a relay module

Thu May 02, 2019 10:27 am

Icosagon wrote:
Tue Apr 30, 2019 8:50 am
Hello NSG650

I guess that the relay was clicking because when the raspberry pi boots its gpio pins are not programmed/ or dont know which state they were last, the gpios maybe high or low.

You could have used arduino with raspberry to control the irrigation system :)

What did you use to power the relay and raspberry :?
Well I did the thing you said i connected my new raspberry pi 3b+ to an mosfet to turn on and off the 5v going into the arduino the mosfet will act as the switchand the arduino reads the value and turn pin 13 on or off

Icosagon
Posts: 26
Joined: Sat Apr 13, 2019 12:32 pm

Re: Raspberry Pi 2 died wile connecting a relay module

Thu May 02, 2019 3:29 pm

Did it work :?:

Why cant you use a buck to buck converter for that. You should provide voltage higher than 5v eg:12v. It will convert 12v into 5v. Buck to Buck converter to usb is available so you can use it as an normal power bank. Its much safer to power pi that way :D .

Icosagon
Posts: 26
Joined: Sat Apr 13, 2019 12:32 pm

Re: Raspberry Pi 2 died wile connecting a relay module

Thu May 02, 2019 3:32 pm

Dont do anything dangerous with your raspberry pi as it could get damaged even by connecting and led :| . You should try to stick with the Pi's Micro USB.

Return to “Troubleshooting”