How to save indata value from HM3301 PM2.5 sensor to .json file

Hello,

So I bought this sensor: “GROVE - LASER PM2.5 SENSOR (HM3301)” and I am using it in a project where I want to collect the air particle data and then use it for different purposes, like illustrate on a webpage for example.

I have set up the example.ino code from the datasheet and I can see the measurements all fine.

My problem is that I cannot figure out how to go about saving the data value received from the sensor to a .json file so that I can transfer the data to my database.

Any help with this would be greatly appreciated!

Kind regards,
Oskar