Configure a DS18B20 Temperature Sensor
Configure a ds18b20
sensor to integrate a DallasTemperature DS18B20 1-wire digital temperature sensor into your machine:
Navigate to the CONFIGURE tab of your machine’s page in the Viam app.
Click the + icon next to your machine part in the left-hand menu and select Component.
Select the sensor
type, then select the ds18b20
model.
Enter a name or use the suggested name for your sensor and click Create.
Fill in the attributes as applicable to your sensor, according to the table below.
{
"components": [
{
"name": "<your-ds18b20-sensor-name>",
"model": "ds18b20",
"type": "sensor",
"namespace": "rdk",
"attributes": {
"unique_id": "<your-sensor-unique-id>"
},
"depends_on": []
}
]
}
The following attributes are available for ds18b20
sensors:
Attribute | Type | Required? | Description |
---|---|---|---|
unique_id | string | Required | The unique 64-bit serial code of your DS18B20 sensor. Laser engraved onto your sensor and available programmatically. Example: "28EEB2B81D160127" . Note that this ID will also be the last 16 digits of the device file when the sensor is mounted in a Linux filesystem. |
Test the sensor
After you configure your sensor, open the sensor’s TEST panel on the CONFIGURE or CONTROL tabs. To access detailed readings from your sensor, click on the Get Readings button.
Have questions, or want to meet other people working on robots? Join our Community Discord.
If you notice any issues with the documentation, feel free to file an issue or edit this file.
Was this page helpful?
Glad to hear it! If you have any other feedback please let us know:
We're sorry about that. To help us improve, please tell us what we can do better:
Thank you!