Home » Business » Czech Wi-Fi board for cheap dust sensor Ikea Vindriktning – Živě.cz

Czech Wi-Fi board for cheap dust sensor Ikea Vindriktning – Živě.cz


Swedish Ikea started selling a tiny sensor last spring air quality in the apartment Vindriktning. White box powered via USB-C using colored LEDs draws attention to the degree of dust in the apartment, there is a small suction 5V fan and a PM2.5 Cubic PM1006 particle sensor hidden under the hood, which communicates via the UART serial line.

On the plane, that sensor is not the most accurate, but for the basic orientation and quality traffic light (green, orange and red) richly enough. If you would like to build a much more accurate dust detector, even for outdoor installation, a more advanced SPS30 sensor from Sensirion is available as a basis.

Click for larger imageClick for larger imageClick for larger image
Ikea Vindriktning continuously measures air quality and displays the status in color on the front display

Czech motherboard with ESP32 chip

But while you pay over a thousand crowns for a plain SPS30 engineering module, Ikea Vindriktning ridiculous 249 ducks. That’s why a bunch of DIY and craftsmen bought it over the last six months, and some of them made it on Twitter. practically perfect disassembly. Electronics designers from the Czech e-shop for do-it-yourselfers LaskaKit soon sensed an opportunity.

Click for larger imageClick for larger imageClick for larger imageClick for larger image
Disassembly of Vindriktning and its narrow motherboard with control chip Eastsoft ES7P001

They designed a prototype of their own and dimensionally compatible control board, which instead of a simple 8bit microcontroller ES7P001 (8 kB ROM, 1 kB RAM) equipped with a popular and much more powerful Wi-Fi SoC ESP32-WROOM-32 with two 32-bit computing cores and a pile of flash and RAM for virtually any measurement program.

Click for larger image
Czech board from LaskaKit for Vindriktning

The first batch in February

The board was originally supposed to be available at the end of January, but production in Asia has dragged on, so do-it-yourselfers will have to wait until at least mid-February.

In any case, those interested will be able to order it for 498 crowns (according to the website, the first batch is sold out). Together with Vindriktning, which is naturally not part of the package, then the entire investment will cost 747 crowns.

There is also a color LED and an outlet for the I²C bus

The board again includes a set of colored LEDs, and in LaskaKit they didn’t forget about the standard prototyping pins with a pitch of 2.54 mm, on which they brought out a 3.3V power supply and an I²C bus. The DIY can connect other sensors to the board – for example, a thermometer, hygrometer, barometer, luxmeter and CO₂ sensor.

Click for larger imageClick for larger imageClick for larger imageClick for larger image
Six color LEDs (2 for each shade). USB / UART converter CH340 for easy programming via USB and Arduino environment, fan and dust sensor connectors and solder holes with I²C bus signals and 3.3V power supply

It might not be a good idea to bring one or two more GPIOs in addition to IC. Maybe he would be there with a little engineering magic they still came in. The ESP32 chip has blessed ones, and we could then include in the game, for example, a tiny buzzer that starts beeping when there is a lot of dust.

There is a lot of space in the plastic box itself, because the fan and the dust sensor occupy only about the interior space. LaskaKit recommends, for example, the use of a small CO₂ sensor SCD41 from Sensirion, which communicates on the I²C bus, and the authors have also prepared a functional example for it in Arduino, which they exhibited on GitHub.

Click for larger imageClick for larger imageClick for larger image
Replacement of the original motherboard with a new one with a powerful Wi-Fi chip

On GitHub you will also find all the hardware documentation of the board, including wiring diagrams. LaskaKit released it under the free license of MIT, so experienced craftsmen can freely improve the basic design.

You can flash the board directly from Arduino

In the end, you will also find on GitHub basic demonstration project (pm1006.ino) for Arduino, which measures concentration in an infinite loop, writes the data through a serial line to a computer and sets the color of the LED.

After replacing the boards, all you have to do is connect Vindriktning via USB-C to the computer, start the Arduino with the ESP32 chip support installed and select the generic ESP32 Dev Module.

Click for larger image
Successful connection with the ESP32 chip, uploading firmware from Arduino and listing the concentration in the serial terminal on the PC. The dust concentration is low, so the light glows green

LaskaKit has equipped the USB / UART board with the CH340 converter, so the board will report as a serial device when connected to a PC, and you will also have output via a serial line. In short, it behaves like any other prototyping board with an ESP32 chip.

You have access to all LEDs, fans and sensors

On the preliminary prototype, which the authors sent to the editorial office, the pins of the fan, dust sensor and LED system are connected as follows:

  • Fan: pin 12
  • Green LED: pin 25
  • Yellow LED: pin 26
  • Red LED: 27
  • Dust sensor: secondary serial line of the ESP32 RX2 (16) and TX2 (17) chip

The DIY can then, in its program, set the logic states on these pins to control both the switching of the individual lights and the fan, which should be started for just a few seconds so that the chamber is filled with fresh ambient air. After measuring the particle concentration, you can turn it off again.

