I will be using Arduino Mega 2560 to control the signal system on a railway ride similar to the type found here in North America. The Mega board will be connected to 2 relay modules, a 4 channel and 8 channel. Here is how the relays are wired:
8 channel relay board - central light always on
Relays 1 and 2 (horizontal lights) - normally closed wiring
Relays 4 and 5 (diagonal lights) - normally open wiring
Relays 7 and 8 (vertical lights) - normally open wiring
A couple of questions about this wiring:
Would it be better to use a single 8 channel relay for both signals and common wire each pair of lights on the second signal to one relay?
The documentation for the relays is not specific as to whether they are activated by high or low input. Which do I send when doing a digitalWrite operation to close any relays that are normally open and also to open any that are normally closed?
Questioners know what their hardware and software looks like but the volunteers here do not; you need to fully explain what’s not working, and how it is supposed to work.
Please read all the posting guidelines before asking your questions; follow these guidelines in your post.
As always, show us a good schematic of your proposed circuit.
Show us good images of your ‘actual’ wiring.
Give WEB links to major components.
In the Arduino IDE, use CtrlT or CMDT to format your code, then copy the complete sketch.
Use the < CODE / > icon from the ‘posting menu’ to attach your copied sketch.
I only buy Arduino modules (including relays) from a manufacturer that has a website where I can download a data sheet that gives clear and concise specifications for all the parameters that I need to know. If there is a schematic, even better.
Otherwise you and everyone else are just guessing.
In programming you will many times find that you are down to a choice between two possibilities. In the absence of good documentation, the only recourse is to... experiment.
If your LEDs are shining when they are supposed to be off, flip the digitalWrite() you are feeding them. If your relays are energizing on the wrong HIGH or LOW, just feed them the opposite. If the ball is moving left on the screen when you add to the X position, maybe try subtracting to make it go the way you want.
And so forth.
Many ppl use
# define ENERGIZED HIGH
and say
digitalWrite(relayPin, ENERGIZED);
To close the relay contacts.
That makes changing all the relays' "sense" to be opposite a matter of a one line change.
# define ENERGIZED LOW // different relay module or wrong guess corrected!
Don't use HIGH and LOW for switches, LEDs or relays. Use defined constants, whichever way you choose, to have one place where the problems can be fixed.
Fixed if you were wrong, fixed if you change modules and need to, fixed if you decide to wire your pushbuttons the way everyone will tell you to instead of the stupid way you did.
I only deal with absolutes, minimums and maximums. That way I can guarantee that my designs will work all the time and every time within the specified operating conditions.
If I make guesses, even engineering guesses and the design fails, I loose money and the trust of my customers.
Call them experiments. Or testing. No engineer guesses, then sends something to the Moon, or wherever, to let the end used discover that the guess was wrong.
If you can claim you never fixed anything anywhere at anytime by changing a one to a zero, or the equivalent, I will move you to the top of the list of amazing practitioners.
I remember seeing ECO wires on a PCB for the first time… it was so disappointing to learn that imperfections can make it all the way into a school computer laboratory...
i'm working on a signaling system for a model RR, but presumably the signal lamps you mention are relatively high power (40W) and powered by AC line voltage (~110V) requiring commercial relays, probably 250VAC and several amps.
these commercial relays may be controlled using more common relays boards suited for Arduino, or possibly using a transistor array such as the uln2803a used with some stepper motors
without knowing the power requirements, it's not obvious whether a single commercial power relay can control 2 lamps in a position signal
it would be helpful to have more information on the signal lamps and the specific relays you mention