background image

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 

putty

.

The recommended USB to UART serial modules for ANAVI Infrared pHAT are any with CP2102 or 

Olimex USB-Serial-Cable-F

. All Infrared kits include CP2102 which

out of the box on GNU/Linux distributions. Drivers for MS Windows and Mac OS X are 

available at silabs.com

.

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:

Содержание Infrared pHAT

Страница 1: ...ing and observe good engineering practice standards As such the goods being provided are not intended to be complete in terms of required design marketing and or manufacturing related protective considerations including product safety and environmental measures typically found in end products that incorporate such semiconductor components or circuit boards There is no warranty for the design mater...

Страница 2: ...pported Peripherals ANAVI Infrared pHAT Raspberry Pi HAT has an infrared receiver and an infrared transmitter Up to 3 I2C sensors can be also easily attached to the pHAT Sensors The officially supported I2C sensor modules by ANAVI Infrared pHAT are Temperature and barometric pressure BMP180 Temperature and humidity HTU21 Light BH1750 You may also attach any other I2C sensors but you will have to t...

Страница 3: ...gh Raspberry Pi It is recommended to use the official Raspberry Pi Power Supply or another 2 5A USB power supply from reputable retailer CHAPTER 3 Software Installation In order to work correctly ANAVI Infrared pHAT requires an up to date kernel I2C to be enabled and a few libraries to get started After booting microSD card with Raspbian open a terminal and follow the steps below Ensure your APT p...

Страница 4: ...n 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 It is mandatory to enable I2C to use any of the sensors supported by ANAVI Infrared pHAT Temperature Sensor BMP180 Follow the steps below to use the BMP180 I2C temperature and barometric pressure sensor with ANAVI Infrared pHAT Conne...

Страница 5: ...urce application for sending and receiving data over infrared on GNU Linux distributions This chapter provides guidelines how to enable ANAVI Infrared pHAT infrared receiver and transmitter on Raspbian and to use LIRC In 2019 lirc_rpi the Linux kernel module provided with Raspbian before was replaced with gpio ir and gpio ir tx This tutorial is updated for Raspbian Buster If you need to setup ANAV...

Страница 6: ...pin 17 Reboot Raspberry Pi sudo shutdown r 0 Using IR Receiver Follow the steps below to verify that the IR receiver is working as expected Stop LIRC systemd service sudo systemctl stop lircd Start outputting raw data from the IR receiver mode2 d dev lirc1 Point a remote control at the IR receiver on ANAVI Infrared pHAT and press its buttons If the IR receiver is configured successfully you will s...

Страница 7: ...ded using irdb get 1 You use a template file by providing the path of the file as a command line parameter Please take the time to finish the file as described in https sourceforge net p lirc remotes wiki Checklist an send it to lirc bartelmus de so it can be made available to others Press RETURN to continue Checking for ambient light creating too much disturbances Please don t press any buttons j...

Страница 8: ... systemctl start lircd List all saved keys for example NOTE Please adapt the command below depending on your name of remote irsend LIST hifi Test the configuration file by sending recorded IR command for example POWER please note the exact command may vary for different LIRC configuration files IR devices and IR remote controls NOTE Please adapt the command below depending on your name of remote i...

Страница 9: ...berry Pi Component Pins I2C 3 5 EEPROM 27 28 IR LED 11 IR receiver 12 UART 1 8 9 10 I2C The sensors that can be connected to ANAVI Infrared pHAT communicate with a host microcontroller via a communications standard called I2C Inter Integrated Circut I2C uses two wires labelled SDA Serial Data and SCL Serial Clock To function properly I2C requires a pullup resistor on each of those lines therefore ...

Страница 10: ...g on a commercial product and you would like to use the software under alternative commercial license CHAPTER 7 Revision History Document Revision Date Changes Modified pages Author 15 February 2017 Initial manual release All Leon Anavi 16 September 2017 Update for Raspbian Stretch All Leon Anavi 08 July 2019 Update for Raspbian Buster All Leon Anavi ANAVI Infrared pHAT Revision Revision Notable c...

Отзывы: