ShaggyDog18 / SD_ZH03B

Arduino library for Winsen ZH03B Laser Dust Sensor Module for PM1.0, PM2.5 and PM10 measurement
GNU General Public License v3.0
17 stars 4 forks source link

ZH-06 IV support ? #2

Open BigValen opened 3 years ago

BigValen commented 3 years ago

It seems that Winsen are now shipping ZH06 if you try buy ZH03 devices. The spec sheet is pretty similar. Only difference I can see is that the message is 32 bytes long (with lots of reserved fields) instead of 24. I have a half-made patch to add ZH06 support to the library. It'd default to ZH-03 until you call "SetModel".

I'd rather get it working, before submitting a PR...but neither device I have emits anything yet. Not quite sure what's going on. Would it make sense to submit ZH06 support, once I have it working What's the best way to ?

ZH06-IV Laser Dust Module Manual Ver1.2.pdf

ShaggyDog18 commented 3 years ago

Hi BigValen, you are right they are very similar: same commands and answers, just 8 extra bytes in the response... My library may be easily adapted to support it.... Never appealed to the Winsen's support, so, do not have such an experience... Did you connect it right? You need just 4 pins: VCC, GND, TX, RX.

ShaggyDog18 commented 3 years ago

Hi John/BigValen, I've updated the library to support ZH06 (all based on the datasheet you shared). Please, test it since I do not have the new model. I did not create any new methods to set/change the sensor type. The sensor type is defined in the constructor; please, refer to the example for more details. The ZH03B is set by default in case no sensor type is defined in the constructor. Thus, the updated library is 100% backward compatible with its previous release...

DiegoPalo commented 1 year ago

Hi Shaggy, is been trying to use the SENSOR_ZH06, but I've an error checking your example: error: 'SENSOR_ZH06' is not a member of 'SD_ZH03B'...

ShaggyDog18 commented 1 year ago

Hi Diego,

for trying ZH06 just comment the line 13 and uncomment the line 16. Should compile without any error.

Cheers, Shaggy

On Fri, Aug 18, 2023 at 10:41 PM DiegoPalo @.***> wrote:

Hi Shaggy, is been trying to use the SENSOR_ZH06, but I've an error checking your example: error: 'SENSOR_ZH06' is not a member of 'SD_ZH03B'...

— Reply to this email directly, view it on GitHub https://github.com/ShaggyDog18/SD_ZH03B/issues/2#issuecomment-1684361888, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIUOQIMXVIBWQC5EBOXG6FDXV7APJANCNFSM43FUL7JA . You are receiving this because you commented.Message ID: @.***>