Select Interfacing Options > Serial
Interfacing Options > Serial and enable it.
Reboot the board.
Plug the USB to serial cable and connect your Raspberry Pi to your PC. The RX
RX line of the cable should go to TX
TX line of UART
UART on ANAVI Infrared pHAT. The TX
TX
line of the cable should go to the RX
RX line of UART
UART on ANAVI Infrared pHAT. The GND
GND wire should go to the GND
GND line of UART
UART on ANAVI Infrared pHAT.
Type in the following command on your computer if you are using GNU/Linux distribution to access ANAVI Infrared pHAT. Alternatively if your OS is Microsoft
Windows use
.
The recommended USB to UART serial modules for ANAVI Infrared pHAT are any with CP2102 or
. All Infrared kits include CP2102 which
out of the box on GNU/Linux distributions. Drivers for MS Windows and Mac OS X are
.
Examples
Examples
Sample applications written in Python and the C programming language are provided for ANAVI Infrared pHAT under MIT license in GitHub. All examples have been
tested on Raspbian
Raspbian.
Open a terminal and execute the follow the steps by step instructions to install all dependencies and to get the source code:
Install dependencies:
sudo apt-get update
sudo apt-get install -y git git-core vim python-dev python-rpi.gpio wiringpi i2c-tools
Download the examples for ANAVI Infrared pHAT
cd ~
git clone https://github.com/AnaviTechnology/anavi-examples.git
cd anavi-examples
Sensors
Sensors
It is mandatory to enable I2C
I2C to use any of the sensors supported by ANAVI Infrared pHAT.
Temperature Sensor (BMP180)
Temperature Sensor (BMP180)
Follow the steps below to use the BMP180 I2C temperature and barometric pressure sensor with ANAVI Infrared pHAT:
Connect BMP180 to any of the I2C slots on ANAVI Infrared pHAT using male to female Duport jumper wire.
Type in the following command and verify that the address of the sensor is listed:
sudo i2cdetect -y 1
Type in the following commands to build and run the sample application that display temperature and barometric pressure:
cd ~/anavi-examples/sensors/BMP180/c/
make
./BMP180
Verify that the output is similar to (the exact values depend on the atmospheric condition):
pi@raspberrypi:~/anavi-examples/sensors/BMP180/c $ ./BMP180
BMP180 Sensor Module
Temperature 28.6 C
Pressure 991.57 hPa
Humidity Sensor (HTU21D)
Humidity Sensor (HTU21D)
Follow the steps below to use the HTU21D I2C temperature and humidity sensor with ANAVI Infrared pHAT:
Connect HTU21D to any of the I2C slots on ANAVI Infrared pHAT using male to female Duport jumper wire.
Type in the following command and verify that the address of the sensor is listed:
sudo i2cdetect -y 1
Type in the following commands to build and run the sample application that display temperature and humidity: