I want to create an IoT system with Amazon Web Services. My system contains a CNC machine, robotic arm and sensor.

The idea of my project is that when objects come to container the sensor sense the object exist so the robotic arm will handle the object and put it on the table of the CNC machine and then the CNC works on the object. After finishing, the robotic arm should handle the object again.

The CNC machine is connecting to a laptop, and I am using a Python code to run the CNC.

The robotic arm is connecting to a Raspberry Pi and I also run the robotic arm by Python code. The sensor (LDR) is connecting to Raspberry Pi also.

My question is:

My idea is to make the sensor as a publisher and robotic arm as a subscriber and put another LDR sensor on the CNC table and make it a publisher. The CNC will be the subscriber—is that right?


1 Answer 1


I believe you refer to a mqtt protocol where indeed there are data subscribers and receivers.

My short answer is yes, you are on correct track.

Longer explanation:

MQTT makes it possible to publish on topics and subscribe to any of the topics to get messages according to that topic. That is why the sender would be publisher and the receiver is subscriber.

I want to tell you one tip: one devices can be both publisher and subscriber. That makes it possible for two directional traffic: another channel is for orders and other for answers. Also one can be requests and then the other responses.

In case of device and sensor one direction can be ok, but if you think your setup a bidirectional communication between the both devices would add some value.

  • 1
    you mean i don't need to put another sensor on the table of cnc machine, i can make a robotic arm as publisher and subscriber in the same time .@mico and thanks bro Commented Aug 28, 2017 at 17:52
  • 1
    With one sensor you can detect the object and the machines communicate the rest of it directly between themselves.
    – mico
    Commented Aug 28, 2017 at 17:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.