The first thing a microcontroller project must do is communicate, often with us humans. While the Trinket mini microcontroller does not have a serial monitor built in (like the Arduino Uno), it can talk over various protocols including software serial, I2C (two wire), and SPI. Adafruit sells a wide array of I2C devices including a backpack to interface with a number of nice liquid crystal (LCD) displays - perfect as it only requires two of the five Trinket pins.
Monitoring sensors is very common for Internet of Things (IoT) projects. Here we'll select the popular DHT series of temperature and humidity sensors.
This project can be placed in a very small enclosure and used anywhere environmental monitoring is needed. The code and concepts may be used in a number of your own projects.
This guide was first published on Sep 28, 2013. It was last
updated on Nov 15, 2018.
This page (Overview) was last updated on Feb 08, 2016.
Software Libraries Used
To maximize the functionality of software on Trinket, two Arduino software libraries need to be installed. See the All About Arduino Libraries tutorial for details on how to download and install these libraries.
Adafruit_LiquidCrystal library - this provides support for I2C displays that Adafruit sells
TinyDHT library - this library is optimized for the Atmel ATtiny processors like Adafruit Trinket and Arduino Gemma. It uses integer math to avoid pulling in the code-heavy floating point support libraries.