1637 Views - Created 18/04/2018
I bought this RS485 hat from your store, I’ve been trying to use it with a water level sensor, and so for I have had no luck.
I configured raspberry pi according to the instructions, switched Bluetooth to mini-uart disabled all console references in boot line... but I keep getting no response from sensor.
Could you please advise a way to test the hat? any help would be most appreciated.
It is difficult to test the hat directly without another RS485 device to communicate with. You can test the UART port on your Raspberry Pi by connecting the GPIO14 (TXD) and GPIO15 (RXD) pins together on the Raspberry Pi GPIO header without the RS485 Pi connected and use a program like minicom to send data out on the ttyAMA0 port. With the TX and RX connected together you will get a loop back into the Raspberry Pi so anything typed into minicom should be echoed on the screen as it is received on the RX pin.
Another way to test the UART port if you have two Raspberry Pis would be to connect the TX on one Pi to the RX on another and try sending data between the two Pis. You will also need to connect the ground pins together for this to work.
Once you know the UART port is sending and receiving data you can narrow down the problem to either the RS285 Pi or the water level sensor.
Do you have a link to the water level sensor so I can find the datasheet for it and check that it is compatible with the RS485 Pi?
Thanks for your reply.
I have a second pi, and will test out what you said.
Regarding the sensor, you can find it on this website
Just an update, tested with two pi's, using minicom and they can communicate with each other.
If the Raspberry Pis are communicating then that suggests it is a communication problem with the sensor. Looking through the information about the sensor on the page you linked, it looks like it should be able to communicate with the RS485 Pi so the first thing I would suggest is to make sure the connection between A and B pins and the ground on the sensor has a good connection with the RS485 Pi and check the GPIO header on the RS485 Pi to make sure there are no bridges or dry joints. We test each RS485 Pi before packaging so hopefully, there shouldn't be a fault with the board.
Also, check that you fitted the supplied 120R terminator resistor as without that you could get reflections on the data bus that could stop it from working correctly. You may need to add a 120R resistor between the A and B pins at the sensor end of the cable as well. The datasheet for the sensor should say if this is already included inside the sensor or if it needs an external resistor when it is on the end of the data bus.
If the hardware all looks good then it is most likely a software problem with the communication between the Raspberry Pi and the sensor. It may be worth contacting the sensor manufacturer to check if they have any tips on communicating with their hardware or if there are any software libraries available you could use.
Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view, download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.