Wiring Arduinos together

Hello my friends,
I'm trying to connect some arduinos together with wires and There is a distance between them, so I can't use one wire protocol,
I want the Arduinos to send HIGH or LOW to make things happen
now when I'm trying to send LOW to do things I sometime gets falls read and get things happen not in time.

so what can I do to make it make it more stable?

Do I need to change the sending signal from LOW to HIGH and then only when voltage arrives and is HIGH will it perform the operation?

Do I need to add resistors or capacitors or diodes? And if so, how do I know which, where and in which direction? I have never used these components and have no idea what to do with them

Thanks in advance

How far apart are the Arduinos and which Arduindo boards are you using ?

1 Like
  • boards need to agree on what GND is
  • strong pull-ups can help with the distance up to a certain point
  • wires quality helps a lot to

I'm using mega, nano, uno...
the mega is the main one that gets and sends the signals from all of them
the cables are up to 10M

what do you mean on " * boards need to agree on what GND is"
what dose " * strong pull-ups" and what the distance?
I'm using lan wires

Hi, @yos102

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

Please no Fritzy cut and paste images.

Thanks.. Tom... :grinning: :+1: :coffee: :australia:

2 Likes

Is this means "10meters" ?
If so, you could use a variety of protocols to connect the arduinos - UART, CAN, RS485, radiomodules like NRF24, HC-12,

To transmit the state of the PIN I would recommend you a JDY-40 wireless module - it has a transparent mode to transmit a state up to 8 GPIO from transmitter to receiver:

Remember a voltage is a "potential difference" between two points. Circuits have a reference point (GND in most cases) which is seen as 0V and then 5V is defined against this reference point.

so if you just put a wire between an OUTPUT configured pin from the MEGA and connect that to an INPUT configured pin on the UNO 10 meters away, how would they agree on what the "0V" is ? ➜ GNDs need to be connected too...

the further away you are, the more attenuation there is in the signal and Lon wires could form an antenna catching electromagnetic noise. that's why there are solutions as @b707 said

pull-up resistors are used to ensure that the signal lines remain at logical high levels when they are not being actively driven low by the devices. These resistors are typically connected to the positive supply voltage (Vcc) of the system hence the name (pulls the voltage up to the upper rail voltage)

A "strong pull-up" configuration involves using lower resistance values for the resistors This results in a stronger current, ensuring faster rise times and better noise immunity in the communication lines.

like an Ethernet cable ?

may be you can look this up and associated concepts from basic electronics. It's documented all over the internet

1 Like


Thanks Tom

This is ruffly the bords, the mega is connected to other Arduinos also...

When the uno gets LOW on 7 the music starts.
When the switch is close or 8 is LOW the relay is set to LOW on pin 3.

I tried using pjon but the problem is the distance,

Because the mega is connected to other Arduinos and there is also electro magnets and stuff, there is a lot of jumps

After a short look I thinking about RS-485, what do you say?
it's chip, the wires are already there, only 3 wires between each "station".
the question is can I chose to which arduino to send what, like in pjon?

Firstly, take the circuit in post #9 and add a wire connecting the - of each Arduino power supply. That's what the first posts were suggesting.

If that doesn't work, (it may improve but not cure the problem), then yes, RS485 is one solution that will work. For that, you will need a converter for each Arduino, and there's more to it than that, which we can discuss here once you've decided you want to go this way.

First, try the ground.

2 Likes

when you say:

you mean this:
image

What was the result of connecting the grounds?

for now it's looking good, I need to see with the other Arduinos that connected to the mega.
but if not, what i send before will help?

Yes, that's the RS485 interface I use. You'll need more coaching, but you'll have to have those in hand before long. One for each arduino that must talk serial with the others.

However, I still think 10m isn't out of the question for hardwired signals between Arduinos, with a little bit of care; it depends a lot on how you handle the signals in your software, though, as well as your wiring approach. Up to you.

1 Like

I did it the easy way I used CAN. That is a differential bus so grounds can be offset up to the common mode voltage. Only a two wire (you can run ground if you want) bus is required between each node. I do this all the time with the basic $2.5 Nano from china. Additional cost per node (MPC2525 module) less then a buck. Shipping varies a lot. It is extremely reliable.

I'm sorry but I didn't understand anything you said, could you explain more please? :face_with_peeking_eye:

Rather then write another book try this link and the additional ones it will point to. After a few hours you will understand what I said. Concentrate on the physical layer. https://www.allaboutcircuits.com/technical-articles/introduction-to-can-controller-area-network/

The link seems missing...

If your current pulup is 10k or internal pullup, I would recommend 470 Ohm instead...
Costs nothing and may do the trick.
Also shielded cables may help... audio cable should work...
Far cheaper and easier than rs or can bus.
Add a 100nF capacitor on both sender and receiver side...

1 Like