hackAir-Arduino
                                
                                 hackAir-Arduino copied to clipboard
                                
                                    hackAir-Arduino copied to clipboard
                            
                            
                            
                        Add native power savings support to DFRobot/PMS5003 sensor
Both these sensors have a SET pin that when pulled LOW puts the internal controller to sleep mode but it doesn't turn of the fan. Also sadly the DFRobot breakout PCB ties this to HIGH all the time. Support should be added to this.
Even if it doesn't work there won't be any harm since we will cut the power using the FET.
I noticed in the code that there is no stabilization time of around 30 seconds. The code fires up the PMS5003 and takes a reading right away...
The last page of the PMS10031 and PMS50032 datasheets shows some serial commands. They should put the sensor to sleep/wakeup or in passive/active mode.
I tried them on my own library, but I must have made a mistake, as the sensor did not go to sleep. Then, life got in the way and did not found out why it did not work...
1 The DFRobot sensor is actually a PMS1003, also sold under the name G1 dust laser senor. 2 The PMS5003 is also sold under the name G5 dust laser senor.