How to connect Relay module to Raspberry Pi

by Seba San Blas   Last Updated August 13, 2019 21:25 PM - source

I have a relay module exactly like the one on the next page :

I wanted to consult you about the correct way to use it. I connected the 5V port of my RPi to "+", GND to "-" and "S" to GPIO17.

1- In the first measure when directly connecting the module to the RPi, take the current between the gpio port and the "S" (SIGNAL) output, and measure a value of 4 mA.

2- In addition, I made the previous connection but I connected between "s" and the gpio a resistance of 2.2 K, took its current and obtained a value of 0.42 mA.

3- The voltage difference between + and - is 5 V.

4- The voltage between "S" and "-" is 3.30 V.

I could use one of the 2 previous connections (Point 1 or 2), or I should add an additional transistor ?(I have seen several websites but I have doubts about the connection with the module I have). I'm currently using point 2 without problems but I'm afraid of damaging my Rpi.


Tags : raspberry-pi

Answers 1

enter image description here

It doesn't look like you need the resistor. There's a transistor on the board (Q1) that carries the current for the relay coil from the 5V supply. Since there's no base resistor, it's likely that this is a logic level FET, and you can safely connect the 'S'input directly to the Pi output. Leaving the setup as you have is should be OK. The gate current drawn by these FETs is minimal, I'm not sure where the 0.42mA is going.

Is it safe to drive a MOSFET from an output pin of a microcontroller? has some useful comments.

Phil G
Phil G
August 13, 2019 21:56 PM

Related Questions

how can I gey Rapiro kit in india

Updated April 07, 2015 23:10 PM

Wiring +5V to Micro USB

Updated June 12, 2015 09:10 AM

Raspberry pi computer monitor

Updated February 16, 2016 00:23 AM