Skip to content

lollo03/IKEA-VINDRIKTNING-mod-by-Lollo

Repository files navigation

IKEA VINDRIKTNING

Image

Within this repository, I gather codes and resources related to modifying the IKEA VINDRIKTNING, an affordable air quality sensor capable of measuring PM 2.5 concentration. The sensor indicates air quality through 3 LEDs on the front panel. However, it lacks any Wi-Fi functionality, making it rather limited on its own.

Nevertheless, since it is based on the PM1006 sensor, it is possible, through a simple hardware modification, to extract data and enhance the product's capabilities. This modification is extensively documented, and some resources are available at the end of this README.

For a deeper understanding of the modification process, please refer to the README.old.md file in this repository.

The code within this repository has been written and tested to function on the az-delivery D1 mini, a board based on ESP8266 with Wi-Fi capabilities, can be powered at 5V, with compact dimensions allowing it to fit inside the device case.

SensorToSerial

In the sensorToSerial folder, you will find the sensorToSerial.ino file, a sketch that, once compiled and uploaded, prints the sensor-detected data to the serial monitor.

webServer

In the webServer folder, you'll find the webServer.ino sketch, which includes a basic web server capable of presenting fundamental information, such as the last detected value, the maximum value, and the number of readings. The sketch is currently configured to connect to Wi-Fi using a static IP, but this option can be easily disabled by removing some lines of code.

toMySql

Within the toMySql folder, two subfolders exist:

  • webClient contains the sketch to enable the ESP8266 to contact the remote server.
  • server contains the server written in node.js that handles requests and writes everything to a MySQL database.

The server folder also includes a DOCKERFILE to facilitate deployment via Docker. An interesting application is to collect data in the database and visualize it using Grafana. Below is a screenshot of my dashboard. The toMySql folder also contains the grafana.json file, which is the configuration of the aforementioned dashboard.

The node.js server is also published as a docker image, if you want to skip the build process. This is an example of deployment using docker-compose and maria db

name: airquality
services:
    airquality-backend:
        restart: unless-stopped
        ports:
            - 86:80
        image: lollo03/ikea-vindriktning-server
        environment:
         - mariadb_host=DATABASE
         - mariadb_user=user
         - mariadb_password=password
         - mariadb_database=airquality

Before deploying remember to create the database and the table structure using the mysql_schema.txt file

Screenshot

Future Developments:

  • Adding other sensors like ENS160 + AHT21 to gather additional data

Sources: