Thread Starter

levi_ackerman

Joined Mar 25, 2023
23
I’m developing a Modbus RTU architecture. The master of this architecture is my Beagebone Black , which I want to connect via RS-485 serial communication to my sensors. Since I’m using RS-485 converters (RS-485 Converter) which need a UART input as far as I understand, I was looking for sensors capable of taking environmental data, or even motion sensors or whatever, in order to connect them directly to my converters to “simulate” a Modbus communication.

Do you know any UART compatible sensors that I can use?? Some links to the products would help me.
 

Papabravo

Joined Feb 24, 2006
20,394
Seems to me that a UART would be the very last choice for manufacturers to add connectivity to their sensors. There are many industrial networking choices with better properties and performance. If you want to continue on this path, I suggest you get the sensors and roll your own connectivity solution.
 

Thread Starter

levi_ackerman

Joined Mar 25, 2023
23
Seems to me that a UART would be the very last choice for manufacturers to add connectivity to their sensors. There are many industrial networking choices with better properties and performance. If you want to continue on this path, I suggest you get the sensors and roll your own connectivity solution.


I necessarily have to use UART as I only have the converters I provided in the link.
I'll explain my situation: I'm developing a system for a university project and so I'm just simulating everything. I show you the pattern I defined on my bread board and my beaglebone black.

If there were low cost UART sensors I could connect them to rs-485 converters and simulate serial Modbus RTU communication, otherwise I'd be forced to buy other converters.
 

Attachments

Papabravo

Joined Feb 24, 2006
20,394
I'm sorry but the world not conforming to your expectations is a problem for you to solve. I may be full of it and maybe UART communications will see a resurgence. I was in the industrial control and communications business for over 30 years before I retired. There is a reason why mainline PC's dropped the serial interface more than two decades ago. You might want to update your thinking if you want to use items that are readily available.
 

nsaspook

Joined Aug 27, 2009
11,777
I necessarily have to use UART as I only have the converters I provided in the link.
I'll explain my situation: I'm developing a system for a university project and so I'm just simulating everything. I show you the pattern I defined on my bread board and my beaglebone black.

If there were low cost UART sensors I could connect them to rs-485 converters and simulate serial Modbus RTU communication, otherwise I'd be forced to buy other converters.
You could build a Modbus converter using a simple controller to handle the MOSBUS protocol and the serial sensor interfaces. There are lots of chip level devices that have several interfaces (TTL serial, SPI, I2C, etc...) for board level communications to a onboard uC host controller.
 
Last edited:

schmitt trigger

Joined Jul 12, 2010
700
Exactly what NSASPOOK says.
You will have to use a dedicated microcontroller to convert from the sensor’s output (I2C, analog, SPI, 1-wire, LINC) which will handle all the handshaking and making the sensor’s register reads/writes, and using its TX, RX outputs interface with the RS485 bus interface.
 

nsaspook

Joined Aug 27, 2009
11,777

Thread Starter

levi_ackerman

Joined Mar 25, 2023
23
Hello everyone and thanks for the replies.

I try to answer everyone to explain my problem in the best possible way and get advice from those more experienced than me.

Being still a student I am not so familiar with this world.
Given this, I have UART to RS-485 converters, sensors (DHT11 and others) and an RS-485 Hub.
Can I simulate a Modbus RTU architecture with my bread board and my BeagleBone Black in a very basic way?
This is why I was asking for UART sensors to be able to use them with the converters I mentioned.

Am I on the right track? Advice in particular?
Does this seem feasible to you?
 

nsaspook

Joined Aug 27, 2009
11,777

I try to answer everyone to explain my problem in the best possible way and get advice from those more experienced than me.

Being still a student I am not so familiar with this world.
Given this, I have UART to RS-485 converters, sensors (DHT11 and others) and an RS-485 Hub.

This is why I was asking for UART sensors to be able to use them with the converters I mentioned.

Am I on the right track? Advice in particular?
Does this seem feasible to you?
Look, you can simulate anything you desire but those types of sensors in the real world will require something like a protocol converter (like a Arduino) from one-wire to MODBUS.
https://www.electronicwings.com/sensors-modules/dht11
 

Thread Starter

levi_ackerman

Joined Mar 25, 2023
23
Look, you can simulate anything you desire but those types of sensors in the real world will require something like a protocol converter (like a Arduino) from one-wire to MODBUS.
https://www.electronicwings.com/sensors-modules/dht11
Leaving aside sensors such as the DHT11 One-Wire, can I integrate the rest of the sensors (which perhaps have other types of communication) with the RS-485 serial communication with the converters I have shown and manage the Modbus logic?
 

nsaspook

Joined Aug 27, 2009
11,777
Leaving aside sensors such as the DHT11 One-Wire, can I integrate the rest of the sensors (which perhaps have other types of communication) with the RS-485 serial communication with the converters I have shown and manage the Modbus logic?
You need to be very precise and specific with your questions and provide very precise and specific information about each and every sensor. RS-485 serial communication is ONLY an electrical interface.
https://en.wikipedia.org/wiki/RS-485#:~:text=RS-485 does not define,not specified by RS-485.

Modbus logic is a separate thing that might use RS-485 serial communication.


My 2c. Take the time to actually read and study about sensor interfacing.
 

Ian0

