I’ve had some previous experience with a temperature sensor on a few other boards:
Adafruit Huzzah temperature sensor
So this project seemed staright forward. The circuit diagram is:
and the code you will find here:
https://github.com/directorcia/Azure/blob/master/Iot/Keyestudio%20KS0172/Lesson_7/main.cpp
When I tried to use a generic DHT sensor library from the Platformio registry for the project wouldn’t work. I therefore needed to work out how to use thr provide library with Platformio. Turns out that is much easier than I thought!
- Inside your PlatformIO project, navigate to the lib/ directory.
- Create a new folder, e.g., MyLibrary/.
- Inside MyLibrary/, add your library files:
lib/
├── MyLibrary/
│ ├── src/
│ │ ├── MyLibrary.h
│ │ ├── MyLibrary.cpp
│ ├── library.json (optional) - In your src/main.cpp, include the library:
#include <MyLibrary.h> - PlatformIO will automatically detect and include the library.
This worked a treat and allowed my code to compile. Major learning there.

One thought on “Keyestudio KS0172–Humidity Sensor”