4
\$\begingroup\$

I have designed a custom PCB that incorporates a circuit for an RS485 to TTL converter. Previously, I successfully used a module (https://protosupplies.com/product/scm-ttl-to-rs-485-interface-module/) based on this design to communicate with an energy meter using an Arduino. To integrate RS485 capability into my custom PCB, I cloned the schematic provided on the website. However, upon interfacing it with the Arduino, I am encountering issues where it does not read any data from the energy meter. Could anyone offer assistance with troubleshooting this problem?

screenshot of schematic enter image description here

\$\endgroup\$
18
  • 2
    \$\begingroup\$ Hello and welcome ... could you edit to add what IC4 is? \$\endgroup\$
    – jonathanjo
    Commented Jul 8 at 10:50
  • \$\begingroup\$ Is your MCU using 3.3V or 5V supplies, if this board uses 3.3V supply? Why did you copy auto-output-enable feature when you could have used MCU pin for enable, and it would have been much better and simpler? Why did you pull up the B output as it is supposed to idle low, and same question for A which should idle high but is pulled low? Also you seem to be assuming RS-485 can work with only 2 data wires, but in reality, you need all devices to share a ground reference. So if you e.g. power your board from a battery or 2-prong wall wart, it does not have a ground reference with any other device. \$\endgroup\$
    – Justme
    Commented Jul 8 at 10:56
  • 1
    \$\begingroup\$ @priya Add the 74HC14 info to the question. Also you copied the original schematics wrong, MAX3485 A pin is B- wire and B pin is A+ wire. The original schematics also has the error with the bias pull resistors, so the original schematic may be incorrect too. In idle state, MAX3485 A pin is high. Yes, some chip manufacturers use opposite notation to the actual standard. \$\endgroup\$
    – Justme
    Commented Jul 8 at 11:07
  • 1
    \$\begingroup\$ @priya By swapping the wires when you connect them to your board? And modifying the bias resistors or simply removing them and maybe applying external bias on the cable wires if you need it. But it does not solve the other issues, which may be present and unknown because you did not provide the asked info. \$\endgroup\$
    – Justme
    Commented Jul 8 at 11:12
  • 2
    \$\begingroup\$ @priya Yes just like I suspected - and you never told the setup and answered the other questions that could be used to solve why it does not work. Do you have a ground between devices? Is it a MCU with 3.3V IO or 5V IO? Which MCU? Can you post the rest of the schematics? \$\endgroup\$
    – Justme
    Commented Jul 8 at 11:25

2 Answers 2

5
\$\begingroup\$

The original schematics you used are technically wrong and you also copied it wrong.

Pin A on MAX3485 is wire B- like in the original schematics you used. So that's the copy error. Just swap wires when attaching to bus so that bus wires go correctly to MAX chip pins regardless of the pin/wire names.

But the Pin A on MAX3485 is the pin that should be pulled up because it is the non-inverting/positive pin. This is the error in the schematics you used as a base. It is unknown if the schematics have an error and the PCB really has it pulled up so the schematics don't match with the PCB you bought. Try measuring what you get between the pins so whih is pulled up and down in real life.

Also RS-485 needs ground reference between devices, you can't simply connect 2 wires only and expect it to work - but sometimes it will work if devices already share a ground reference, for example via mains plug earth wire.

The whole transmit auto-enable circuit could be replaced by letting the MCU to control it. You don't know the enable timing and will it cause problems with your protocol. If the other device starts sending a response while the auto-enable circuit still keeps transmitter on, you are going to have a collision and will not receive a response.

\$\endgroup\$
2
\$\begingroup\$

It appears there this design has a number of issues.

By comparing your diagram with the original, it's clear a number of things:

  • Although RS-485 has signals called A and B they are not necessarily the same as the A and B pins on a 75176-pinout RS-485 driver (for essentially silly historical reasons they are often swapped.) It appears you have them incorrect on your diagram presumably you thought it was a mistake in the diagram you're following.
  • Don't forget you must have a signal ground of some kind for RS485.
  • The junction of U13 and U9 is surely supposed to be connected to U11.B? (Otherwise U13 and U9 are just in parallel with U14). The same error appears in the diagram you copied from. (Thanks @vini_i)
  • See also Justme's excellent answer for things I missed
  • Bad circuits and bad diagrams are not good role models!

I strongly recommend reading Bob Perrrin's indispensible Art and Science of RS-485, especially the portions about grounding.

enter image description here
From OP (L) and supplier (R)

\$\endgroup\$
1
  • \$\begingroup\$ There is yet another mistake in the schematic. Much less critical. The dot between the top two TVS diodes and A+ is missing. In the pictured configuration only B- is protected by the diodes. In reality there should be a TVS from each line to ground and one in between. \$\endgroup\$
    – vini_i
    Commented Jul 8 at 12:04

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