This module shows the temperature and humidity of a HDC1080 Sensor by using the I2C of the RaspberryPi and displays it at your MagicMirror² https://github.com/MichMich/MagicMirror. The Pins 2 and 3 are used for I2C and can not be changed. The main function and code is from @Bangee44 (https://github.com/Bangee44/MMM-DHT22) where he used it for a DHT22-Sensor.
- Enable your I2C of the RaspberryPi by going to Settings->RaspberryPi Configuration->interfaces->Enable I2C
- An installation of MagicMirror2
- [WiringPi] (http://wiringpi.com/download-and-install/)
Navigate into your MagicMirror's modules
folder:
cd ~/MagicMirror/modules
Clone this repository:
git clone https://github.com/MichaelF1/MMM-HDC1080
Setup the address (default is 0x40) of your used I2C - HDC1080 Sensor in the ReadHDC1080.c-file at ~/MagicMirror/modules/MMM-HDC1080/:
int iI2cAddress = 0x40; //put in your I2C-Address here
If you do not need to change the file you are fine now, but if you have to you have to compile it with:
cc -Wall ReadHDC1080_Pi.c -o ReadHDC1080 -lwiringPi
Navigate to the new MMM-HDC1080
folder and make ReadHDC1080 executable.
cd MMM-HDC1080
chmod 755 ReadHDC1080
You can change the ReadHDC1080.c file for your own needs if you like to. You'll have to recompile it using wirinpi lib.
cc -Wall ReadHDC1080.c -o ReadHDC1080 -lwiringPi
Configure the module in your config.js
file.
To use this module, add it to the modules array in the config/config.js
file:
modules: [
{
module: 'MMM-HDC1080',
position: 'top_right',
config: {
updateInterval: 0.5, // Minutes
},
},
]
The configuration options are still the same of https://github.com/Bangee44/MMM-DHT22
The following properties can be configured:
Option | Description |
---|---|
updateInterval |
Updateinterval for HDC1080 sensor in minutes
Possible values: int Default value: 0.5
|