{"id":16360051,"url":"https://github.com/chrisb2/environment","last_synced_at":"2026-05-06T00:34:49.617Z","repository":{"id":82040830,"uuid":"107833535","full_name":"chrisb2/environment","owner":"chrisb2","description":"Monitor temperature and humidity (DHT22) using MicroPython on an ESP8266 and send the results to ThingSpeak.","archived":false,"fork":false,"pushed_at":"2017-11-09T08:15:47.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-29T17:41:23.013Z","etag":null,"topics":["dht22","esp8266","micropython","thingspeak","wunderground-api"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chrisb2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-22T03:11:45.000Z","updated_at":"2017-11-10T06:00:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"1ec74c2d-b66b-45c6-8edf-76d7566088d9","html_url":"https://github.com/chrisb2/environment","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/chrisb2%2Fenvironment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisb2%2Fenvironment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisb2%2Fenvironment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisb2%2Fenvironment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisb2","download_url":"https://codeload.github.com/chrisb2/environment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239727063,"owners_count":19687096,"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":["dht22","esp8266","micropython","thingspeak","wunderground-api"],"created_at":"2024-10-11T02:10:23.222Z","updated_at":"2025-10-29T21:10:38.463Z","avatar_url":"https://github.com/chrisb2.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Environment Monitor\n\nMonitors temperature and humidity using [MicroPython](http://micropython.org/)\non an [ESP8266](https://en.wikipedia.org/wiki/ESP8266) and a [RHT03 (DHT22)](https://cdn.sparkfun.com/datasheets/Sensors/Weather/RHT03.pdf)\nsensor and sends the results to [ThingSpeak](https://thingspeak.com).\n\n## Circuit\n\nThe following circuit diagram shows how I connected the sensor to a NodeMcu ESP8266 development board:\n\n![Circuit diagram](https://github.com/chrisb2/environment/raw/master/environment-circuit.png \"Circuit Diagram\")\n\n## Usage\n\nConfigure a ThingSpeak channel something like:\n\n![ThingSpeak channel](https://github.com/chrisb2/environment/raw/master/thingspeak-channel-settings.png \"ThingSpeak Channel Settings\")\n\nDownload the [urequests](https://raw.githubusercontent.com/micropython/micropython-lib/master/urequests/urequests.py) HTTP library and create a file called _secrets.py_:\n```python\n\"\"\"Secret values required to connect to services.\"\"\"\nWIFI_SSID = 'XXXXXX'\nWIFI_PASSPHRASE = 'XXXXXX'\nTHINGSPEAK_API_KEY = 'XXXXXX'\nWUNDERGROUND_API_KEY = 'XXXXXX'\n```\nand copy with the rest of the python files to the ESP8266.\n\nRun the following script from the REPL to load the wifi network.\n```python\n# Connect to WiFi router\nimport network\nimport secrets\n\nwlan = network.WLAN(network.STA_IF)\nwlan.active(True)\nwlan.connect(secrets.WIFI_SSID, secrets.WIFI_PASSPHRASE)\nwlan.ifconfig()\n```\nReboot the ESP8266 to automatically run the program.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisb2%2Fenvironment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisb2%2Fenvironment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisb2%2Fenvironment/lists"}