{"id":14978043,"url":"https://github.com/yryz/ds18b20","last_synced_at":"2025-08-13T02:49:37.295Z","repository":{"id":57481026,"uuid":"59397123","full_name":"yryz/ds18b20","owner":"yryz","description":"Golang get temperature from ds18b20 sensor connected to a Raspberry PI (GPIO w1 pin).","archived":false,"fork":false,"pushed_at":"2020-05-27T15:44:35.000Z","size":38,"stargazers_count":64,"open_issues_count":0,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T12:44:13.071Z","etag":null,"topics":["ds18b20","golang","raspberry","raspberry-pi","temperature-sensor"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yryz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-22T05:45:46.000Z","updated_at":"2024-10-11T15:01:43.000Z","dependencies_parsed_at":"2022-09-26T17:41:22.830Z","dependency_job_id":null,"html_url":"https://github.com/yryz/ds18b20","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yryz%2Fds18b20","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yryz%2Fds18b20/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yryz%2Fds18b20/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yryz%2Fds18b20/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yryz","download_url":"https://codeload.github.com/yryz/ds18b20/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238614439,"owners_count":19501458,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ds18b20","golang","raspberry","raspberry-pi","temperature-sensor"],"created_at":"2024-09-24T13:56:46.141Z","updated_at":"2025-02-13T07:30:58.740Z","avatar_url":"https://github.com/yryz.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ds18b20\n\nGet sensor data from ds18b20 connected to the Raspberry (GPIO w1 pin).\n\n\n\n![](https://raw.githubusercontent.com/yryz/ds18b20/master/pi-ds18b20.png)\n\n## Usage\n\n### Connect DS18B20\nOn the Raspberry Pi, you will need to add `dtoverlay=w1-gpio\"` (for regular connection) or `dtoverlay=w1-gpio,pullup=\"y\"` (for parasitic connection) to your /boot/config.txt. The default data pin is GPIO4 (RaspPi connector pin 7), but that can be changed from 4 to `x` with `dtoverlay=w1-gpio,gpiopin=x`.\n\nHere's what I did:\n```\nsudo echo dtoverlay=w1-gpio-pullup,gpiopin=4 \u003e\u003e /boot/config.txt\nsudo modprobe w1_gpio \u0026\u0026 sudo modprobe w1_therm\n```\n\n### Drivers\n\n1-Wire drivers need to be loaded in order to create the connection between the physical sensor and the rPI.\nYou can load them from the terminal (or from the bin/modules.sh script).\n\n    sudo modprobe wire\n    sudo modprobe w1-gpio\n    sudo modprobe w1-therm\n\n### Install\n    go get github.com/yryz/ds18b20\n\n### Code\n```go\npackage main\n\nimport (\n    \"fmt\"\n\n    \"github.com/yryz/ds18b20\"\n)\n\nfunc main() {\n    sensors, err := ds18b20.Sensors()\n    if err != nil {\n        panic(err)\n    }\n\n    fmt.Printf(\"sensor IDs: %v\\n\", sensors)\n\n    for _, sensor := range sensors {\n        t, err := ds18b20.Temperature(sensor)\n        if err == nil {\n            fmt.Printf(\"sensor: %s temperature: %.2f°C\\n\", sensor, t)\n        }\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyryz%2Fds18b20","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyryz%2Fds18b20","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyryz%2Fds18b20/lists"}