Air quality monitoring
WORKSHOP KIT
Start
Configure and automate a simple air quality monitor
Next
Meet the team:
Instructor 1 Instructor 2 Instructor 3
Building a useful robot doesn’t have to require complicated code or expensive equipment.
With a Raspberry Pi, some basic hardware, and Viam, you can monitor your indoor air quality from anywhere in the world!
What are the basic aspects of a robot?
Sensing: to gather data from the environment
Actuation: to take actions based on that data
Control: process the data, make decisions, and initiate commands
What is Viam?
An engineering platform for data, AI, and automation that makes it easy to work with any physical device
How does Viam simplify software?
Viam’s APIs let you work with type of hardware using consistent methods, simplifying development across models.
And program your robot in the language of your choice with Viam’s SDKs.
What You’ll Build
A robot consists of....
What You’ll Build
A robot consists of....
Why build this project with Viam?
You can....
Let’s confirm everyone completed the pre-work!
Next
Check in: Pre-work
Next
Get out your materials!
Let's start building!
Follow along reference:
codelabs.viam.com/guide/workshop-air-monitoring/index.html
Step 4
Set up the Raspberry Pi
Install Raspberry Pi OS
Wire the moisture sensor to chip according to the diagram:
Set up the Raspberry Pi
Set hostname
Set username and password
Configure wireless LAN
Set locale settings
Wire the moisture sensor to chip according to the diagram:
Set up the Raspberry Pi
Enable SSH
Use password authentication
Wire the moisture sensor to chip according to the diagram:
Welcome to your board!
A board is the signal wire hub of a robot that provides access to general purpose input/output (GPIO) pins: a collection of pins that can receive electrical signals.
You can control the flow of electricity to these pins to change their state between “high” (active) and “low” (inactive), and wire them to send digital signals to and from other hardware.
preview!
Set up the air monitoring sensor
GPIO 4 (3V) to VCC (Power)
GPIO 6 (GND) to GND (Ground)
GPIO 8 (TX) to RX (receiver)
GPIO 10 (RX) to TX (transmitter)
Wire the moisture sensor to chip according to the diagram:
Set up the air filter
Make sure the airflow arrow points toward the fan
Wire the moisture sensor to chip according to the diagram:
Set up the smart plug
Identify the IP address using `python-kasa` from the command line
Wire the moisture sensor to chip according to the diagram:
Set up the Raspberry Pi
Install Raspberry Pi OS
Connect with SSH
Enable communication protocols
Wire the moisture sensor to chip according to the diagram:
Let's start configuring!
Configure the machine
Log in to app.viam.com
Add a machine
Install `viam-server` on the Raspberry Pi
Wire the moisture sensor to chip according to the diagram:
Add the Raspberry Pi
Add component > board > Pi5
Wire the moisture sensor to chip according to the diagram:
Add the air sensor
Add component > sensor > air:pms7003
Wire the moisture sensor to chip according to the diagram:
Add the smart plug
Add component > generic > kasa:switch
Configure the plug IP address
Wire the moisture sensor to chip according to the diagram:
Testing components:
CONTROL
Test your air sensor in the CONTROL tab by verifying the GetReadings function returns values
Testing components:
CONTROL
Test your smart plug in the CONTROL tab by sending a DoCommand()
Let's try some code!
Use a control logic module
Use `control-air-quality` module
Configure module
Wire the moisture sensor to chip according to the diagram:
Congrats on building your air quality monitor!
🗣️ Now what?
Additional Viam resources
What will you build next?