Getting HTU21 Temperature/Humidity Sensor to work with Pi 1/2/3/Zero
enable i2s
sudo raspi-config- Advanced Settings > Enable I2C
or run the commands below
sudo sed -i 's/#dtparam=i2s-arm=on/dtparam=i2s-arm=on/g' /boot/config.txtsudo sed -i 's/#dtparam=i2s=on/dtparam=i2s=on/g' /boot/config.txt
install i2c tools
sudo apt-get install i2c-tools python-smbus -ysudo i2cdetect -y 1(see if you can spot the connection, mine said 40)
install the pigpio libary
wget abyz.co.uk/rpi/pigpio/pigpio.zipunzip pigpio.zip && cd PIGPIOmake && sudo make installsudo pigpiod
get the pi code
git clone https://github.com/dalexgray/RaspberryPI_HTU21DF.git && cd RaspberryPI_HTU21DFsudo python HTU21DF.py install
test it
python HTU21DF_test.py