Thread Closed
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

[SOLVED] AQMIII: SDS011 not working
#1

I'm busy installing the fantastic new AQMIII but the SDS011 sensor refuses to cooperate even after putting it for a full hour in a microwave. Rolleyes

Anyways, the SDS011 does work on it's own with a generic library so I know it's not broken.

I do use the right software: IDE 1.8.15 and ESP32 1.06
Board selected in the IDE: LOLIN 32

The ESP32 is connected to the USB and a separate 5V power supply
(so I don't understand the brownout message)

I noticed that the fan of the SDS011 is not running and the LED only blinks ever ~8 sec.

ReadManual

Below the serial monitor output... and the Config.h file contents:
 
Code:
18:41:03.051 -> e⸮#ka+⸮⸮!H⸮⸮K⸮⸮⸮i⸮-⸮-⸮⸮vi!-⸮'⸮⸮#i!⸮⸮)⸮ ⸮⸮ ⸮⸮⸮  WeatherDuino 4Pro
18:41:03.383 -> Air Quality Monitor III
18:41:03.383 ->   Firmware: 6.1_b005
18:41:03.383 ->
18:41:03.880 -> Initializing the SDS011 sensor!
18:41:03.880 ->
18:41:04.908 -> 0,0,0,0,0,0,0,0,0,0
18:41:04.908 -> Calculate crc: 0
18:41:04.908 ->  Response crc: 0
18:41:04.908 -> SDS011 correctly set to active report mode.
18:41:04.908 ->
18:41:06.434 -> 0,0,0,0,0,0,0,0,0,0
18:41:06.434 -> Calculate crc: 0
18:41:06.434 ->  Response crc: 0
18:41:06.434 -> SDS011 correctly set to factory working period.
18:41:06.434 ->
18:41:06.434 ->
18:41:06.434 -> Connecting to anJe!
18:41:06.500 ->
18:41:06.500 -> Brownout detector was triggered
18:41:06.500 ->
18:41:06.500 -> ⸮I
18:41:06.500 -> ⸮:⸮C⸮;{ck⸮⸮⸮⸮K`⸮b)⸮)    aHh⸮i%=Z⸮$+⸮)HF⸮(!⸮"⸮#⸮  WeatherDuino 4Pro
18:41:06.865 -> Air Quality Monitor III
18:41:06.865 ->   Firmware: 6.1_b005
18:41:06.865 ->
18:41:07.329 -> Initializing the SDS011 sensor!
18:41:07.329 ->
18:41:08.358 -> 0,0,0,0,0,0,0,0,0,0
18:41:08.358 -> Calculate crc: 0
18:41:08.358 ->  Response crc: 0
18:41:08.358 -> SDS011 correctly set to active report mode.
18:41:08.358 ->
18:41:09.883 -> 0,0,0,0,0,0,0,0,0,0
18:41:09.883 -> Calculate crc: 0
18:41:09.883 ->  Response crc: 0
18:41:09.883 -> SDS011 correctly set to factory working period.
18:41:09.883 ->
18:41:09.883 ->
18:41:09.883 -> Connecting to anJe!
18:41:10.082 -> ......................
18:41:12.271 -> WiFi connected!
18:41:12.271 -> IP address: 192.168.1.88
18:41:12.436 -> Get time OK.
18:41:12.436 -> UTC Time  : 1628527272
18:41:12.436 -> Local Time: Monday, 09 August 2021 17:41:12
18:41:12.436 -> Reading Temp, Hum and Pressure
18:41:12.436 -> Temperature: 25.36
18:41:12.436 -> Humidity: 52.99
18:41:12.436 -> Amb. Pressure: 1015.48
18:41:12.436 -> SL Pressure: 1015.59
18:41:12.436 ->
18:41:12.436 -> Setting measurement range to: 5000
18:41:12.436 -> FF,99,1,0,0,0,0,0,66,
18:41:12.436 -> 66,66
18:41:12.436 -> Measurement range changed!
18:41:15.388 -> Enabling ABC
18:41:28.389 -> Initial reading: 1
18:41:29.450 -> F8,FE,1E,FB,3F,68,2E,FC,3F,
18:41:29.450 -> Calculated crc: 18
18:41:29.450 -> Wrong reply from CO2 sensor!
18:41:29.450 ->
18:41:35.418 -> Initial reading: 2
18:41:35.485 -> FF,86,1,F4,49,0,0,0,3C,
18:41:35.485 -> Calculated crc: 3C
18:41:35.485 -> CO2 RAW: 500
18:41:35.485 -> CO2 Comp: 499
18:41:35.485 -> Z19 Temp: 33
18:41:35.485 ->
18:41:41.453 -> Initial reading: 3
18:41:41.519 -> FF,86,1,F4,4A,0,0,0,3B,
18:41:41.519 -> Calculated crc: 3B
18:41:41.519 -> CO2 RAW: 500
18:41:41.519 -> CO2 Comp: 499
18:41:41.519 -> Z19 Temp: 34
18:41:41.519 ->
18:41:47.485 -> Initial reading: 4
18:41:47.551 -> FF,86,1,F4,4A,0,0,0,3B,
18:41:47.551 -> Calculated crc: 3B
18:41:47.551 -> CO2 RAW: 500
18:41:47.551 -> CO2 Comp: 499
18:41:47.551 -> Z19 Temp: 34
18:41:47.551 ->
18:41:53.518 -> Initial reading: 5
18:41:53.551 -> FF,86,1,F4,4A,0,0,0,3B,
18:41:53.551 -> Calculated crc: 3B
18:41:53.551 -> CO2 RAW: 500
18:41:53.551 -> CO2 Comp: 499
18:41:53.551 -> Z19 Temp: 34
18:41:53.551 ->
18:41:59.520 -> Initial reading: 6
18:41:59.586 -> FF,86,1,F4,4A,0,0,0,3B,
18:41:59.586 -> Calculated crc: 3B
18:41:59.586 -> CO2 RAW: 500
18:41:59.586 -> CO2 Comp: 499
18:41:59.586 -> Z19 Temp: 34
18:41:59.586 ->
18:42:05.554 -> Initial reading: 7
18:42:05.620 -> FF,86,1,F4,4A,0,0,0,3B,
18:42:05.620 -> Calculated crc: 3B
18:42:05.620 -> CO2 RAW: 500
18:42:05.620 -> CO2 Comp: 499
18:42:05.620 -> Z19 Temp: 34
18:42:05.620 ->
18:42:11.587 -> Initial reading: 8
18:42:11.620 -> FF,86,1,F4,4A,0,0,0,3B,
18:42:11.620 -> Calculated crc: 3B
18:42:11.620 -> CO2 RAW: 500
18:42:11.620 -> CO2 Comp: 499
18:42:11.620 -> Z19 Temp: 34
18:42:11.620 ->
18:42:17.586 -> Initial reading: 9
18:42:17.652 -> FF,86,1,F4,4A,0,0,0,3B,
18:42:17.652 -> Calculated crc: 3B
18:42:17.652 -> CO2 RAW: 500
18:42:17.652 -> CO2 Comp: 499
18:42:17.652 -> Z19 Temp: 34
18:42:17.652 ->
18:42:23.621 -> Initial reading: 10
18:42:23.687 -> FF,86,1,F4,4A,0,0,0,3B,
18:42:23.687 -> Calculated crc: 3B
18:42:23.687 -> CO2 RAW: 500
18:42:23.687 -> CO2 Comp: 499
18:42:23.687 -> Z19 Temp: 34
18:42:23.687 ->
18:42:29.654 -> Initial reading: 11
18:42:29.687 -> FF,86,1,F4,4A,0,0,0,3B,
18:42:29.687 -> Calculated crc: 3B
18:42:29.687 -> CO2 RAW: 500
18:42:29.687 -> CO2 Comp: 499
18:42:29.687 -> Z19 Temp: 34
18:42:29.687 ->
18:42:35.653 -> Initial reading: 12
18:42:35.719 -> FF,86,1,F4,4A,0,0,0,3B,
18:42:35.719 -> Calculated crc: 3B
18:42:35.719 -> CO2 RAW: 500
18:42:35.719 -> CO2 Comp: 499
18:42:35.719 -> Z19 Temp: 34
18:42:35.719 ->
18:42:41.687 -> Initial reading: 13
18:42:41.753 -> FF,86,1,F4,4A,0,0,0,3B,
18:42:41.753 -> Calculated crc: 3B
18:42:41.753 -> CO2 RAW: 500
18:42:41.753 -> CO2 Comp: 499
18:42:41.753 -> Z19 Temp: 34
18:42:41.753 ->
18:42:47.722 -> Initial reading: 14
18:42:47.755 -> FF,86,1,F4,4A,0,0,0,3B,
18:42:47.755 -> Calculated crc: 3B
18:42:47.755 -> CO2 RAW: 500
18:42:47.755 -> CO2 Comp: 499
18:42:47.755 -> Z19 Temp: 34
18:42:47.755 ->
18:42:53.757 -> Init MH-Z19 Ended
18:42:53.757 ->
18:42:53.757 ->
18:42:53.757 -> Waking up the dust sensor...
18:42:53.757 -> Reading will be done 40s later.
18:42:53.757 ->
18:43:22.362 -> Reading Temp, Hum and Pressure
18:43:22.362 -> Temperature: 25.36
18:43:22.362 -> Humidity: 52.99
18:43:22.362 -> Amb. Pressure: 1015.47
18:43:22.362 -> SL Pressure: 1015.59
18:43:22.362 ->
18:43:33.733 -> Fan State: 1
18:43:33.733 -> Reading the dust sensor...
18:43:34.827 -> D,80,70,1F,FB,3F,68,2E,FC,3F,
18:43:34.827 -> Calculate crc: 5F
18:43:34.827 ->  Response crc: FC
18:43:34.827 ->
18:43:34.827 -> Wrong reply from SDS011 sensor!
18:43:34.827 -> FF,86,2,82,49,0,0,0,AD,
18:43:34.827 -> Calculated crc: AD
18:43:34.827 -> CO2 RAW: 642
18:43:34.827 -> CO2 Comp: 641
18:43:34.827 -> Z19 Temp: 33
18:43:34.827 ->
18:43:34.827 -> CO2 1H Avg: 641
18:45:32.352 -> Reading Temp, Hum and Pressure
18:45:32.352 -> Temperature: 25.36
18:45:32.352 -> Humidity: 52.72
18:45:32.352 -> Amb. Pressure: 1015.46
18:45:32.352 -> SL Pressure: 1015.58
18:45:32.352 ->

this is the Config.h file:
 
Code:
// --------------------------------------------------------------------------------------
//   WeatherDuino - Air Quality Monitor III v6.1_b005
//              User Configurable Options
// --------------------------------------------------------------------------------------

// --------------------------------------------------------------------------------------
//   Define StationID of this device - Used when sending data by RF to a compatible WeatherDuino receiver
// --------------------------------------------------------------------------------------
const byte Station_ID  = 0xA1;           // Must be equal to your RX Unit (Value from 0x00 to 0xFF)  
const byte Unit_ID     = 0;              // 0 or 1


// --------------------------------------------------------------------------------------
//   Define a unique ID for each AQM unit (used to identify unit for OTA upload). No spaces or special chars.
// --------------------------------------------------------------------------------------
const char* Device_Name = "My_AQM";


// --------------------------------------------------------------------------------------
//   Location Elevation
// --------------------------------------------------------------------------------------
#define ELEVATION                          1   // Define the height above sea level of the place where sensor is installed (value in Meters without decimal places)


// --------------------------------------------------------------------------------------
//   Define type of Dust sensor
// --------------------------------------------------------------------------------------
#define DUST_SENSORTYPE  1    // 0= PMS7003, 1= nova SDS011, 2 = Sensirion SPS30 (working in I2C mode)


// --------------------------------------------------------------------------------------
//   The settings bellow, define the Air Quality Standard and Average Mode that will be used to calculate the Air Quality Index show on the OLED display, if used.
//
//   If this unit is used to send data by RF (OOK only) to a Pro2 PLUS or Pro2 Compact receiver, then the PRO2_MODE setting SHOULD be set to 1,
//   and other settings will define the AQI Standard and Average Mode that is sent to Pro2 PLUS and Pro2 Compact receivers.
//   Settings on the receiver, MUST match the settings defined here.
//
//   If this unit is used to send data (RF or WiFi) to a 4Pro receiver, then the PRO2_MODE setting SHOULD be set to 0.
//   With WeatherDuino 4Pro receivers the AQI Standard and Average Mode is set on the receiver,
//   and can be different of the settings defined here.
//
// --------------------------------------------------------------------------------------
#define AQI_STANDARD   1   //  0= USA (AQI-EPA), 1= EUROPE (EAQI), 2= UK (DAQI), 3= AUSTRALIA (AQC - NSW)
#define AQ_AVGMODE     2   //  1= 1 Hour Average, 2= 3 Hours Average, 3= Nowcast 12H, 4= 24 Hours Average

#define PRO2_MODE      1   //  0= Use 0 to send data to 4PRO receivers, 1= Compatibility mode for Pro2 PLUS and Pro2 Compact receivers


// --------------------------------------------------------------------------------------
//   Define type of CO2 sensor
// --------------------------------------------------------------------------------------
#define CO2_SENSORTYPE  2    // 0= Not instaled, 1= Sensirion SDC30, 2= MH-Z19


// --------------------------------------------------------------------------------------
//   Settings for the Sensirion SCD30 - CO2 Sensor
// --------------------------------------------------------------------------------------
// The sensirion SDC30 compensate the CO2 readings by using one of two methods: Atmospheric Pressure or a fixed Altitude value.
// Define bellow which one you want to use.
#define SDC30_ELEVATION_CALIBRATION_METHOD   0   // 0= Elevation defined above, 1= Atmospheric Pressure from BME280 sensor (overrides ELEVATION)

// If the SDC30 is intalled, system will use its high quality built-in Temperature / Humidity sensor. BME280 will be used only for Atmospheric Pressure.
// Optionally we can set a temperature offset up to 5.0 °C, stored in non-volatile memory of SCD30
const float SCD30_TemperatureOffset = 2.0;       // Format: float


// --------------------------------------------------------------------------------------
//   Settings for the MH-Z19 - CO2 Sensor
// --------------------------------------------------------------------------------------
#define Z19_MODEL       2    // 1= Model A, 2= Model B  (ATTENTION: Make sure you select the correct model)                            

#define ENABLE_ABC      1    // 0= Disable (Better for outdoor use), 1= Enable

// Set measure range                              
#define Z19_RANGE       5    // Don't change (Keeps default factory range 0..5000 ppm)
                             // Valid values for Model A: 1= 1000ppm, 2= 2000ppm, 3= 3000ppm, 5=5000ppm
                             // Valid values for Model B: 2= 2000ppm, 5= 5000ppm

const int16_t CO2_OffSet =  0;  // Fine adjust to compensate sensor error (This value should be determined case by case. Values between -50 and 50)


// --------------------------------------------------------------------------------------
//   Temperature Offset
//
//   Note: Applies only when not using the Sensirion SCD30 CO2 sensor!
// --------------------------------------------------------------------------------------
const float Temperature_Offset =  0;   // Temperature Fine Adjust in ºC


// --------------------------------------------------------------------------------------
//   Define use of OLED Display
// --------------------------------------------------------------------------------------
#define USE_DISPLAY       0   // 0= No Display, 1= Use Display


// --------------------------------------------------------------------------------------
//   Define use of LED 1 (Led will Fade IN / Fade OUT sinalizing system is running)
// --------------------------------------------------------------------------------------
#define LED_FADE_EFFECT   1   // 0= No, 1= Yes


// --------------------------------------------------------------------------------------
//   Enable / Disable RF data transmission
// --------------------------------------------------------------------------------------
#define RF_TXMODE        2    // 0= No data will be transmitted via RF, 1= Transmit LoRa Mode (4Pro Receivers), 2= Transmit OOK Mode (Pro2 Receivers)



// ======================================================================================
//   The WeatherDuino AQM-III can work with or without WiFi connection, however
//   many of its functions, like OTA programming, system clock, data upload and others
//   will only work if there is WiFi connection.
// ======================================================================================

// --------------------------------------------------------------------------------------
//   Enable / Disable WiFi connection
// --------------------------------------------------------------------------------------
#define ENABLE_WIFI         1                  // 1= Enable, 0= Disable


// ======================================================================================
//   Functions from this point bellow only work with WiFi connection active
// ======================================================================================

// --------------------------------------------------------------------------------------
//   Define Timezone and rules for auto Summer Time clock adjust
//
//   System can use POSIX standard format, or a simpler format.
//   Choose and set the one you prefer
// --------------------------------------------------------------------------------------
// Examples:
// In North American Eastern Standard Time (EST) and Eastern Daylight Time (EDT), the normal offset from UTC is 5 hours.
// Since this is west of the prime meridian, the sign is positive (+5 = 5).
// Summer time begins on March’s second Sunday at 2:00am, and ends on November’s first Sunday at 2:00am.
//       TZ_info = "EST+5EDT,M3.2.0/2,M11.1.0/2"
//
// Western Greenland Time (WGT) and Western Greenland Summer Time (WGST) are 3 hours behind UTC in the winter.
// Its clocks follow the European Union rules of springing forward by one hour on March’s last Sunday at 01:00 UTC (-02:00 local time)
// and falling back on October’s last Sunday at 01:00 UTC (-01:00 local time).  
//       TZ_info = "WGT3WGST,M3.5.0/-2,M10.5.0/-1"

//const char* TZ_info = "CET-1CEST,M3.5.0/2,M10.5.0/3";                   // --> France Timezone
//const char* TZ_info = "AZOT1AZOST,M3.5.0/01:00:00,M10.5.0/02:00:00";    // --> Açores, Portugal Timezone
const char* TZ_info = "WET0WEST,M3.5.0/01:00:00,M10.5.0/02:00:00";        // --> Portugal Timezone

const long gmtOffset_sec      = 0;
const int  daylightOffset_sec = 3600;

#define TIMEZONE_DEFTYPE     0    // 0= POSIX, 1= Simple GMT Offset and Summer Time Offset


// --------------------------------------------------------------------------------------
//   Prefered NTP Server - Enable only one
// --------------------------------------------------------------------------------------
#define TIMESERVER "pool.ntp.org"
//#define TIMESERVER "time.nist.gov"                 // ntp1.nl.net NTP server


// --------------------------------------------------------------------------------------
//   Defines port used by the buil-in webserver
//   Buil-in webserver provides a way to quickly view Air Quality data on a web browser.
//   Ex: 192.168.1.200/aqnow
// --------------------------------------------------------------------------------------
#define WEBSERVER_PORT     80                  // WebServer port (default 80)


// --------------------------------------------------------------------------------------
//   Enable / Disable data transmission to sensor.community
//   The AQM-III allows you to share Air Quality data from your location, with the sensor.community project.
//   Your sensor and data will be show on a map: https://maps.sensor.community/#2/0.0/0.0
//   Just register your sensor at https://devices.sensor.community/ and add your Sensor_UID to Credentials
// --------------------------------------------------------------------------------------
#define ENABLE_SC_UPLOAD   0                         // 1= Enable, 0= Disable


// --------------------------------------------------------------------------------------
//   Enable / Disable data transmission to ThingSpeak
// --------------------------------------------------------------------------------------
#define ENABLE_TS_UPLOAD   0                         // 1= Enable, 0= Disable


// --------------------------------------------------------------------------------------
// Air Quality Monitor - Upload and insert data in a SQL table at your own server ----
// Be sure you have already created the database and table. See AirQuality_LogToSQL.php script for info
// --------------------------------------------------------------------------------------
#define ENABLE_AQM_TO_MYSERVER    0                  // 1= Enable, 0= Disable



// ======================================================================================
//     Hardware Settings - Most likely there is no need to change anything here
// ======================================================================================

// --------------------------------------------------------------------------------------
//   OLED I2C Address - Default address will work most of the times!
// --------------------------------------------------------------------------------------
#define OLED_address 0x3C


// --------------------------------------------------------------------------------------
//   Board Type
// --------------------------------------------------------------------------------------
#define PCB_TYPE      1   // 1= Don't change !!!


// ======================================================================================
//   Debug helper - Uncomment for debug help
// ======================================================================================

#define PRINT_DEBUG_WIFI
#define PRINT_DEBUG_SYNCTIME
#define PRINT_DEBUG_DUSTSENSOR            
#define PRINT_DEBUG_CO2
#define PRINT_DEBUG_TH_SENSOR
#define PRINT_DEBUG_TS_UPLOAD
#define PRINT_DEBUG_MYSERVER_UPLOAD
#define PRINT_DEBUG_SENSORCOMMUNITY

// --------------------------------------------------------------------------------------
//  
// --------------------------------------------------------------------------------------
#2

Hi edr1924,

Lets check the SDS011 connection to AQM III

SDS011 TX -----> PMS/SDS TX
SDS011 RX -----> PMS/SDS RX

For board, use MH ET LIVE ESP32MiniKit

Code:
22:19:11.424 -> WeatherDuino 4Pro
22:19:11.424 -> Air Quality Monitor III
22:19:11.424 -> Firmware: 6.1_b005
22:19:11.424 ->
22:19:11.904 -> Initializing the SDS011 sensor!
22:19:11.904 ->
22:19:12.504 -> AA,C0,92,0,1,1,57,A8,93,AB
22:19:12.504 -> Calculate crc: 93
22:19:12.504 -> Response crc: 93
22:19:12.504 -> SDS011 correctly set to active report mode.
22:19:12.504 ->
22:19:13.504 -> AA,C0,99,0,FE,0,57,A8,96,AB
22:19:13.504 -> Calculate crc: 96
22:19:13.504 -> Response crc: 96
22:19:13.504 -> SDS011 correctly set to factory working period.

SDS011 initialize correctly. Anyway, I will double check if there is any other issue.

Rgs.
#3

Hi again edr1924,

By mistake I left a line of code on v6.1_b005, that should not be there. The error affect only users using the SDS011 sensor.
However, that line of code isn't the cause of the issue reported by you, which I believe is related to RX / TX connections.

The fix on v6.1_b005 is simple. On WeatherDuino_AQM_III_v6.1_b005, just delete the line 598.
Preferably, download the updated WeatherDuino_AQM_III_v6.1_b006

Rgs.
#4

Thank you Werk_AG for the update and your suggestions.
The support from you is amazing, very much appreciated!!

Well, I did check the wiring which was OK, used the new sketch vb006 but still no response.

Then I tried to send commands to the SDS011 apart from the AQMIII sketch and then the sensor did work!
So... after hours of trying the solution was to wake up the sensor BEFORE sending other commands like REPORTMODE etc.
It was confusing because the SDS011 from Werk_AG did work with the sketch?!

I think that I have a different version of the SDS011?  I read somewhere that different versions behave differently!

I'm glad that it does work now, a great addition to my WeatherDuino setup...


So, the modified code is this:

After Line 554, I inserted 2 lines:
Serial2.write(WAKEUPCMD, 19);        // Wakeup the sensor - turns the fan ON
delay(500);

 
Code:
//------------------------------------------------------------
  // Setup Dust Sensors
  //------------------------------------------------------------
#if (DUST_SENSORTYPE == 0)
  // Set the Pin used to control the SET function on PMS7003 (LOW = sleep mode)
  pinMode(PMS7003_SetPin, OUTPUT);
  digitalWrite(PMS7003_SetPin, LOW);
#endif

#if (DUST_SENSORTYPE == 1)
  Serial2.write(WAKEUPCMD, 19);        // Wakeup the sensor - turns the fan ON
  delay(500);
  Serial2.write(REPORTMODECMD, 19);    // Set Report Mode to factory default (active mode)
  delay(500);


 
Code:
WeatherDuino 4Pro
Air Quality Monitor III
  Firmware: 6.1_b006

Initializing the SDS011 sensor!

AA,C0,1D,0,8F,0,2B,40,17,AB
Calculate crc: 17
Response crc: 17
SDS011 correctly set to active report mode.

AA,C0,1A,0,69,0,2B,40,EE,AB
Calculate crc: EE
Response crc: EE
SDS011 correctly set to factory working period.
#5

Hello edr1924,

Since adding an Wakeup command before send any other command to the sensor, worked for you, it will work for others too. I don't see any problem in adding that line on next firmware release.

Quote:I think that I have a different version of the SDS011? I read somewhere that different versions behave differently!

I may be wrong, however as said by PM, I believe the issue only happen when the sensor was previously used with a software which sets the working period to something different than the default factory setting. If the working period was previously set to 30s per example, then, when the AQM III software tries to initialize it, the sensor still is in sleep mode. The working mode is stored on the sensor, and survives to a power down.

I should have predicted that possibility. Starting the sensor initialization with an Wakeup command makes sense.
Thank you for your experimentations and for sharing them.

Kind regards.
Thread Closed




Users browsing this thread: 1 Guest(s)