Configure a ds18b20 Sensor
Configure a ds18b20
sensor to integrate a DallasTemperature DS18B20 1-wire digital temperature sensor into your robot:
Navigate to the Config tab of your robot’s page in the Viam app.
Click on the Components subtab and navigate to the Create component menu.
Enter a name for your sensor, select the type sensor
, and select the ds18b20
model.
Click Create component.
Edit and fill in the attributes as applicable.
{
"components": [
{
"name": "<your-ds18b20-sensor-name>",
"type": "sensor",
"model": "ds18b20",
"attributes": {
"unique_id": "<your-sensor-unique-id>"
},
"depends_on": []
}
]
}
The following attributes are available for ds18b20
sensors:
Attribute | Type | Inclusion | 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. |
Have questions, or want to meet other people working on robots? Join our Community Discord.
Was this page helpful?
Glad to hear it! If there is anything we could be doing better, please create an issue.
We're sorry about that. If you'd like to talk to us for help, please join the Community Discord. To ensure we know what's wrong with this page, you can also open an issue.