Relay Board and Leds

Hello Group,

I have an 8 channel relay board, an arduino, and momentary pushbuttons. The pushbuttons and relay board is connected to the arduino and I would like to add indicator lights when the pushbutton is activated. The push buttons are connected to the arduino nano board and the nano board is connected to the relay board. I know I can program the LEDS to be lit each time the push button is pressed and released via software. However I would like to save on digital pins. The relay is activated and then shut off as the relay is controlling the solenoid and cannot be on as it will burn up the solenoid. Am I able to connect the LEDS to the relay and they stay lit some how? If you have a schematic or a picture of what I am trying to accomplish that would be a great help. Thanks in advance! - Scott

What kind of voltage is the relays switching?

If something like 24V or less, just use the relay to power the LED with a fitting series resistor to limit current.

If you are low on I/O, look into port expanders. Another option is to use a 3-to-8 decoder chip like the 74LS238 that will give you 8 output wires with tree in. This requires that only one of your relays is active at a time though.

If you need an arbitary number of relays to be on at same time, look into port expanders. There is old 8-bit types like the PCF8475 and newer 16-bit ones like the MCP23017

// Per.

The current is 12 volt....the two wires from the solenoid is connected to the center screw on the each relay....the NC (left screw connection) is connected to the - of the 12v supply and the NO (right screw connection) is connected to the + 12v supply. Which connector would the LEDS be connected to and would they be on when the relay is on then off after about 1000ms?

No, the voltage is 12V. Current is measured in Amps.

Why do you have both positive and negative supply connected on the relay? It makes no sense.

You want to have the LED on whenever the solenoid is activated, right?

Could you show a simple schematic of your circuit. A simple scribble on a napkin is better than a Fritzing-"schematic"

// Per.

There something called a [u]one-shot[/u] (AKA a mono-stable multivibrator.)

Or, you can "expand" the number of digital outputs with a [u]shift register[/u].

@Zapro - attached is the schematic.

@DVDoug - I will have to look into that. Shift registers I’ve used before. If i can get them to work on the relay no need.


What is a 'turnout'?

Do you need to reverse polarity on it?

How much current (Amps) does the 'turnout' take when powered?

// Per.

The turnout is a model railroad switch controlled by a solenoid...less than an amp...the relays are used to reverse polarity....the leds are signals red and green showing turnout indication.

Hmm, less than an amp - more like 600mA maybe?

I think i got it now. Signal light switches from permanent red to green or vice versa, while the solenoid gets a short pulse to switch the mechanics over. right?

// Per.

You are correct :slight_smile:

OK. Then you should look into using H-bridge chips to drive the solenoids.

More specifically, L293D. They are dirt cheap and will do exactly what you want.

The timing thingy could be done with some analog electronics, but it sounds like you want to use an Arduino for this, which is fine.

If you are low on I/O, use a shift register or put the buttons in a matrix.

How many buttons and solenoids are you planning to connect?

// Per.

I am using an 8 bank relay and currently controls a total of 8 turnouts just fine using 4 momentary pushbuttons...again works fine....I am using a Nano board...using shift registers is not a problem I've used several already with an Uno board. I plan on using a total of 6 drawf signals which has 1 green and 1 red led. I was just trying to see if I could connect the LEDS to the relays somehow to simplify things. The L293d motor chips I have several already....burned 2 trying to accomplish the same task and one of the reasons why I switched over to using the relay boards

If your solenoids do not draw more than 600mA and that even in short pulses, if you fried your L293D, you did something very wrong.

Anyhow, look into using a capacitor in series with your controlling signal to the relay board.

This will allow a short pulse to pass until the cap charge up, and the relay will shut off again. You might need to add a resistor across the relay input to “load” down the output of the RC-filter.

// Per.