URM04 Ultrasonic Sensor

Hi!

I have a project that requires distance measurement and a large number of sensors (up to 30). I’m planning on using these distance sensors (https://core-electronics.com.au/urm04-v2-0-ultrasonic-sensor.html).

I also pretend to use an S7-1200 CPU 1215C PLC and this communication module (https://www.plc-city.com/shop/en/siemens-simatic-s7-1200-communication-modules/6es7241-1ch32-0xb0.html). So, to establish communication between the sensors and the communication module, do I need a MAX485 chip? Can I connect all the 30 sensors in series and use a single communication module? And how can I trigger each sensor separately? I have only seen code examples for Arduino, but I need to use a PLC on this project.

Thank you in advance!

The module and the sensors both use RS-485 so you can connect them directly, with the sensors in series.

The sensors have a default address, which can be changed programmaticly, in circuit. Refer to the user manual for full details.

1 Like

Thank you for your reply!
So I don’t need a MAX485 chip? And how can I establish communication with PLC? What protocol does the sensor support?
Thank you in advance!

Doesn’t the communication module plug directly into the the S7-1200 CPU?

Other than asking that, I don’t know how to program the S7-1200.

1 Like

Thank you for your reply!
I think so. I was referring to the communication between the module and the sensors. Sorry if I didn’t make it clear. I just found information regarding the interface (RS485) but couldn’t find what communication protocol is used by those sensors. I was planning on using Modbus RTU.

HI Maria,

The sensor you linked also uses RS485 so you should be good to go, should just be a matter of interpreting the packets. From the specs give I would say you could connect all 30 together, Though might be a good idea to start with less and build up. From memory I think once you start getting a lot of devices on the same bus things can get a little slow.

1 Like

@Maria95466
I’m not familiar with ModBus RTU, but the user manual for the sensor gives examples of the data structures required to operate it. Have a read of the manual, and then you can figure it out.

1 Like

I just read through the sensor spec and had a quick look at the S7-1200 serial module and it doesn’t look like you can connect them. The RS485 electrical specification is compatible but the overlying protocol is not. As you mentioned, most PLC’s use industry standard MODBUS-RTU (or similar) protocols which the sensor doesn’t support. It doesn’t look like the S7 software supports very much in the way of custom serial protocols either - most PLC’s don’t.

It looks like your best options are to find sensors the support MODBUS RTU over RS485 or build a protocol converter using an Arduino with two RS485 boards. I’d suggest the best option is to talk to the team at Core-Electronics to see if they can get you some DFRobot URM08 Ultrasonic Sensors that support MODBUS-RTU over RS485.

1 Like

From looking at the code for both of these sensors, it appears to use the same data packets and structure. That seems to conform to the ModBus standard.

The URM04 looks like a hobby sensor, not meant for industrial environments/applications, whereas the URM08 is an industrial grade sensor.

Depending on @Maria95466 intended use, either sensor would work. The industrial hardware chosen as the driver would indicate an industrial setting, so the URM08 as indicated by @Shaun21504 would be a better choice.

2 Likes

Good catch @Robin57159. I would make sense that they didn’t reinvent the wheel.

1 Like

Thank you for your replies!!
So, both URM04 and URM08 support the Modbus RTU protocol? Does that mean they can be connected directly to the RS485 communication module (without any additional chips)?
I never saw the Modbus RTU communication protocol mentioned on those sensors datasheets. And, comparing both data frames, they look quite different. For example, the first byte is the slave ID on the Modbus RTU protocol and a header on the sensor protocol.

I’m dealing with an industrial application. However, I need my sensor to cover a measurement range from 5 to 300 cm (at least). Can you please recommend a similar sensor suitable for my project?
I did some more research and found URM37 V5.0. It has the required measurement range. However, it has an RS232 interface…

1 Like

When you’re looking at industrial sensors PLC’s even though they have the same protocol doesn’t always mean they will work. The DFRobot sensors are using custom commands which may not be configurable on your PLC. I was looking at the code and it looks like they start with a MODBUS like protocol and switch to a custom message.

You don’t need any additional chips because your PLC serial communications card supports RS485. The chips are to convert RS232 to RS485. RS485 is like RS232 but it uses balanced lines so it works better in noisy industrial environments and it has tri-state logic (High-Low-High Impedance). The High impedance state is what enables you to have multiple devices on one line.

You haven’t mentioned what the industrial application is you’re using the sensors on. Are you measuring the distance or what to activate a switch at a distance? Is it a ruggard environment? What are you trying to measure the distance of?

If you want to be able to wire the sensors in and they work you probably need to look at some industrial sensors from RSComponents, Element14 or one of the other industrial suppliers like Practical Control Solutions or Ocean Controls. You’re going to pay a lot more money for the sensors but they will work and be very rugged. The sales teams at these companies will be able to pick the right sensor for your application.

To give you an idea on the tuypes of sensors and costs, here’s one from Ocean Controls that will do the job but it going to set you back more that $23K (plus GST) for 30 sensors - https://oceancontrols.com.au/SNS-060.html

1 Like

Thank you very much for your reply and your recommendations!
The project consists of projecting a controller for an aircraft maintenance platform, and, to achieve that, I’m planning on positioning the sensors on the edges of the maintenance platform, and they are meant to be operating in an indoor, dry and dust-free environment. The goal is to measure the distances and use those to control the speed of the platform.
Considering the application and the type of environment, are there any cheaper options? And how can I know if a sensor supports the Modbus RTU protocol (if they have RS485/RS232 interface and did not specifically mention the protocol used)?
Thank you in advance!

There are always cheaper options. You could use cheap ultrasonic sensors and microcontrollers and program the microcontroller to communicate back to the PLC. The difference comes down to the ruggedness, reliability, accurancy and compatability. It’s all going to depend on your skill level or the skills you can hire.

On your rs485/rs232 and MODBUS question, rs232/rs485 is the electrical specification and MODBUS is the messaging specification. They aren’t tied together. You can use one without the other. There’s also MODBUS over TCP for example.

The best way to test if they’re compatible is to try one. You’re relying on the manufacturer to tell you they support MODBUS-RTU and it’s in thei interest to tell you. The expensive industrial sensors generally are compatible but the cheaper ones are not always. If you want to learn more about MOBUS head over to modbus.org.

Thank you for your reply!
I did some research and found that Siemens PLCs support Freeport communication protocols (I can configue my own communication protocol and make it compatible with the protocol used by the sensors).
I have one more question regarding the risk of occuring interference between adjacent sensors.
Is it possible to trigger the sensors separatly and sequentially? Where can I find more information?
Thank you in advance!

Assuming you’re still looking at the URM04, all of the information is available on the Core-Electronics product page but the link to the DFRobot wiki appears to be broken. Here it is: https://wiki.dfrobot.com/URM04_V2.0__SKU_SEN0002_

There’s also a PDF user manual: http://image.dfrobot.com/image/data/SEN0002/URM04V2.0Mannual1.1.pdf

You may get interference if they’re too close together and you trigger them together. There’s a function you call to trigger the sensor to tell it to sense the distance and another to read it.

2 Likes