In this project we will build a simple temperature and humidity monitor with the Particle Photon 2. We will also learn how you can remotely log and monitor this data with the Particle console.
The Particle Photon 2 is build on the Feather form-factor which allows for easy prototyping using the Adafruit FeatherWing ecosystem. We will use a FeatherWing Doubler to add an OLED display. This display board has an onboard QWIIC connector which we will use to plug in the SHT40 temperature/humidity sensor.
The Photon 2 talks to the display and the sensor over the I2C bus. The only soldering you'll need to so is to solder the female headers on the FeatherWing Doubler. Rest of the build is plug-n-play.
FeatherWing DoublerThe display is a 128x64 OLED and uses the SH1107 as the driver (not SSD1306), but is just as easy to use and Adafruit provides libraries for it. This FeatherWing display also has a QWIIC connector on the back which makes it very easy to add sensors and peripherals.
SensorWe are using the Adafruit SHT40 sensor breakout board. The sensor operates at 3.3V and talks over I2C. We will hook up the sensor to the display FeatherWing using the QWIIC cable.
QWIIC cableWe will be using the (slightly modified) Adafruit libraries for the display and the sensor. You can download the entire project and simply open it in the Particle Workbench. From there you can compile and flash the project to your end device.
The firmware is fairly straight forward. We periodically read and display the sensor values on the OLED. These values are also made available as Particle variables that you can access from the console or via an API call. I had to change the folder structure of the libraries for them to compile in the Particle workbench. I have included all of them within the project repository.
To upload the firmware to your device, clone or download the GitHub repository mentioned at the end of this tutorial and open the folder in your Particle Workbench. You can then compile and flash the firmware over USB.
This is assuming that you have already setup up the Photon 2 and claimed it to your Particle account.
After uploading the firmware, you can access the temperature, humidity, and battery voltage measurements using the Particle console, Particle CLI, the Particle Workbench, or with a GET request.
The variables will appear in the Particle console as following. You can fetch the latest values by simply clicking on the GET button.
Comments