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?

enter image description here

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


simulate this circuit – Schematic created using CircuitLab

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.
  • \$\begingroup\$ how do you know that the sensors are getting locked to each other? .... how do you know that the Atmega is not turning on the wrong LEDs? \$\endgroup\$ – jsotola Mar 24 '18 at 18:59
  • 1
    \$\begingroup\$ it is impossible to answer your question because you have not provided any information that can be used to formulate an answer. .... you need to post a schematic and the program code. \$\endgroup\$ – jsotola Mar 24 '18 at 19:02
  • \$\begingroup\$ @T: You should add links to the datasheets for each device so that we all don't have to search for them. \$\endgroup\$ – Transistor Mar 24 '18 at 20:07
  • \$\begingroup\$ Hi all, thanks for your prompt response..well..here are the links to the data sheets.... my max491 ic and it's topology... www.maximintegrated.com/en/products/interface/transceivers/MAX491.html and my ultrasonic sensor.... google.co.in/url?sa=t&source=web&rct=j&url=http://… \$\endgroup\$ – T Obulesu Mar 24 '18 at 20:38
  • \$\begingroup\$ Am using the term' locked 'because all the other sensors are showing me the same height though they are not detecting anything.. and I checked the voltage at the RGB pins of the led.. which is fine... \$\endgroup\$ – T Obulesu Mar 24 '18 at 20:45

Your post doesn't make it clear, but the MAX491 is designed as an RS485/RS422 transceiver. I assume you are trying to make an RS485 network.

enter image description here

Figure 1. Recommened RS485 network. Source: MAX491.

Note that

  • A four wire network is used.
  • The termination resistors appear on the ends of the network only and not on the units tapped off along the network.
  • The resistors go between the data lines and not to ground.
  • The resistors are 120 Ω and not 50 Ω.

Your ASCII schematic does not contain enough information to let us help you further. There is a schematic button on the editor toolbar which you can use to draw a proper schematic. You need to show power and grounds too.

  • \$\begingroup\$ In the figure u have attached, the 120 ohm resistor is connected to the first and last nodes. What happens if all the nodes are having the 120 E resistor across AB and YZ lines similar to the first n Last nodes? \$\endgroup\$ – T Obulesu Mar 25 '18 at 11:44
  • 1
    \$\begingroup\$ You will probably overload the drivers and the differential voltage won't be high enough for correct data transmission. You need to provide a proper schematic for the master and one of the outstations. You also need to show a proper connection diagram. You can use the "custom component" in the CircuitLab schematic editor to create special symbols. Double-click to edit parameters. \$\endgroup\$ – Transistor Mar 25 '18 at 12:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.