Do the LEDs work?
Yep, but only as in “it’s always green, except for when keeping it over smoke”.
Than your sensor is working fine
U have pictures of your wiring
You need to use sleep to only wake up the MCU when taking a reading. This will make the temperature accurate. Here’s an example esphome YAML that does so for a temp/humidity device I made.
Hi,
a short update on this. I bought a second one to have a reference. The older one had an offset of ca. 15 p2.5/m3 to the newer one. So I opened the housing and cleaned the input grid of the sensor. It had some dust accumulated, although the room is not very dusty (I have an air-purifier running most of the time). I used a small brush to do this. After that the sensors showed almost the same readings (1-2 p2.5/m3 difference). So I am quite happy now. But it is definitley necessary to clean the sensor from time to time.
Any ideas I got 1000 ug over and over again?
[19:08:26][D][pm1006:091]: Got PM2.5 Concentration: 1000 µg/m³
[19:08:26][D][sensor:124]: 'Air sensor': Sending state 1000.00000 µg/m³ with 0 decimals of accuracy
[19:08:28][D][pm1006:091]: Got PM2.5 Concentration: 1000 µg/m³
[19:08:28][D][sensor:124]: 'Air sensor': Sending state 1000.00000 µg/m³ with 0 decimals of accuracy
[19:08:30][D][pm1006:091]: Got PM2.5 Concentration: 1000 µg/m³
[19:08:30][D][sensor:124]: 'Air sensor': Sending state 1000.00000 µg/m³ with 0 decimals of accuracy
[19:08:33][D][pm1006:091]: Got PM2.5 Concentration: 1000 µg/m³
[19:08:33][D][sensor:124]: 'Air sensor': Sending state 1000.00000 µg/m³ with 0 decimals of accuracy
[19:08:35][D][pm1006:091]: Got PM2.5 Concentration: 1000 µg/m³
[19:08:35][D][sensor:124]: 'Air sensor': Sending state 1000.00000 µg/m³ with 0 decimals of accuracy
[19:08:56][D][pm1006:091]: Got PM2.5 Concentration: 1000 µg/m³
[19:08:56][D][sensor:124]: 'Air sensor': Sending state 1000.00000 µg/m³ with 0 decimals of accuracy
[19:08:57][D][pm1006:091]: Got PM2.5 Concentration: 1000 µg/m³
[19:08:57][D][sensor:124]: 'Air sensor': Sending state 1000.00000 µg/m³ with 0 decimals of accuracy
[19:08:59][D][pm1006:091]: Got PM2.5 Concentration: 1000 µg/m³
[19:08:59][D][sensor:124]: 'Air sensor': Sending state 1000.00000 µg/m³ with 0 decimals of accuracy
[19:08:59][D][sensor:124]: 'WiFi Signal Sensor': Sending state -57.00000 dBm with 0 decimals of accuracy
[19:09:01][D][pm1006:091]: Got PM2.5 Concentration: 1000 µg/m³
[19:09:01][D][sensor:124]: 'Air sensor': Sending state 1000.00000 µg/m³ with 0 decimals of accuracy
[19:09:03][D][pm1006:091]: Got PM2.5 Concentration: 1000 µg/m³
[19:09:03][D][sensor:124]: 'Air sensor': Sending state 1000.00000 µg/m³ with 0 decimals of accuracy
[19:09:05][D][pm1006:091]: Got PM2.5 Concentration: 1000 µg/m³
[19:09:05][D][sensor:124]: 'Air sensor': Sending state 1000.00000 µg/m³ with 0 decimals of accuracy
[19:09:08][D][pm1006:091]: Got PM2.5 Concentration: 1000 µg/m³
[19:09:08][D][sensor:124]: 'Air sensor': Sending state 1000.00000 µg/m³ with 0 decimals of accuracy
my code is pretty straightforward:
esphome:
name: air-sensor
esp8266:
board: d1_mini
# Enable logging
logger:
baud_rate: 0
# Enable Home Assistant API
api:
ota:
password: "0f5b5d0c4b4ff7c2dbd3ad4a23e003eb"
wifi:
ssid: "ssid"
password: "password"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Air-Sensor Fallback Hotspot"
password: "password"
captive_portal:
uart:
rx_pin: D2
baud_rate: 9600
sensor:
- platform: wifi_signal
name: "WiFi Signal Sensor"
update_interval: 300s
- platform: pm1006
pm_2_5:
name: "Air sensor"
thanks
What is the color of the LED on the device?
See this with a bad power supply (not enough Strong)
Red. I tried cleaning the sensor completely but no change. I think it should at least vary a little.
Ok, I will try different, thanks.
Hi, from some weeks I have a problem with the measurement: the sensor show always 0 ug/mc
(only some random jumps)… which could be the problem?
I would open it and would clean the sensor with an ear cleaning bud…
Hello!
I’m new to the “ESP” community and tinkering but experienced in electronics. My first project was the original Vindriktning + ESP8266 by Hypfer. That worked perfectly.
Next I thought why don’t I connect the PM1006 directly to the ESP and use ESP Home. So I completely removed the sensor from the Ikea board and wired the sensor to my ESP8266 D1 mini (clone).
The problem is, I can’t get any readings and get errors instead. Before you suggest to check wirings, I have and over and over again. Also checked IO definitions, RX/TX etc. in yaml code.
Connection is basically +5 V and GND to sensor from ESP board, RX and TX are connected to TX and RX on the D1 mini (yes, logger baudrate 0 to enable hw serial port). RX/TX are crossed. No errors in compiling but after the log output started (verbose) I get this error over and over again:
[08:55:13][V][pm1006:024]: sending measurement request
[08:55:14][V][pm1006:038]: Byte 0 of received data frame is invalid.
Serial port and sensor config:
[08:34:45][C][logger:275]: Logger:
[08:34:45][C][logger:276]: Level: VERBOSE
[08:34:45][C][logger:277]: Log Baud Rate: 0
[08:34:45][C][logger:278]: Hardware UART: UART0
[08:34:45][C][uart.arduino_esp8266:102]: UART Bus:
[08:34:45][C][uart.arduino_esp8266:103]: TX Pin: GPIO1
[08:34:45][C][uart.arduino_esp8266:104]: RX Pin: GPIO3
[08:34:45][C][uart.arduino_esp8266:106]: RX Buffer Size: 256
[08:34:45][C][uart.arduino_esp8266:108]: Baud Rate: 9600 baud
[08:34:45][C][uart.arduino_esp8266:109]: Data Bits: 8
[08:34:45][C][uart.arduino_esp8266:110]: Parity: NONE
[08:34:45][C][uart.arduino_esp8266:111]: Stop bits: 1
[08:34:45][C][uart.arduino_esp8266:113]: Using hardware serial interface.
[08:34:45][C][pm1006:017]: PM1006:
[08:34:45][C][pm1006:018]: PM2.5 'PM2.5'
[08:34:45][C][pm1006:018]: Device Class: 'pm25'
[08:34:45][C][pm1006:018]: State Class: 'measurement'
[08:34:45][C][pm1006:018]: Unit of Measurement: 'µg/m³'
[08:34:45][C][pm1006:018]: Accuracy Decimals: 0
[08:34:45][C][pm1006:018]: Icon: 'mdi:blur'
[08:34:45][C][pm1006:019]: Update Interval: 60.0s
Note that I also tried to map the serial port to different IO ports (and so it’s a sw serial port) but got the same error.
I have not tried to use rx-only mode (yet). But tried to connect the sensor back to the Ikea board and Hypfer setup and that still works so sensor is working still.
@Habbie might can help with this as I have never tried the TX/RX mode, only RX, and he has a better understanding how this should work.
can you try DEBUG
to see what it’s reading on RX?
Verbose should give more than debug and I also tried very_verbose but the uart component doesn’t seem to tell what it writes and reads, sadly.
I had it working for awhile, then when I put everything together in the case PM1006 stopped working. If it’s a connection error then it must be the sensor’s connector. I beeped everything else and if the connection is completely broken I don’t even get the error. So something is received… Any idea how the byte is invalid? I looked at the code but couldn’t figure that out.
You’re right about verbose doing more than debug, sorry about that mixup. However, VERY_VERBOSE really should log communication…
OK managed to get the uart to log the traffic (from this page: UART Bus — ESPHome)
[17:29:47][V][pm1006:024]: sending measurement request
[17:29:47][D][uart_debug:114]: >>> 11:02:0B:01:E1
[17:29:47][V][pm1006:038]: Byte 0 of received data frame is invalid.
[17:29:47][D][uart_debug:114]: <<< 00
[17:29:48][V][pm1006:038]: Byte 0 of received data frame is invalid.
[17:29:48][D][uart_debug:114]: <<< 00
So basically it receives nothing (null).
Is the sensor powered on correctly?
It gets +5 V from the D1 Mini as do other sensors connected to it. I will do more measurements and confirm the voltage level.