I have a big ptoblem. I accidentaly ordered a wind directoin sernsor whitch uses a rs485 communication not the 0-5v one. If i found it uses rs485 communication then i ordered thath arduino rs485 module aswell (Nettigo: MAX485 UART TTL RS485 converter [Yā nǔ shén]) but i cant figure out the code to read the data to the rs485 module.
Is there anyone here who can help me with this problem? I need some kinda code or something becouse i cant find some solutions from nowhere. And unlucky i'm bad making arduino codes myself!
Start by googling "RS485 arduino library" and you will get may hits. Use one of those libraries and the examples that come with it to talk to your sensor
MODBUS is a serial protocol. You will need to use the software serial library if you are using a UNO since there is only one hardware serial port and you want to use that for debugging.
The pins you select for your SoftwareSerial port will be wired to your uart-485 board which will be wired to your sensor. You should then be able to communicate with it if everything is wired up properly include power and ground.
After that you will need to know the communications protocol (data format and/or command structure) of the anemometer itself. Did it come with any documentation about that?
aarg:
After that you will need to know the communications protocol (data format and/or command structure) of the anemometer itself. Did it come with any documentation about that?