Robots are fitted with sensors to get data from their surroundings. Sensors convert a physical quantity into electrical signals. These signals are processed to extract the data they carry.
When integrating sensors into a project, it is crucial to understand how the sensor technology communicates with other hardware, such as a central processing unit. So let’s explore how sensor communication works with robotic hardware.
Choosing between Analog and Digital sensors
The type of sensor you choose plays an essential part in their communication method. There are mainly two types of sensors.
Analog Sensors
Analog sensors produce analog signals, which is voltage, as their output. While analog sensors were the prominent choice in the past, their slow signal speed and vulnerability to noise have made them less efficient in recent times. However, there are a few applications where analog sensors are still a superior choice–the audio industry being a prime example.
Light Dependent Resistors (LDRs) are another example of analog sensors preferred over digital sensors. An LDR does not produce any voltage. However, its resistance changes based on the intensity of light falling on it. Moreover, LDR can also work efficiently and accurately even in harsh environmental conditions.
Digital sensors
Digital sensors produce digital signals, 0s, and 1s, as their output. In most modern devices, digital sensors dominate in numbers.
The Role of Sensor Output
We already discussed that analog and digital sensors provide different types of output. Therefore, even if they are measuring the same physical quantity, the type of sensor will affect the kind of output it produces.
In an analog sensor, the output is voltage. However, almost all robotic hardware uses a digital processing unit. Hence, the analog signal from the sensor must first be converted to digital signals before they can be read for further processing.
In most cases, a wire connects the analog sensor to the central processing unit. This wire is responsible for carrying the output from the sensor to robotic hardware. Any electrical noise in the immediate vicinity of this wire can distort the signals. The signal processing unit of the robotic hardware converts the analog signals to digital signals for further processing. A digitizer is used to convert analog signals to digital signals.
In digital sensors, the sensor’s output is in a digital format. Hence, there is no unit required for conversion.
Microcontrollers: The Tiny Processing Units
Microcontrollers are integrated circuits that contain a microprocessor to process signals fed into them. A microcontroller consists of built-in parts like CPU, memory, and input/output ports.
Microcontrollers can be programmed to process the signals from the sensor and then do a series of operations. Microcontrollers are also available in different capacities based on their processing power.
Communication Protocols
When creating a robot with sensors, there must be a system or protocols to let the sensors communicate with the microcontrollers efficiently and accurately. Once the sensor generates output, it must be carried over to the processing unit to sense and let the robot make timely adjustments.
Sensor communication protocols are broadly divided into two types:
Wired communication protocols
Wired communication protocols enable the sensor and the CPU to communicate within a wired medium. There are two subsystems within wired communication protocols – Inter System Protocol and Intra System Protocol.
Inter System Protocol deals with the communication between the computer and the sensor. The most popular Inter System Protocols are UART Protocol, USART Protocol, and USB Protocol.
Intra System Protocols are used to establish communication between the different components in the circuit system. The most popular protocols are SPI and I2C.
Wireless communication protocols
Wireless communication protocols enable the sensors to wirelessly send data over to a processing unit. Thanks to the rise of smart devices and IoT, there are far more wireless communication protocols than wired communication protocols.
WiFi, Bluetooth, Zigbee, Z-wave, RFID, NFC, and LoRaWAN are examples of popular wireless communication protocols.
Programming the Microcontroller
Once the sensors are finalized, it is time to program the microcontroller to interact with the sensor, giving functionality to the robot hardware. The process involves coding the microprocessor and helping it identify the sensors connected to it and the communication method used. If analog sensors are used, additional processing will be needed to extract data from the signal.
In basic applications, the microprocessor uses communication protocols like I2C, SPI, RS232, RS422 to accept one input at a time. However, if there is a need for a more robust system, a USB interface can be used to send multiple inputs at a time for processing.
In essence, this is the last step that ensures proper communication between the sensor and robotic hardware.
Need Help With Selecting the Right Sensors?
The world of sensors can get quite technical, and pairing the suitable sensor with the right components is critical to the proper functioning of your autonomous robot. At Hokuyo, we manufacture high-performance sensors and make it easy for our customers to integrate them with their projects. Get in touch with us today!