Go Down

Topic: How to trigger a Relay AND turn on an external LED with the same output pin. (Read 101 times) previous topic - next topic

Gary_Arduino

Goal - Use a single Arduino pin to turn on a Relay(energize it's coil) while simultaneously turning on an Indictor LED located on a separate panel.

Problem - digitalWrite(pinout, HIGH) turns on the LED but turns off the Relay.
               digitalWrite(pinout, LOW) turns off the LED while turning on the Relay.
             
note: I am using the NC connections of the RELAY.

Can I Turn on the relay AND the LED utilizing the same pin?
Software - Arduino 1.8.5 on a Mac 10.7.5
Hardware - Arduino Uno (ATMEGA328P processor)

PaulRB

Yes. Just connect the led + series resistor between 5V and the pin.

I assume you are using a relay module, with a transistor or opto-isolator, rather than a bare relay? An Arduino pin cannot provide enough current to energise a relay's coil directly, and could be damaged.

Gary_Arduino

Thanks SO much!
I spent a day trying to figure out how to make this work by myself.  :smiley-confuse:
Software - Arduino 1.8.5 on a Mac 10.7.5
Hardware - Arduino Uno (ATMEGA328P processor)

Go Up