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
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.
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
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.
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.
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.
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...