One Arduino multiple sensors RS485

Hey everybody,

I have 5 flowmeter, which work with RS485 protocol and want to connect them to one Arduino Mega 2560 (as one master with multiple slaves , if that’s possible with SoftwareSerial library) using the MAX485 chip so what should I do to read the values out of them , or at least to choose one of them to be read out?
How many max485 chips do I need?
Does anybody know the library we need for to recognize these sensors and address them?

TAHNKS IN ADVANCE

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html.

Have you googled.. arduino rs485 sensors

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Tom... :slight_smile:

Why do you want to use the SoftSerial Library with a MEGA 2560? Wouldn't it just be easier to use the other hardware serial ports available on that Arduino?

How many max485 chips do I need?

One on the Arduino and one on each sensor.
You will also need and Arduino or equivalent on each sensor so you can communicate between the sensor and MAX485 chip. You can not wire a sensor directly to the MAX485 chip.

What sensor do you have? Your answer will affect what is good advice for you and what is just guesswork.

Grumpy_Mike:
One on the Arduino and one on each sensor.
You will also need and Arduino or equivalent on each sensor so you can communicate between the sensor and MAX485 chip. You can not wire a sensor directly to the MAX485 chip.

What sensor do you have? Your answer will affect what is good advice for you and what is just guesswork.

The OP implies the sensors are RS-485 already. There may not be the needs for more arduinos. But we have to wait for him to return.

Sorry for the late replies ,but I was working on something else

adwsystems:
Why do you want to use the SoftSerial Library with a MEGA 2560? Wouldn't it just be easier to use the other hardware serial ports available on that Arduino?

thank you for the question, Because I intend to connect more than 4-5 sensors to the Mega ,which has already serial ports from TX0/RX0 to TX3/RX3
and my idea was to use more software serial ports and to let the hardware one free as possible , so I can connect this hardware port to the PC (the master ) in order not to use more than one arduino board to make the cost lower
honestly I don't know if that In principle works

TomGeorge:
Have you googled.. arduino rs485 sensors

Building a wired RS485 sensor network | MySensors - Create your own Connected Home Experience

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Tom... :slight_smile:

Hey and thanks for your advices , actually yes I have searched a lot but my idea to do it without using more than one arduino ( as a master ) , which would be connected to the PC in order to make the costs lower
so the question was if this design would work and if yes which arduino library should i use or that's depend ont type of the sensor ??
you can take a look in the attachments

Grumpy_Mike:
One on the Arduino and one on each sensor.
You will also need and Arduino or equivalent on each sensor so you can communicate between the sensor and MAX485 chip. You can not wire a sensor directly to the MAX485 chip.

What sensor do you have? Your answer will affect what is good advice for you and what is just guesswork.

thanks Grumpy_Mike , actually I am using sensors made by the company I working for , they are pressure/airflow sensors with RS485 interface and 4-20 mA
we calibrate the sensors on the PC , so the idea of my project is to be able to chose a sensor to be calibrated , the process of choosing and switching between the sensors should be by means of arduino
in the past we did it with BUS but the boss does not want that any more

my question to you why i can't wire the chip MAX485 directly to the sensor ? and why i need arduino for each sensor

Hi,
I think you imagine that you need a separate UART for each sensor.

The reason for RS485 is its ability to have a main comms bus with master at the end and your sensors ALL connected to the comms bus.
Each sensor has a unique address and you only need one UART port.

Tom... :slight_smile:

Hi,
Just posted previous post as you uploaded yours.

The difference between using more than one slave on the comms bus and separate comms buses is purely academic, you are still going to get the same outputs.

A single Mega and use its multiple UARTS , one for each separate bus should work.

Tom... :slight_smile:

TomGeorge:
Hi,
Just posted previous post as you uploaded yours.

The difference between using more than one slave on the comms bus and separate comms buses is purely academic, you are still going to get the same outputs.

A single Mega and use its multiple UARTS , one for each separate bus should work.

Tom... :slight_smile:

thanks TomGeorge , but which library should be able to switch between the serial ports and what about the data form the sensors ( the calibration data ) they would be sent over a serial port, which will be taken by the arduino ?? THANK YOU FOR YOUR HELP