I have an ultrasonic sensor, HC SR04, connected to the atmega 8 controller along with an LED for the indication purpose. Let me discribe about my project with some anology. Say I have 20 rooms( height is 250cm )and in each room, I fixed one ultrasonic sensor module ( atmega+sensor+led ) on the roof. Atmega 8 is programmed such that if the detected height is: 1. Between 40cm to 150 cm, change the led colour to the red 2 between 210 to 250 cm , change the led colour to the green 3 in between 150 to 210.... Do nothing..
And all the sensors fixed in each room, are connected with each other using max491 ic and ethernet cable. In detail, all the tx pins are connected to one line and all Rx pins are connected to the other line. And there is a small 50 ohm resistor soldered between the ab line and yz line of the max ic for the impedance matching purpose in each sensor. Each module is having it's own power supply of 5V.
But the problem is, when one sensor in one room detects the height around 150 cm or 210 cm, the other sensors in other rooms are changing their led colour to red and show the same as the first one.. Similarly, if any sensor detects the height around above value, next or all other sensors also changing their colour though they are not detecting any object. Why other sensors are getting locked to each other at that particular height?
Here is the topology am using.. Note that therapy is a 120 ohm termination resistor at the input of all the atmega 8 sensors ( across Tx and ground one resistor and Rx and ground other resistor) . Is that causing any issue? Why all the other sensors behaving similar to the one which is actually triggered and show the same height?
Schematic by @Transistor for OP to edit. [Delete this comment when done.]
Figure 2. Suggested wiring layout.
Edit below and provide additional details.
- I am / am not using RS485 protocol.
- Each node has its own power supply. / Each node is powered over the cable with +5 V and a common GND.
- The data cable screen is / is not connected to GND at each node.