Air Quality Sensing

Goal

We will use  a sensor hat to attach several I2C sensor modules.

We will install driver software and readout the sensors.

We will publish the data to MQTT data broker.

CAUTION

Do not attach the sensor board to the energized Pi without having it checked by course staff.

You need to measure resistance between 3.3V and GND and it should read more than 200 Ohms.

You need to measure resistance between 5V and GND and it should read more than 200 Ohms.

You need to measure resistance between 3.3V and 5 V and it should read more than 200 Ohms.

YOU CAN NOT MEASURE RESISTANCE WHEN YOUR CIRCUIT IS POWERED ON.

Thonny

In order to use Thonny and the virtual environment you need to change the Python interpreter in Thonny to the one in the virtual environment.

Air quality Sensors for this Assignment

BMP180 (easiest for next lab)

BMP280 or BME280 (second best for next lab)

HUT21D (easiest for next lab)

Work Schedule

First Lab

Follow instructions on crimping.

Conectorize one sensor by crimping 4 wires of 6-12 indh length using the colors show below.

Obtain one pre-made sensor hat and one pre-made sensor. Make sure no connections are shorted and prevent shorts.

Obtain and install driver software.

Start developing software for at least two sensors.

Second Lab

Finish developing software and test sensors.

Third Lab

 Publish data on MQTT server

Selection of Hardware per Student

Sensor Hat 

Sensors

Build Instructions

Sensors

Pre-built Sensor with Wires and Connector

Bare Sensor

Sensor Hat

Prebuilt Hat

Sensor Hat PCB.pptx

Software

Install the drivers software as listed above for each sensor your team has. Read the description on the website. Make sure you have a test/demo  program for each of your team's sensors on your raspberry pi. The code on github includes example programs. Make a copy on your Raspberry pi. Modify the program to match the sensors address.

if you want to see if your sensor is recognized: 

sudo i2cdetect -y 1 

Should show you hardware clock at 0x68, the sensors at 0x76, 0x77, 0x5B and perhaps 0x58.

The you will need to modify the sensors demo-programs:

Lets try to read at least two sensors in a unified single program (BMP280 and HTU21D). You will need a single program to read all sensors because you can not run multiple python programs simultaneously accessing the same i2c bus.

Turn In

Continue Lab 

Continue lab with MQTT data broker lab.