{"id":21840523,"url":"https://github.com/rubiojr/go-enviroplus","last_synced_at":"2025-03-21T15:35:49.635Z","repository":{"id":45184968,"uuid":"332513712","full_name":"rubiojr/go-enviroplus","owner":"rubiojr","description":"Go module to read Pimoroni's Enviro+ sensors ","archived":false,"fork":false,"pushed_at":"2022-01-02T20:42:10.000Z","size":4589,"stargazers_count":9,"open_issues_count":3,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-26T11:09:10.582Z","etag":null,"topics":["enviroplus","periphio","pimoroni"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rubiojr.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":"2021-01-24T17:40:24.000Z","updated_at":"2024-12-02T16:04:47.000Z","dependencies_parsed_at":"2022-08-28T13:41:11.626Z","dependency_job_id":null,"html_url":"https://github.com/rubiojr/go-enviroplus","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/rubiojr%2Fgo-enviroplus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubiojr%2Fgo-enviroplus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubiojr%2Fgo-enviroplus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubiojr%2Fgo-enviroplus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rubiojr","download_url":"https://codeload.github.com/rubiojr/go-enviroplus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244823090,"owners_count":20516218,"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":["enviroplus","periphio","pimoroni"],"created_at":"2024-11-27T21:26:35.883Z","updated_at":"2025-03-21T15:35:49.607Z","avatar_url":"https://github.com/rubiojr.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pimoroni Enviro+ Drivers\n\nGo library to read data from [Pimoroni's Enviro+](https://learn.pimoroni.com/tutorial/sandyj/getting-started-with-enviro-plus) sensors.\n\n⚠️ Experimental, API subject to change ⚠\n\n## BME250\n\nPackage to read pressure, relative humidity and temperature sensors.\n\n```Go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"periph.io/x/periph/conn/i2c/i2creg\"\n\t\"periph.io/x/periph/conn/physic\"\n\t\"periph.io/x/periph/devices/bmxx80\"\n\t\"periph.io/x/periph/host\"\n)\n\nfunc main() {\n\t// Make sure periph is initialized.\n\tif _, err := host.Init(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Use i2creg I²C bus registry to find the first available I²C bus.\n\tb, err := i2creg.Open(\"\")\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to open I²C: %v\", err)\n\t}\n\tdefer b.Close()\n\n\td, err := bmxx80.NewI2C(b, 0x76, \u0026bmxx80.DefaultOpts)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to initialize bme280: %v\", err)\n\t}\n\te := physic.Env{}\n\tif err := d.Sense(\u0026e); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"%8s %10s %9s\\n\", e.Temperature, e.Pressure, e.Humidity)\n}\n```\n\n## LTR559\n\nLight/Proximity Sensor.\n\nThe driver is a port of [the Python driver](https://github.com/pimoroni/ltr559-python) from Pimoroni.\n\n### Reading data from the sensor\n\n```Go\n// Read proximity and light from the LTR559 sensor\npackage main\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/rubiojr/go-enviroplus/ltr559\"\n)\n\nfunc main() {\n\td := ltr559.New()\n\n\tfmt.Printf(\"Manufacturer ID:  0x%x\\n\", d.ManufacturerID())\n\tfmt.Printf(\"Part ID:          0x%x\\n\", d.PartID())\n\n\tfor {\n\t\tfmt.Println(\"proximity: \", d.Proximity())\n\t\tfmt.Println(\"      lux: \", d.Lux())\n\t\ttime.Sleep(1 * time.Second)\n\t}\n}\n```\n\n### PMS5003\n\nParticle concentration sensor.\n\n```Go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/rubiojr/go-enviroplus/pms5003\"\n)\n\nfunc main() {\n\tdev, err := pms5003.New()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tgo func() {\n\t\tdev.StartReading()\n\t}()\n\tfor {\n\t\tr := dev.LastValue()\n\t\tfmt.Println(\"-------\")\n\t\tfmt.Println(\"PM1.0 ug/m3 (ultrafine):                        \", r.Pm10Std)\n\t\tfmt.Println(\"PM2.5 ug/m3 (combustion, organic comp, metals): \", r.Pm25Std)\n\t\tfmt.Println(\"PM10 ug/m3 (dust, pollen, mould spores):        \", r.Pm100Std)\n\t\tfmt.Println(\"PM1.0 ug/m3 (atmos env):                        \", r.Pm10Env)\n\t\tfmt.Println(\"PM2.5 ug/m3 (atmos env):                        \", r.Pm25Env)\n\t\tfmt.Println(\"PM10 ug/m3 (atmos env):                         \", r.Pm100Env)\n\t\tfmt.Println(\"0.3um 1 0.1L air:                               \", r.Particles3um)\n\t\tfmt.Println(\"0.5um 1 0.1L air:                               \", r.Particles5um)\n\t\tfmt.Println(\"1.0um 1 0.1L air:                               \", r.Particles10um)\n\t\tfmt.Println(\"2.5um 1 0.1L air:                               \", r.Particles25um)\n\t\tfmt.Println(\"5um 1 0.1L air:                                 \", r.Particles50um)\n\t\tfmt.Println(\"10um 1 0.1L air:                                \", r.Particles100um)\n\t\ttime.Sleep(1 * time.Second)\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubiojr%2Fgo-enviroplus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubiojr%2Fgo-enviroplus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubiojr%2Fgo-enviroplus/lists"}