0
\$\begingroup\$

I am trying to toggle an SRD-03VDC-SL-C (3V rated) relay with a Raspberry Pi GPIO.

When I put a wire to the Raspberry Pi 2B ground pin and the other to a 3.3V power pin the relay works (it clicks). I measured 3.28V with my multimeter.

Now, as the relay is confirmed to be working I want to toggle it via software by switching a GPIO pin. I confirmed that the GPIO switching is working with my multimeter: It shows 3.28 V when high and 0 V when low.

But when I connect the wire with the GPIO in high state it does not toggle the relay. How is this possible when both pins have the same voltage and how can I fix this?

Experimenting with the Raspberry I also observed the situation that I could set the voltage to 0 but disconnecting then made a difference. I would assume that in this case disconnecting would not make a difference.

\$\endgroup\$
4
  • 3
    \$\begingroup\$ A I/O pin cannot deliver the amount of current required to drive a relay coil (trying to do so can damage the device). Buffer the signal with a transistor. \$\endgroup\$ – Unimportant Jan 1 at 17:49
  • 1
    \$\begingroup\$ Are you using a bare relay or a relay module? \$\endgroup\$ – ocrdu Jan 1 at 17:49
  • 1
    \$\begingroup\$ Currently using a bare relay. \$\endgroup\$ – Benedikt S. Vogler Jan 1 at 17:58
  • \$\begingroup\$ Measure the GPIO output while the relay is connected and add that to the question. \$\endgroup\$ – user_1818839 Jan 1 at 19:34
6
\$\begingroup\$

A GPIO pin cannot provide enough current to a relay directly. Use the GPIO pin to drive a transistor, and use the transistor to drive the relay.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Thank you. This explains it. I will try that and if it works, accept your answer. \$\endgroup\$ – Benedikt S. Vogler Jan 1 at 17:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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