Project explains how to build home air quality monitoring station using ESP32. Feel free to use and share any code from this repository.
Project was developped using DOIT ESP32 DevKit V1 microcontroller with following sensors:
- Plantower PMS7003 Laser Dust Sensor with IDC Adapter
- BME280 Temperature, Humidity and Pressure Sensor
- DS3231 Real Time Clock + CR2032 Battery
- PL2303 USB to Serial
- Jumping Wires
- Breadboard
To compile sketch please download Arduino IDE and add following libraries either manually or through the Library Manager:
* Instead of OLED display, USB-UART can be used to visualize the data
In order to use ESP8266/ESP32 boards we have to add additional URL's into Boards Manager.
- Open Arduino IDE, go to Preferences and add following ESP cores into Additional Board Manager URLs (multiple paths can be added, we just need to separate them by commas).
- Confirm changes, go to main window and select Tools > Board:... > Boards Manager...
- Install esp8266 by ESP8266 Community and esp32 by Espressif Systems.
- When installation has been finished restart Arduino IDE.
- We are ready to use our boards.
* Complete installation instructions can be found under following links:
Many ESP8266 boards use CH340 chip to provide USB connectivity and in some cases users may need to install additional drivers. Select and download drivers from chip manufacturers website. Following procedures were successfully tested on macOS High Sierra and Windows 7. Ubuntu doesn't require drivers to be installed.
* Linux Users
- Linux users may need to run following command
sudo usermod -a -G dialout $USER
to allow non-root access to /dev/ttyUSB0. Reboot your system to apply changes. - If you are using python distributions other than default (i.e. anaconda/miniconda) you may need to install pySerial module first for your default distribution.
sudo /usr/bin/python2 -m pip install pyserial
Please be aware that project relies on DOIT ESP32 DevKit V1 and was not tested with any other ESP32 microcontroller. Pin definitions may be slightly different, please refer to your microcontroller datasheet and compare it with DOIT ESP32 DevKit V1.