Air quality monitoring station | PMS5003 & BME280 + sending data to iot platfor

Hi all,

i'm working on air quality station. I measue particulate matter with PMS5003 and meteo parameters with BME280. Everything seems to work just fine, but sometimes program hangs and doesn't send data to iot platform. I wonder if problem lie in my software or in hardware. Can anyone have a look on my code and tell me how i can improve it. Thanks in advance :slight_smile:

Here's my code:

My hardware: