MKR 485 is place on top of MKR NB 1500 (with SIM and antenna). The switches on the MKR485
shield is set to (OFF, OFF, ON) as pictured above. The sensor is powered by a separate 12 V power supply and the arduino (MKR 1500) is powered by a 5V micro usb. The program i have sends requests to the sensor through ModbusRTU, processes the return and sends it through MQTT.
This works perfectly, but it requires two power supplies (5v and 12v). I read through the documentation and the MKR 485 shield has a Buk converter that takes 3-24v and downsteps it to the required voltage of the arduino.
The setup I am looking for should be something like below. (Setup 2)
This does not work. Both the Arduino and the Sensor gets power. The arduino is able to send data (default values i have set) and the sensor's wipers works. The arduino just doesn't seem to communicate with the sensor via ModbusRTU.
I even just to test gave each a separate 12v supply as shown below (Setup 3)
One thing I noticed was that the voltage between GND and VCC of the MKR485 shield was 0 in setup 2 and setup 3, but ~5V in setup 1. It looks like the Modbus connectors on the right are disconnected when power is supplied to the Buk converter VIN.
I'd use the VCC and GND connectors for powering the Arduino in setup 2. GNDs always should be connected. Check the manual for the correct switch settings.
The issue is, the arduino (mkr 1500) already gets power in setup 2 and 3 (as well as the sensor). The shield (mkr485) is placed on top of the arduino (mkr 1500). Not sure where I am supposed to lead the GND marked above in this case.
Also, you mention a manual, but I am having problems finding one for the mkr485. The only thing I found is the docs page (https://docs.arduino.cc/hardware/mkr-485-shield) and a one page pdf with even less information.
By electric module you mean the arduino/shield (1) and the sensor (2)? Unsure how to give those two a common ground. I then also struggle to see how setup 1 gives both a common ground as they run on different power sources.
I apologize if I am a bit slow in understanding this...
So what stops you from connecting that GND wire to the other GNDs?
You missed to mention that A,B are related to a RS-485 connection. Such a differential bus may or may not work in floating state without an additional GND connection.
That's not a well defined term - applies to Modbus?
If you already connect the sensor A,B wires to the connector block, why not connect the GND wire there as well? Power supplies '-' do not provide reliable logic ground levels (GND) due to the currents flowing over these wires. So the GND pin of the header deserves no additional connection to a power supply '-'.
If the sensor has a common power "-" and logic GND then connect it to both another logic GND and the PSU. Otherwise keep power wires separate from logic GNDs.
The schematic for the shield is at the bottom of the MKR485 documentation page, available in the link you posted back in post #5. Here it is as an image:
There's a bit of information in the quickstart guide, but simply telling the user to set the switches a certain way without explaining what they do isn't very helpful.
Switch 1 enables/disables the 120R terminating resistor on the A-B signals, and switch 3 enables/disables the 120R terminating resistor on the Y-Z signals. Switch 2 sets either half or full duplex mode. In half duplex mode you use just the Y-Z signals.
Dear lord, how did i miss that...
I saw the MAXIM MAX3157 and TPS54232 datasheets, but didn't help much without the full schematic. I am not to experienced reading these, but i will make another attempt tomorrow.
I do think the switches are correct, but not to sure.
So turns out I wasn't crazy, there is something with the MKR NB 1500 that works different that causes the failure.
So I tried connecting the sensor and arduino to a common ground (like @DrDiettrich suggested) as follows
But didn't work.
Then out of desperation I switched out the arduino (MKR NB 1500) with a MKR WIFI 1010 and it worked!!!
Just to be sure the MKR NB 1500 I had wasn't broken I tried another MKR NB 1500 I had and that also failed.
The Setup does work when I connect the microUSB port to a 5V supply (in addition to the 12V). Just not sure why. Any ideas @DrDiettrich@markd833 .
Right, small update. I did some voltage monitoring on the two boards on the VCC, VIN and 5V pin and got some interesting results.
MKR WiFi 1010
VCC = 3.3V
VIN = 5.1V
5V pin = 4.5V
MKR NB 1500
VCC = 3.5V
VIN = 5.1V
5V pin = 2.4V
There is a significant voltage drop on the 5V pin on the MKR NB 1500. I think this is what is used to supply the MAX3157 chip and is probably to low for it to function.
I have written a support ticket. Hopefully I will get a solution to this.