Template: SGP40 VOC Sensor Ar Guide

From Waveshare Wiki
Jump to: navigation, search

Arduino

Hardware connection

SGP40 VOC Sensor wiki arduino1.png

Install Arduino IDE

Please download the IDE from the Arduino website and install it.

Test the codes

Download the demo codes from the Resources part and unzip them.
This demo is written based on the Arduino library version, so you need to copy the demo to the Arduino library directory. Copy the Waveshare_SGP40 folder in the Arduino directory from the next week's files to the Libraries folder in the Arduino installation directory (C:\Users\XXX\Documents\Arduino\libraries or C:\Program Files (x86)\Arduino\libraries).
Open the Arduino IDE: Choose file -> example -> Waveshare_SGP40 and open it.
SGP40 VOC Sensor wiki arduino2.png
The Development board selects the appropriate model, selects the appropriate COM port, compiles the demo, downloads it to UNO, and opens the serial port monitor.
SGP40 VOC Sensor wiki arduino3.png
It is important to note that this value uses a converted value, where VOC is 0 under normal conditions. Unless the environment is harsh, alcohol can be used instead of volatile gas, and a greater sensitive beat can be obtained.