raspinigo
Posts: 5
Joined: Wed Feb 03, 2016 1:00 pm

Problems with a relay

Tue Apr 12, 2016 10:27 pm

Hi all.

Im still pretty new with raspberry...

I want to do a thermostat with my raspberry pi 2B, an lcd screen of 5', an thermal sensor and a relay to switch on and off the calefactor...

I have all working but the relay. I'll tell you what I've done because I think that I should be doing something wrong:

First of all: I've attach a picture of my relay with numers and letters in the elements of which I'll talk about for better understanding...
relay2.jpg
This is the relay
relay2.jpg (59.7 KiB) Viewed 661 times
My screen uses the first 26 pins of my rasp, so I use pins 33,35,37 (GPIO13,19 and 26) and 39 (Ground) for the relay. Im using the 39 as ground and the 33, in high (3.3V) as Vcc (maybe this the problem? I've not free 5.0V sources). And so 35 and 37 to inputs of the relay like shown in the picture (pins 1 and 2).

Well, that what I do and thats what I get:

Leds (L1 and L2) ligth when I activate (in low) the inputs 1 and 2 and didnt light when I deactivate them. But outputs of the relay a-b and d-e are always a closed circuit (they have a resistance of ~0Ohms in my multimeter) and b-c and e-f are always open circuite... no matter which input (1,2, both or neither) is active... More than this: with the relay disconected a-b and d-e are always a close circuit...

For clarification, beneath G, in the circuit, in the picture is the Gnd an beneath Vcc Vcc... 1 goes with in1 and 2 with in2

I don't know what happens here :(

klricks
Posts: 7172
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Problems with a relay

Tue Apr 12, 2016 11:22 pm

You must use 5V for VCC with these relays. It would be best to have separate 5V supplies for the RPi and relay.
Maybe a dual output USB? Something similar to this: http://www.amazon.com/POWERGEN-Dual-Cha ... B0073FE1F0
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

raspinigo
Posts: 5
Joined: Wed Feb 03, 2016 1:00 pm

Re: Problems with a relay

Tue May 03, 2016 10:51 pm

Thanks kiricks, you were rigth :D

Anyway, I've use the raspberry's 5V source. To do that I've cut the plastic protection of the bottom of the pin and put there a cable (that way the screen can be connected simoultaneously).

No problem for the moment....

I've connected in the rasp the screen (lcd 5'), a DS18B20 thermal sensor (which gets 3,3V source from a gpio setted as output) and the relay.

If I get problems with this configuration I'll update this post....

Return to “Beginners”