Click for larger imageClick for larger image
Strong red and green LEDs. The yellow in the middle of the prototype glows only dimly and together with the active green LEDs they have to create an orange

As for the communication with the dust sensor itself, LaskaKit in its examples on GitHub is based on this library from Bertik, so your application code can be even shorter.

The basic program, which measures the concentration of dust particles every 10 seconds, writes the value to a serial line and sets the color of the status light (taken from the GitHub project):

// Knihovna pro praci s cidlem PM1006
// Soubory pm1006.h a pm1006.cpp najdete na GitHubu projektu:
// https://github.com/LaskaKit/ESP-Vindriktning/tree/main/SW/ESP-Vindriktning_SCD41
#include "pm1006.h"

#define PIN_FAN 12    // Ovladani ventilatoru
#define PIN_LED_G 25  // Zelena LED
#define PIN_LED_Y 26  // Zluta LED
#define PIN_LED_R 27  // Cervena LED
#define RXD2 16       // Seriova linka RX prachoveho cidla 
#define TXD2 17       // Seriova linka TX prachoveho cidla

// Objekt prachoveho cidla
static PM1006 pm1006(&Serial2);

// Hlavni funkce setup se zpracuje po spusteni cipu
void setup() {
  Serial.begin(115200); // Nastartuj seriovou linku do PC rychlosti 115 200 b/s
  Serial2.begin(9600, SERIAL_8N1, RXD2, TXD2); // Nastartuj sekundarni seriovou linku do prachoveho cidla rychlosti 9 600 b/s

  pinMode(PIN_FAN, OUTPUT);   // Nastaveni pinu ventilatoru na zapis
  pinMode(PIN_LED_G, OUTPUT); // Nastaveni pinu zelene LED na zapis
  pinMode(PIN_LED_R, OUTPUT); // Nastaveni pinu cervene LED na zapis
  pinMode(PIN_LED_Y, OUTPUT); // Nastaveni pinu zlute LED na zapiss
}

// Funkce loop se opakuje stale dokola
// Spusti se po zpracovani funkce setup 
void loop() {
  digitalWrite(PIN_FAN, HIGH); // Zapni ventilator
  Serial.println("Zapinam vetracek");
  delay(10000); // Nech jej 10 sekund nasavat vzduch

  // Zmer koncentraci prachovych castic PM2.5
  // A pokud se to podari, vypis ciselnou hodnotu do seriove linky
  uint16_t pm2_5;
  if (pm1006.read_pm25(&pm2_5)) {
    Serial.printf("PM2.5 = %un", pm2_5);
  }
  else {
    Serial.println("Neco se rozbilo, nelze precit data :-(n");
  }
  delay(1000);
  digitalWrite(PIN_FAN, LOW); // Vypni ventilator
  Serial.println("Vypinam vetracek");


  // Podle koncentrace prachovych castic 
  // nastav zelene, oranzove (zelena+zluta), nebo cervene svetlo 
  if (pm2_5 < 30) {
    digitalWrite(PIN_LED_G, HIGH);
    digitalWrite(PIN_LED_Y, LOW);
    digitalWrite(PIN_LED_R, LOW);
  }

  if ((pm2_5 > 30) && (pm2_5 < 40)) {
    digitalWrite(PIN_LED_G, HIGH);
    digitalWrite(PIN_LED_Y, HIGH);
    digitalWrite(PIN_LED_R, LOW);
  }

  if ((pm2_5 > 40) && (pm2_5 < 80)) {
    digitalWrite(PIN_LED_Y, HIGH);
    digitalWrite(PIN_LED_G, LOW);
    digitalWrite(PIN_LED_R, LOW);
  }

  if ((pm2_5 > 80) && (pm2_5 < 90)) {
    digitalWrite(PIN_LED_Y, HIGH);
    digitalWrite(PIN_LED_R, HIGH);
    digitalWrite(PIN_LED_G, LOW);
  }

  if (pm2_5 > 90) {
    digitalWrite(PIN_LED_R, HIGH);
    digitalWrite(PIN_LED_Y, LOW);
    digitalWrite(PIN_LED_G, LOW);
  }

  // Pockej 10 sekund a vse opakuj
  delay(10000);
}

A good example of a professional DIY

The basic statement of concentration to the PC via a serial line worked for us, and since we have the tremendous performance of a dual-core Wi-Fi chip, we could further program continuous data transfer, for example somewhere on the web, or connect the sensor to one of the smart home systems. in case of exceeding the concentration, it activates the ventilation of the air in the apartment, etc.

We’ve worked with Wi-Fi and ESP32 chips in Arduino many times in our series, so we’ll leave these games to you. The board itself works, it worked and it is a beautiful example of the DIY principle – Do it yourself, when using a professionally made alternative plate, we will raise the original product to a whole new level.

Leave a Comment