Arduino, Relay, LEDS

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
PilotinControl
 
Posts: 15
Joined: Tue Jul 28, 2015 1:15 am

Arduino, Relay, LEDS

Post by PilotinControl »

Hello Group,

I have an arduino Nano, I am controlling several relays which control reverse polarity actuated pulsed solenoids. Now the relays work as they should no issues there. Each relay is pulsed about 50 milliseconds and turns off as to not burn up the solenoid. I would like to save on pins with the Nano and some how switch the leds on and off using the relay. How would I go about doing this? I have attached a schematic of my current setup with out the LEDS as right now they are connected via the Nano. Thanks in advanced.
Attachments
Arduino-Relay-Wiring.jpg
Arduino-Relay-Wiring.jpg (488.44 KiB) Viewed 607 times

User avatar
adafruit_support_bill
 
Posts: 88096
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino, Relay, LEDS

Post by adafruit_support_bill »

What exactly do you want the LEDs to do relative to the solenoid and/or turnout alignment?

User avatar
PilotinControl
 
Posts: 15
Joined: Tue Jul 28, 2015 1:15 am

Re: Arduino, Relay, LEDS

Post by PilotinControl »

Panel indicators, right now my setup uses 1 nano, 4 momentary push buttons, one 8-channel relay module. Each time a push button is pressed one relay goes on and shuts off after 50 milli seconds. One Led per relay...when one goes on the other goes off for each relay

User avatar
adafruit_support_bill
 
Posts: 88096
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino, Relay, LEDS

Post by adafruit_support_bill »

But how many indicators are there and what are they supposed to be indicating? You solenoid is only energized for 50 milliseconds at a time. Doe a LED illuminate for 50 milliseconds also to indicate that the solenoid is energized?

User avatar
PilotinControl
 
Posts: 15
Joined: Tue Jul 28, 2015 1:15 am

Re: Arduino, Relay, LEDS

Post by PilotinControl »

1 Led for each relay (total of 8 Leds). Green for De-energized and Red for Energized.....the Led needs to stay illumintated even after the 50 milliseconds is up

User avatar
adafruit_support_bill
 
Posts: 88096
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino, Relay, LEDS

Post by adafruit_support_bill »

Green for De-energized and Red for Energized.....the Led needs to stay illumintated even after the 50 milliseconds is up
So the LED flashes red for 50 milliseconds as the solenoid is energized, then turns back to green.

So wire the green LED between N0 and C. Since NO is connected to 12v and C is normally connected to GND, green will be on by default.
Then wire the red LED between NC and C. Since NC is connected to GND and C is connected to 12v only when the relay is activated, the LED will only turn on when it is activated.

However, since you are using the relay to drive a solenoid, you will probably also need a flyback diode in parallel with the solenoid to protect your LEDs from the inductive spikes of the solenoid coil.
https://en.wikipedia.org/wiki/Flyback_diode

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”