Joined Aug 7, 2020
8,400
MODBUS is a relatively easy protocol to implement - it can be done with an 8-bit microcontroller without too much trouble, provided that it has a UART. The only extra hardware needed is a SN75176 or equivalent RS485 line transceiver.
https://modbus.org/docs/Modbus_Application_Protocol_V1_1b.pdf
Each sensor has to respond to a request for data, and has to return a 16-bit number.
Think yourself lucky you didn't choose BACNET.
 

MrChips

Joined Oct 2, 2009
29,236
If it is MODBUS you are seeking, click on the ModBus option under Interface on the Sensirion site.

If you are willing to do some programming on an MCU, you can implement MODBUS over RS485 using any kind of device interface, UART, SPI, I2C, One-wire, raw analog, etc.
 

nsaspook

Joined Aug 27, 2009
11,777
MODBUS is a relatively easy protocol to implement - it can be done with an 8-bit microcontroller without too much trouble, provided that it has a UART. The only extra hardware needed is a SN75176 or equivalent RS485 line transceiver.
https://modbus.org/docs/Modbus_Application_Protocol_V1_1b.pdf
Each sensor has to respond to a request for data, and has to return a 16-bit number.
Think yourself lucky you didn't choose BACNET.
Agree, simple.
https://forum.allaboutcircuits.com/...c-controlled-battery-array.32879/post-1485546
https://github.com/nsaspook/ihc_mon/blob/re20a/ibsmon.c
 
Last edited:

Thread Starter

levi_ackerman

Joined Mar 25, 2023
23
MODBUS is a relatively easy protocol to implement - it can be done with an 8-bit microcontroller without too much trouble, provided that it has a UART. The only extra hardware needed is a SN75176 or equivalent RS485 line transceiver.
https://modbus.org/docs/Modbus_Application_Protocol_V1_1b.pdf
Each sensor has to respond to a request for data, and has to return a 16-bit number.
Think yourself lucky you didn't choose BACNET.
I'm trying to develop a Modbus RTU communication in Python through the PyModbus library.

My Master would be the Beaglebone Black as you can see from the photo, while my slaves are the sensors.

My idea was to simulate a Modbus communication and send requests to the slaves through the BBB, all through an RS-485 Hub.

This reasoning comes back to me, I don't know about you. I want to connect everything to a breadboard to be more orderly (also for academic purposes)

What I want to know is if I can actually replicate this draft I drew.
 

Attachments

nsaspook

Joined Aug 27, 2009
11,777
What you are calling a hub is a TTL to RS-485 converter chip that has no protocol conversion capability. Your diagram is inaccurate and incomplete in its description of a possible MODBUS system.
1683763816707.png

Here we have a PIC32MK (the BB equivalent in your diagram) controller as the MODBUS master (with a TTL to RS-485 converter chip) that talks to a PIC18F1320 controller MODBUs slave (with the same TTL to RS-485 converter chip). All of the actual MODBUS functionality in the slave and master is in software on their respective controller chips. So yes, you can simulate a system that issues MODBUS request on the master host to request information but if you want a physical network with real MODBUS slave devices there must be MODBUS slave functionality that can convert the raw sensor data (in various possible interfaces) to a slave MODBUS standard the master can understand.
https://forum.allaboutcircuits.com/threads/real-world-application-for-rtos-ml.182350/post-1673522
 

Thread Starter

levi_ackerman

Joined Mar 25, 2023
23
What you are calling a hub is a TTL to RS-485 converter chip that has no protocol conversion capability. Your diagram is inaccurate and incomplete in its description of a possible MODBUS system.
View attachment 293921

Here we have a PIC32MK (the BB equivalent in your diagram) controller as the MODBUS master (with a TTL to RS-485 converter chip) that talks to a PIC18F1320 controller MODBUs slave (with the same TTL to RS-485 converter chip). All of the actual MODBUS functionality in the slave and master is in software on their respective controller chips. So yes, you can simulate a system that issues MODBUS request on the master host to request information but if you want a physical network with real MODBUS slave devices there must be MODBUS slave functionality that can convert the raw sensor data (in various possible interfaces) to a slave MODBUS standard the master can understand.
https://forum.allaboutcircuits.com/threads/real-world-application-for-rtos-ml.182350/post-1673522

Very interesting. At this point I wonder... But what is the RS-485 Hub for? Isn't it a real Hub?

Anyway, my idea was to send requests through the BBB to activate the sensors by electrical impulses and request information from the sensors and I thought that simply adding a converter to get RS-485 signal would be enough. Are you telling me that this is not the case and that I would necessarily need a controller? In case I just want to use some simple sensors and request only the data from the sensors >transform it to RS-485 >Translate it back to Human Readable Signal >and have it displayed by the BBB... would that be possible?
 

Ian0

Joined Aug 7, 2020
8,400
Very interesting. At this point I wonder... But what is the RS-485 Hub for? Isn't it a real Hub?
is it a mistranslation? I don’t see it being described as a hub.
RS485 by definition cannot have a “hub” because it doesn’t work in a star network.It requires a daisy-chain structure.
Anyway, my idea was to send requests through the BBB to activate the sensors by electrical impulses and request information from the sensors and I thought that simply adding a converter to get RS-485 signal would be enough. Are you telling me that this is not the case and that I would necessarily need a controller? In case I just want to use some simple sensors and request only the data from the sensors >transform it to RS-485 >Translate it back to Human Readable Signal >and have it displayed by the BBB... would that be possible?
Each of your sensors would require a small microcontroller with a UART which could receive the data request from the RS485 bus, ensure the sensor output, then transmit the data via the UART on to the RS485 bus.
 
Top