Difference between revisions of "VINDRIKTNING"

From RevSpace
Jump to navigation Jump to search
(Hardware)
m (Hardware)
(8 intermediate revisions by the same user not shown)
Line 12: Line 12:
 
== Hardware ==
 
== Hardware ==
 
* power is by USB-C probably 5V
 
* power is by USB-C probably 5V
* the particulate matter sensor is the [https://en.gassensor.com.cn/ParticulateMatterSensor/info_itemid_105.html Cubic PM1006K]
+
* the particulate matter sensor is the PM1006, probably very similar to the [https://en.gassensor.com.cn/ParticulateMatterSensor/info_itemid_105.html Cubic PM1006K] but with a slightly different command set
* appears to have two LEDs (red and green) so it can indicate colours green, orange and red
+
* has LEDs for three colours (red, orange and green)
* the sensor output can be PWM or UART, the UART output provides PM1.0 PM2.5 and PM10 values
+
* has a light level sensor
 +
* the sensor output can be PWM or UART, the UART output provides a PM2.5 value
  
 
Pictures of its internals:
 
Pictures of its internals:
Line 27: Line 28:
 
https://threadreaderapp.com/thread/1415291684569632768.html
 
https://threadreaderapp.com/thread/1415291684569632768.html
  
 +
[https://pbs.twimg.com/media/E6QmjekX0AIG_WL.jpg VINDRIKTNING Schematic] by Adam Hořčica
 +
 +
=== Interfacing with ESP8266 ===
 
The datasheet of the PM1006K mentions that it takes 5V as power and communicates using 4.5V levels.
 
The datasheet of the PM1006K mentions that it takes 5V as power and communicates using 4.5V levels.
 
The reverse-engineered schematic shows resistors in line with the RX and TX lines.
 
The reverse-engineered schematic shows resistors in line with the RX and TX lines.
Line 36: Line 40:
 
Find out if it can be read out, perhaps reprogram it.
 
Find out if it can be read out, perhaps reprogram it.
  
Idea: by default, the light only shows one quality indicator, but the particulate matter sensor datasheet shows that it can output PM1.0, PM2.5 and PM10 values too. You could fit an ESP8266 that reads out the raw PM categories and publish them over WiFi, e.g. using a home assistant compatible protocol.
+
Idea: Fit an ESP8266 that reads out the raw PM value and publish it over WiFi, e.g. using a home assistant compatible protocol.
 +
 
 +
With no PM1006 attached at all, the sensor indicates "green", or good air quality!
 +
 
 +
The plan:
 +
* Remove the existing microcontroller entirely
 +
* Solder wires to the internal pads and attach a Wemos D1 mini, so (for example) the serial line resistors currently in place can be of use to limit 5V/3.3V interface issues.
 +
* Read out the PM1006, publish over WiFi
 +
* Add fancier LED effects
 +
 
 +
=== Protocol ===
 +
Mentioned [https://threadreaderapp.com/thread/1415291684569632768.html here], the MCU sends
 +
  11 02 0B 01 E1
 +
This is different from the command mentioned in the PM1006K data sheet!
  
 
== Software ==
 
== Software ==
Some intial, untested code for an ESP8266 (Wemos D1 mini) to communicate with the PM1006K sensor inside this device can be found at
+
Some intial, untested code for an ESP8266 (Wemos D1 mini) to communicate with the PM1006 sensor inside this device can be found at
https://github.com/bertrik/pm1006k
+
https://github.com/bertrik/pm1006
  
 
The hardware probably needs a level shifter in line with the RX and TX signals.
 
The hardware probably needs a level shifter in line with the RX and TX signals.

Revision as of 12:11, 4 August 2021

Project VINDRIKTNING
VINDRIKTNING.png
Hacking IKEA VINDRIKTNING PM2.5 indicator
Status In progress
Contact bertrik
Last Update 2021-08-04

What

This page is about hacking the IKEA VINDRIKTNING PM2.5 indicator light.

Hardware

  • power is by USB-C probably 5V
  • the particulate matter sensor is the PM1006, probably very similar to the Cubic PM1006K but with a slightly different command set
  • has LEDs for three colours (red, orange and green)
  • has a light level sensor
  • the sensor output can be PWM or UART, the UART output provides a PM2.5 value

Pictures of its internals: https://twitter.com/guido_burger/status/1413900622919872521

  • there is a footprint for a kind of debug header, with signals ISPDA, RESET, ISPCLK, GND, +5V
  • there is an internal header with signals LED_G_1, PWM_Fan, LED_R_1, FAN-, FAN+
  • there is a separate header for the fan with signals FAN+,FAN-
  • there is an 8-pin IC, could this be the "main" microcontroller?
  • there is a light-sensing element, that controls the brightness of the LED

More pictures of its internals, with reverse-engineered schematics: https://threadreaderapp.com/thread/1415291684569632768.html

VINDRIKTNING Schematic by Adam Hořčica

Interfacing with ESP8266

The datasheet of the PM1006K mentions that it takes 5V as power and communicates using 4.5V levels. The reverse-engineered schematic shows resistors in line with the RX and TX lines. An ESP8266 should be 5V tolerant. This means that it is probably possible to directly connect an ESP8266 in place of the original microcontroller.

Hacking

The microcontroller is an ES7P001.

Find out if it can be read out, perhaps reprogram it.

Idea: Fit an ESP8266 that reads out the raw PM value and publish it over WiFi, e.g. using a home assistant compatible protocol.

With no PM1006 attached at all, the sensor indicates "green", or good air quality!

The plan:

  • Remove the existing microcontroller entirely
  • Solder wires to the internal pads and attach a Wemos D1 mini, so (for example) the serial line resistors currently in place can be of use to limit 5V/3.3V interface issues.
  • Read out the PM1006, publish over WiFi
  • Add fancier LED effects

Protocol

Mentioned here, the MCU sends

 11 02 0B 01 E1

This is different from the command mentioned in the PM1006K data sheet!

Software

Some intial, untested code for an ESP8266 (Wemos D1 mini) to communicate with the PM1006 sensor inside this device can be found at https://github.com/bertrik/pm1006

The hardware probably needs a level shifter in line with the RX and TX signals.