This blog assumes that you already have the required materials discussed in Blog #2: Gathering the Essentials: Materials for Your Classroom Indoor Air Quality Monitoring Project. Below are the steps for testing the individual components together with the SAMD21 Microcontroller and Arduino IDE.
I. Grove - Temperature & Humidity Sensor (DHT20)
- Prepare your Grove Temperature and Humidity DHT20 Sensor.
- Connect your Grove Temperature and Humidity DHT20 Sensor to the SAMD21 Microcontroller pins. We have four pins that need to be connected; 5V, GND, SDA, and SCL.
- Connect your Seeeduino XIAO SAMD21 Microcontroller to your PC or Laptop via a USB Type-C Cable.
- Download the Seeed DHT library from Github.
- Refer to "How to install library to install library" for Arduino.
- Open the “DHTtester” example via the path: File --> Examples --> Grove_Humidity_Temperature_Sensor-master --> DHTtester. Through this demo, we can read the temperature and relative humidity information of the environment.
- Upload the demo. If you do not know how to upload the code, please check how to upload the code.
- Open the Serial Monitor of Arduino IDE by clicking Tool-> Serial Monitor. Or tap the CTRL+SHIFT+M keyboard keys at the same time. if everything goes well, you will get the temperature and humidity readings.
II. RGB LED
- Prepare your RGB LED Sensor.
- Connect your RGB LED to the SAMD21 Microcontroller pins. We have four pins that need to be connected; GND, R, G, and B. In my case, the R, G, and B pins are digital pins which are connected to 10, 9, and 8 digital pins of SAMD21 MCU.
- Connect your Seeeduino XIAO SAMD21 Microcontroller to your PC or Laptop via a USB Type-C Cable.
- Download the Seeed DHT library from Github.
- Refer to "How to install library to install library" for Arduino.
- Open the “ Flash” example via the path: File --> Examples --> RGB --> Flash. Through this demo, we can make our RGB flash like a regular LED flasher circuit.
- Upload the demo. If you do not know how to upload the code, please check how to upload the code.
III. Buzzer
- Prepare your Buzzer Sensor.
- Connect your Buzzer to the SAMD21 Microcontroller pins. We have three pins that need to be connected; GND, 5V, and OUT. In my case, the OUT pin is a digital pin which is connected to digital pin 3 of SAMD21 MCU.
- Connect your Seeeduino XIAO SAMD21 Microcontroller to your PC or Laptop via a USB Type-C Cable.
- Open the “ Blink” example via the path: File --> Examples --> Basics--> Blink. Through this demo, we can make our Buzzer on and off like every second.
- Upload the demo. If you do not know how to upload the code, please check how to upload the code.
IV. MQ135 Gas Sensor
- Prepare your MQ135 Gas Sensor.
- Connect your MQ135 Gas Sensor to the SAMD21 Microcontroller pins. We have three pins that need to be connected; GND, 5V, and OUT. In my case, the OUT pin is an analog pin which is connected to analog pin A1 of SAMD21 MCU.
- Connect your Seeeduino XIAO SAMD21 Microcontroller to your PC or Laptop via a USB Type-C Cable.
- Download the MQ135 library from Github.
- Refer to "How to install library to install library" for Arduino.
- Open the “MQ135” example via the path: File --> Examples --> MQ135 --> MQ135. Through this demo, we can read the carbon dioxide information of the environment.
- Upload the demo. If you do not know how to upload the code, please check how to upload the code.
- Open the Serial Monitor of Arduino IDE by clicking Tool-> Serial Monitor. Or tap the CTRL+SHIFT+M keyboard keys at the same time. If everything goes well, you will get the carbon dioxide readings.