The DS18B20 is a digital temperature sensor that uses the One-Wire protocol to communicate, this protocol needs only one data pin to communicate and allows more than one sensor to be connected on the same bus.
In this post, we are going to connect our Dallas temperature sensor with an industrial
Connections between a temperature sensor and a programmable logic controller
Dallas DS18B20 Sensor
The DS18B20 sensor is made up of a processor with multiple modules, with which communication is remote controlled and the alarm system is measured in real time for industrial control.
One of the main advantages of DS18B20 is its 1-Wire communication bus that allows you to transmit using only one data cable. For this, 1-Wire is based on a complex signal timing system, between the emitting device and the receiver.
The 1-Wire device allows all devices connected to the bus to be powered through the data line. To do this, they have a capacitor that stores energy while the data line is in HIGH. This mode is called "parasitic mode". In case of not using the parasitic mode, the devices must be powered at a voltage between 3.0V and 5.5V.
Connection to Raspberry Pi PLC controller
In the picture below, you will see how to connect the temperature sensor to the open source PLC Raspberry Pi. We can only connect the yellow cable to the GPIO 25 because it is a direct pin that goes to the GPIO directly. See how:
Now, you are ready to read the temperature with your Dallas DS18B20 temperature sensor from your industrial Raspberry PLC!