Electronic – Why does the microcontroller’s 5V out fail to activate the 5V relay

pololurelay

I am using a small microcontroller with 5V output lines to try to turn a relay on and off.

I bought the relay module from Amazon and unfortunately I don't know much about what is on the relay module's board, but I do know the relay is a SRD-05VDC-SL-C

I tried to follow an Arduino tutorial and I've almost got the setup working…

I say almost because the relay IN line doesn't seem to get enough power, and the Green LED on the module that indicates the IN line's voltage is very dim.

I tested the module by putting the IN line directly on the 5V input, and it seems to work fine.


I made a video that explains and demonstrates the problem

You can also connect an external power source to the microcontroller, and I tried that, too, with similar results


Can anyone help me understand why the relay doesn't work when hooked up to the 5V output line of the microcontroller?


EDIT

Attempt at drawing out configuration in first video, where the A* microcontroller is getting 5V of power from its usb plug:

schematic

simulate this circuit – Schematic created using CircuitLab


Attempt at drawing schematic of video 2

schematic

simulate this circuit


Attempted schematic for a new 3rd video, trying to power the relay separately.

schematic

simulate this circuit


Actually got it working with 2 pins in this 4th video

Does this mean that the problem was current all along?

Best Answer

Are you setting the pin on your microcontroller as an output? The behavior of the LED makes me think you did not. You might get a volt or so, enough to light the LED a little but not enough activate the relay. I had this problem recently and nearly tore my hair out, so I thought I should suggest this in case it is indeed your problem.

Related Topic