Well, this is my problem, there's a signal coming from a central server which is RTU RS485 protocol (I'm 100% sure about that), I'd like to traduce that signal into ASCII characters after pass through a MAX 485 and the Arduino and present them in the serial monitor of the computer.
I'm also sure that the central server is sending only numbers. So basically I'd like to communicate the server with an slave arduino.
I don't have any preliminary code (for people who ask) and I'm very new in this topic of communicating micro-controllers
Has someone worked in this kind of project? Do you suggest an specific library? Someone has a example code for my problem.
I wonder if the examples in Serial Input Basics would be useful. Simple reliable ways to receive data.
I think you will smile when you look up "traduce" in your dictionary. Maybe you mean "translate" - but I would be surprised if the data is not already in ASCII characters.
Actually it was my fault, sorry for that ; I wanna work with an Arduino MEGA but I was just testing with UNO to feel familiar with the code.
I had some questions for you please, hope you don't get bored because I'm very new in this topic.
The controllers that I want to replace (with arduinos) show in a label that they receive RS485 signals as inputs, and those signals come from the server of the BMS (Building Management System) and coming through a CAT 6 UTP 4 cable; in the controllers, only 2 (green and white) of the six wires of the big CAT 6 cable enter inside the controller (see photo), so that makes me think that they are the signal A and B of the RS485 protocol (differential voltage).
So I'd like to use an arduino MEGA and supposedly a MAX 485 in order to determine what characters are coming to the controller when I send commands from the BMS.
I'm not sure how to connect the MAX 485 with MEGA or if I should use two different serial ports or bauds.
As I described before, in this case the MEGA would be a slave and the master would be the computer and the server as well, but I'm a little confused how can I read and then write the character that is coming to the Arduino Mega and finally show that character in the serial monitor of my PC; in other words, it will be like sending characters from one pc to other but with different software and I'm pretty sure that the information in this case are only numbers, but not totally.
What is the necessity of reading those values? Because they will be used as inputs for the Arduino MEGA to control DC motors, but that part it's piece of cake (I think).
What library would you recommend? Or what would be the right way to connect the Arduino with MAX 485?
What is the device on the right of the breadboard in the picture in Reply #4. I'm guessing that converts RS485 to TTL. Please post a link to its datasheet.
I suspect that the link I already gave you will be sufficient - but I need to read the datasheet. RS485 is just an electrical specification to provide reliable transmission.
It would also be very useful to see the specification for the data provided by the BMS.
Thank you TomGeorge for the idea, I'll consider it.
Robin2, sorry for the late answer, I had to travel over the weekend.
Well, you are correct (I think) it's a converter to TTL.
As for your other requirement (BMS) I don't have that information. But I can try to find it for you, if you really require that.
I've attached the required datasheet.
Let me know if you have some ideas for this project.