{
  "id": "mcauser/micropython-hdc1080",
  "name": "micropython-hdc1080",
  "prettyName": "micropython-hdc1080",
  "description": "MicroPython driver for the HDC1080 temperature and humidity sensor",
  "version": "",
  "author": "mcauser",
  "license": "MIT",
  "tags": [
    "hdc1080",
    "humidity-sensor",
    "micropython",
    "temperature-sensor"
  ],
  "status": "VALID",
  "official": false,
  "source": "https://github.com/mcauser/micropython-hdc1080",
  "updatedAt": "2026-10-16T07:00:37.814Z",
  "page": "https://checkmim.com/packages/mcauser+micropython-hdc1080",
  "createdAt": "2025-05-27T04:34:36.827Z",
  "submittedBy": "oliverr",
  "install": {
    "mpremote": "mpremote mip install github:mcauser/micropython-hdc1080",
    "mip": "import mip; mip.install(\"github:mcauser/micropython-hdc1080\")"
  },
  "readme": "# MicroPython HDC1080 Temperature & Humidity Sensor\n\nA MicroPython library for the TI HDC1080 low power, high accuracy digital humidity and temperature sensor with I2C Interface.\n\n![demo](docs/hdc1080.jpg)\n\n### Installation\n\nUsing mip via mpremote:\n\n```bash\n$ mpremote mip install github:mcauser/micropython-hdc1080\n$ mpremote mip install github:mcauser/micropython-hdc1080/examples\n```\n\nUsing mip directly on a WiFi capable board:\n\n```python\n>>> import mip\n>>> mip.install(\"github:mcauser/micropython-hdc1080\")\n>>> mip.install(\"github:mcauser/micropython-hdc1080/examples\")\n```\n\nManual installation:\n\nCopy `src/hdc1080.py` to the root directory of your device.\n\n## Examples\n\n**Basic usage**\n\n```python\nfrom machine import I2C, Pin\nfrom hdc1080 import HDC1080\n\ni2c = I2C(0)\ni2c.scan()\n# [64]\n\nhdc = HDC1080(i2c)\n\n# set humidity resolution (in bits)\nhdc.config(humid_res=8)\nhdc.config(humid_res=11)\nhdc.config(humid_res=14)\n# as resolution increases, conversion time increases\n# 8-bit 2.5ms, 11-bit 3.85ms, 14-bit 6.5ms\n\n# set temperature resolution (in bits)\nhdc.config(temp_res=11)\nhdc.config(temp_res=14)\n# as resolution increases, conversion time increases\n# 11-bit 3.65ms, 14-bit 6.35ms\n\n# set acquisition mode\nhdc.config(mode=0)\nhdc.config(mode=1)\n# 0 measure temp or humidity\n# 1 measure temp and humidity\n\n# toggle heater\nhdc.config(heater=0)\nhdc.config(heater=1)\n# 0 turns heater off\n# 1 turns heater on\n# heater can be used to test the sensor or drive off condensation after long exposure to high humidity\n\nhdc.temperature()\n# eg 20.78735\n\nhdc.humidity()\n# eg 60.83984\n\n# software reset\nhdc.reset()\n\n# look for the HDC1080 sensor on the I2C bus\nhdc.check()\n# returns True if the device was found, otherwise raises an OSError\n\nhdc.battery_status()\n# returns 0 if Vcc > 2.8V\n# returns 1 if Vcc < 2.8V\n# useful in low power battery powered systems, to inform user to replace batteries\n\nhdc.serial_number()\n# returns eg 9816972135, a 40-bit unique serial per individual HDC1080\n\nhdc.manufacturer_id()\n# returns 21577 or 0x5449\n# which can be represented as b'TI' for Texas Instruments\n\nhdc.device_id()\n# returns 4176 or 0x1050\n# don't ask me why it's 1050 and not 1080 - that's just how it is in the datasheet\n```\n\nFor more detailed examples, see [examples](/examples).\n\nIf you mip installed them above, you can run them like so:\n\n```python\nimport hdc1080.examples.basic\n```\n\n## Parts\n\n* [HDC1080 module](https://s.click.aliexpress.com/e/_DBqFmVn)\n* [TinyPICO](https://www.tinypico.com/)\n\n## Connections\n\n### TinyPICO ESP32\n\n```python\nfrom machine import SoftI2C, Pin\ni2c = SoftI2C(scl=Pin(22), sda=Pin(21))\n\nfrom machine import I2C, Pin\ni2c = I2C(0)\n```\n\nHDC1080 | TinyPICO (ESP32)\n------- | ----------------\nVCC     | 3V3\nGND     | GND\nSCL     | 22 (SCL)\nSDA     | 21 (SDA)\n\n## Links\n\n* [micropython.org](http://micropython.org)\n* [HDC1080 product page](https://www.ti.com/product/HDC1080)\n* [HDC1080 datasheet](docs/hdc1080.pdf)\n* [HDC1080 datasheet](https://www.ti.com/lit/ds/symlink/hdc1080.pdf)\n* [TinyPICO Getting Started](https://www.tinypico.com/gettingstarted)\n\n## License\n\nLicensed under the [MIT License](http://opensource.org/licenses/MIT).\n\nCopyright (c) 2024 Mike Causer\n"
}