plcgcpm
Posts: 12
Joined: Tue Nov 20, 2018 8:36 pm

Broken Gpio

Tue Nov 20, 2018 8:47 pm

Hi all, I have a problem, I've already broken two raspberries in 2 years. They were connected to a relay and after a while the relay is always active, the Gpio all give power when they should be off. Does anyone know why this happens to them? Is there any measure of protection for the Gpios I'm not taking?. Pleased I need help.

User avatar
piglet
Posts: 895
Joined: Sat Aug 27, 2011 1:16 pm

Re: Broken Gpio

Tue Nov 20, 2018 9:54 pm

You've not given enough detail for anyone to assist you.

It would help if you posted the schematic you're using.

Idahowalker
Posts: 445
Joined: Wed Jan 03, 2018 5:43 pm

Re: Broken Gpio

Tue Nov 20, 2018 10:10 pm

Did you have those relays directly powered by the RPI?
Without knowing why you are deleting my postings, I will not know how...

plcgcpm
Posts: 12
Joined: Tue Nov 20, 2018 8:36 pm

Re: Broken Gpio

Wed Nov 21, 2018 8:57 pm

This is how i have connected.
raspberry relay.png
relay
raspberry relay.png (139.36 KiB) Viewed 1991 times

gordon77
Posts: 3994
Joined: Sun Aug 05, 2012 3:12 pm

Re: Broken Gpio

Wed Nov 21, 2018 9:02 pm

Which model of relay board is it?

Idahowalker
Posts: 445
Joined: Wed Jan 03, 2018 5:43 pm

Re: Broken Gpio

Thu Nov 22, 2018 3:33 am

plcgcpm wrote:
Wed Nov 21, 2018 8:57 pm
This is how i have connected.raspberry relay.png
Ok, so you got the relay board connected to RPi 5V and you are controlling the relay board ( D1) from a 3.3V GPIO pin,
RPi-J8-40 (GPIO21). I am guessing that you are sending either a 1 or a 0 out of GPIO21 to enable and disable the relay?

I'd not drive a relay coil directly from a GPIO pin, I'd use a MOSFET or transistor. The RPi GPIO pins do not have the current handling capacity to handle a relay coil.

I'd not cause the RPi which has 3.3V tolerant GPIO pins to be connected to 5V.

The combination, my guess, of driving a 5V relay coil directly from a GPIO pin is the most likely cause of your RPi failures.
Without knowing why you are deleting my postings, I will not know how...

plcgcpm
Posts: 12
Joined: Tue Nov 20, 2018 8:36 pm

Re: Broken Gpio

Thu Nov 22, 2018 12:09 pm

So, how is the correct connection with a Raspberrry pi to control a relay of this type? Exactly the relay I use is this
Attachments
rele2.jpg
rele2.jpg (211.04 KiB) Viewed 1833 times

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 11830
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Broken Gpio

Thu Nov 22, 2018 1:20 pm

Using relay modules may lead to one of the common pitfalls, in that on many (most) of the relay boards the relay driver logic is designed to be driven with TTL (5V) logic levels, not with 3V3 levels.
The common pitfalls sticky has a subject on it: viewtopic.php?f=91&t=83372&p=1225448#p1225448

plcgcpm
Posts: 12
Joined: Tue Nov 20, 2018 8:36 pm

Re: Broken Gpio

Thu Nov 22, 2018 2:08 pm

Thank you very much for the help, You are very fast and help the community grow very fast. How do I need to connect the relay with the Raspberry Pi so that the signal is 5v?. Forgive me but I do not speak English very well. I just need to know what to buy to make things right.

Idahowalker
Posts: 445
Joined: Wed Jan 03, 2018 5:43 pm

Re: Broken Gpio

Thu Nov 22, 2018 2:48 pm

Entering the words "circuit operate relay with raspberry pi" into your favorite on-line search engine would net results like these:

Image

Image
Without knowing why you are deleting my postings, I will not know how...

plcgcpm
Posts: 12
Joined: Tue Nov 20, 2018 8:36 pm

Re: Broken Gpio

Thu Nov 22, 2018 3:13 pm

Thank you very much but I do not understand, I´m not an electronic worker.
Edit: I have already achieved using a Arduino in series with the Raspberry Pi. The Raspberrry Pi gives the order and the Arduino opens or closes the circuit with the relay. My hope is to get it to work only with the Raspberry Pi (without Arduino) and someone tell me the pieces I need to get the output of 3.3 V to 5v,

User avatar
joan
Posts: 13998
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Broken Gpio

Thu Nov 22, 2018 7:19 pm

You need to buy a transistor. Search for a circuit in your language to switch the transistor on and off. The Pi's 3V3 GPIO will use the transistor to supply 5V to the relay module.

Idahowalker
Posts: 445
Joined: Wed Jan 03, 2018 5:43 pm

Re: Broken Gpio

Thu Nov 22, 2018 10:50 pm

This opto isolated board relay board would work.

https://www.amazon.com/Raspberry-Pi-Exp ... lay+module
Without knowing why you are deleting my postings, I will not know how...

plcgcpm
Posts: 12
Joined: Tue Nov 20, 2018 8:36 pm

Re: Broken Gpio

Sun Nov 25, 2018 7:06 pm

Thank you all for the answers, I give the issue for solved. :D

Return to “Advanced users”