Controlling a relay with an Arduino uno

I followed this guide: https://www.instructables.com/Driving-a-Relay-With-an-Arduino/
but nothing happens. when I connected the LED directly to D2 (with a resistor) it did turn on and off so the Arduino itself isnt the problem. I know very little about electronics so please dumb down your answers :slight_smile:

here is how I connected everything:

the code is the same as in the tutorial.

edit: when I connected the LED to the other side (NC) of the relay it did light up. but didn't blink and there were no clicking noises from the relay.

Do post a proper annotated schematic, can't tell how things are connected based on this image.

Are you sure the short legs of the relay actually make proper contact to your breadboard?

You seem to have put the diode in series with the relay winding instead of across it - that article actually has a sensible schematic, you need to follow it exactly. BTW you should check the pin out of the actual transistor you are using (they do vary). emitter to ground, base via resistor to Arduino pin, collector to relay and diode's anode.

If the diode was wrongly placed there is a finite chance you've blown up your transistor (the diode prevents inductive kick-back).

With all circuit building, build once, check twice! A single mistake can ruin your day.

turns out the transistor was reversed and I was too scared to check, all works now. thanks!

Ah good....

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.