I would like to control on/off switches with relays for lights in my room. I found this relays


and this scheme


I have found that GPIO pins are 3.3v. So will I be able to use this relays with 3.3v pins from raspberry pi. Will they have enough mA to power these 220v AC relays. I'm a noob just googling things. Probably got things wrong. I think that maybe mA from pins will not be enough to power a relay. 3.3v from pins sounds good for this relay. If you have any good tutorial and links for noobs on how to do this I would be thankful :)

  • It is impossible to tell without a data sheet. The ebay-link does not provide sufficient detail. It might work, we just cannot know. You're on the safe side with a switching transistor to drive the relay according to this answer: raspberrypi.stackexchange.com/a/28201/19949
    – Ghanima
    Commented Dec 8, 2016 at 15:02
  • I have a few of these exact relays, and I've found that neither the GPIO 3.3v nor the full on 5v pins are not enough to trigger this relay. I use the smaller relays from the GPIO to power a 12v source, that then feeds these relays. I do this because the smaller relays aren't capable of connecting 14ga solid-core copper, which I always use for 120v/240v applications (for 15A or less), no matter how low I assume the current draw will be.
    – stevieb
    Commented Dec 8, 2016 at 17:33

3 Answers 3


This question on electrical engineering SO seems to indicate that these are supposed to be driven directly from an MCU output (e.g. Arduino pin, Raspberry Pi GPIO pin etc).

However, if @stevieb suggests the GPIO output cannot trigger them, then you just need transistor and a higher voltage.


simulate this circuit – Schematic created using CircuitLab


you can use python for control GPIO pin.

this script example set pin 18 output and HIGH

import RPi.GPIO as GPIO

and for set pin HIGH or LOW


EX :

import RPi.GPIO as GPIO
GPIO.setup(18, GPIO.OUT) # set output mode
GPIO.output(18, GPIO.HIGH) # HIGH PIN 

schematic for connecting relay to raspberry this image find in google

tutorials for learning "how to use GPIO pinout raspberry"


The SSR datasheet says that you need to source at least 7.5 mA to trigger the relay. So you need to use a transistor like that in KennetRunner response but the 5V line is enough but the resistor must calculated depending on transistor's HFE, that of 2N2222 is greater than 35 so you need a resistor not bigger than 22k (I suggest 10k to be safe).

Remember that the RPi has very weak GPIOs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.