1

Ok, I have this awkward situation. I have a 3V relay that I need to implement in my project. When I connect it to a 5V pin on RPi, everything's working fine, I can hear the coil opening and current flows from the relay, but when I try to do same thing with GPIO pin (without resistor), it simply doesn't work. I guess, gpio pin doesn't provide enough current to the relay to open the coil, because as far as I know, gpio pin is 3V, just as my relay.

Relay model is LMR2-3D

So what's the solution in my situation? I heard that it's possible to increase current for gpio pin, will this solve the issue I have or is there a better solution?

P.S. As you may have guessed, I'm quite new to electronics.

3

The coil need 180mA at 3V to operate. The most you can safely take from a gpio is circa 16mA (and circa 50mA from the 3V3 rail as a whole).

Even if you could supply the needed current from the gpio you shouldn't. When the coil is de-energised the back EMF could destroy the gpio and/or the Pi.

You'll need at least a transistor to act as a switch and a flyback diode to protect against back EMF. Google the terms.

I'd use a ULN2003A or similar in preference to transistors/resistors/diodes as I find it easier to understand digital devices. The ULN2003A could safely switch the relay in response to a gpio signal.

1

The issue - as you already figured by yourself - is the limited current that can (or better to say: should) be drawn from a GPIO pin. A buffer/amplifier is mandatory to provide this large a current. Chances are that those IO pins are already blown by this experiment...

A simple single-transistor buffer (w/o optocoupler) is also shown in Can I Use this Relay Board with pi?

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.