Go Down

Topic: Different arduinos getting input from the same relay (Read 1 time) previous topic - next topic

petronel

I want 4 arduinos to get an input from the same relay (standard mechanical relay). Using 4x relays is not an option so would this work?

AWOL

I want 4 arduinos to get an input from the same relay (standard mechanical relay). Using 4x relays is not an option so would this work?
More details.please

petronel

Arduino Mega acting as a kind of central system reading inputs from and sending outputs (via relays) to multiple Arduino Uno's. The 4 Uno's that receive the inputs control sound and light and they need to be synchronized to each other, so they receive the same inputs to change tracks/lights.

Delta_G

Why the relays?  What is their purpose?  How are they connected?  Shit dude, there's a TON of detail you're not giving us.  Please try to understand that we can't see your project or anything you've got.  You've got to give us something to go on. 
|| | ||| | || | ||  ~Woodstock

Please do not PM with technical questions or comments.  Keep Arduino stuff out on the boards where it belongs.

CrossRoads

#4
May 22, 2017, 12:02 am Last Edit: May 22, 2017, 12:03 am by CrossRoads
Isn't the setup just this simple?
Mega driving a relay, Uno with input & internal pullup resistor?

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

petronel

Why the relays?  What is their purpose?  How are they connected?  Shit dude, there's a TON of detail you're not giving us.  Please try to understand that we can't see your project or anything you've got.  You've got to give us something to go on. 

Relays are for sending a signal from Mega to the Uno's. Is there another reliable way of doing this?

Mega Output --> Relay --> Uno Input (Input_Pullup and GND connected to NO and COM)

There are multiple audio/light tracks, each relay corresponds to one track, Relay1 for Track1, Relay2 for Track2 and so on. When Track2 starts, the Mega will close Relay2, the 4 Uno's will all read the input from Relay2 and start Track2 at the same time.


Delta_G

Yeah, you could just run a wire from one of the outputs on the mega to one of the inputs on the UNO.  Just make sure you don't ever configure that pin on the UNO as an output and try to write it opposite the state on the mega.  Connect the grounds between the two and no relays are needed. 
|| | ||| | || | ||  ~Woodstock

Please do not PM with technical questions or comments.  Keep Arduino stuff out on the boards where it belongs.

PaulRB

Quote
Just make sure you don't ever configure that pin on the UNO as an output and try to write it opposite the state on the mega.
A small resistor (eg. 220R) will protect the pins from that mistake.

I agree the relays serve no purpose in this circuit.

petronel

Do i use input_pullup without the relays? Will it be reliable over 10m distance? And no problem connecting the GND and inputs of 4 arduinos together?

PaulRB

INPUT_PULLUP should not be necessary. Reliability should be ok over 10m. Yes, you must connect the grounds. (That would also have been true for relays).

petronel

Thanks everyone, i tested without relays and seems to be working fine.

petronel

Not working so fine actually. 2 of them have short wires and 2 have 10m wires (UTP cable). If i connect only the short ones it works fine but when i connect the long ones it's total chaos, all 4 of them receive random inputs.
Is there any solution to avoid these interferences?

PaulRB

What voltage do you measure at the end of the 10m wire when the Arduino output is high?

Go Up