Skip to main content

pmodhygro is python library to read PmodHYGRO that is relative humidity sensor with integrated temperature sensor on a Raspberry Pi

Project description

pmodhygro

pmodhygro is python library to read PmodHYGRO that is relative humidity sensor with integrated temperature sensor on a Raspberry Pi

-> Reference page of PmodHygro sensor : https://digilent.com/reference/pmod/pmodhygro/start?redirect=1

Installing

Install with pip

Use pip to install from PyPI.

Python 2:

sudo pip install pmodhygro

Python 3:

sudo pip3 install pmodhygro

Compile and install from the repository

Download library for ZIP file from GitHub, unzipping the archive, and execute:

Python 2:

cd pmodhygro
sudo python setup.py install

Python 3:

cd pmodhygro
sudo python3 setup.py install

You may also git clone the repository:

git clone https://github.com/devpola/pmodhygro.git

Usage

from pmodhygro import HygroI2C

# Create i2c bus
pmod = HygroI2C()
pmod.begin_i2c()

# Read data from Pmod HYGRO 
temp = pmod.get_temperature()
temp_f = pmod.get_temperature_f()
hum = pmod.get_humidity()

Check list before using library

Check for I2C

Raspbian:

  1. Using “Raspi-config” on Command Line
sudo raspi-config
  1. Enable I2C Interface

Ubuntu(20.04):

  1. Open '/boot/firmware/syscfg.txt' file
  2. Check if there are contents below. If not, add it.
dtparam=i2c_arm=on, dtparam=spi=on

Check the connection

  • Check port sensor is connected using command below.

    ls /dev/*i2c*
    
    1. You can get /dev/i2c-0 or /dev/i2c-1

      • In case of Raspberry Pi B model, there are two i2c ports, 0 and 1.
    2. Remember whether the port number is 0 or 1

  • Check device address is 0x40

    1. Install i2c-tools package for checking connected devices to i2c interface

      Python 2:

      sudo pip install pmodhygro
      

      Python 3:

      sudo pip3 install pmodhygro
      
    2. Check device address at the port is 0x40 using command below.

    sudo i2cdetect -y 0 (or 1)
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pmodhygro-1.0.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pmodhygro-1.0.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file pmodhygro-1.0.1.tar.gz.

File metadata

  • Download URL: pmodhygro-1.0.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for pmodhygro-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a10f0832aafe6c59de1e21c0888a523628019dfe1130bd6355d0dda4b2a8a950
MD5 f709b6eaa74a0cfcadb978c7646ecc9e
BLAKE2b-256 e851ddc11d8d435ff8740deaa03f0b4cd0263a649541382b2d7eb17845e83484

See more details on using hashes here.

File details

Details for the file pmodhygro-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pmodhygro-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for pmodhygro-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 99f8e5f1c0619abd003b20bd904b7fe4c3f3deb5842f76aa226b87cefab83d85
MD5 ecb334033f6688a474670afe3b4f0ddc
BLAKE2b-256 40ba1e8b199fb5355528572a67b408afbed5f5d26998426413c78fe694870972

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page