SPS30 sensor via I2C with MKR one: Arduino sketch
- Details
- Category: Devices
- Hits: 12
Works with sensirion-sps Arduino lib (the versions below 1.2.0). Data will be in Serial monitor:
#include <sps30.h> #include <Wire.h> // Uncomment for serial plotter format // #define PLOTTER_FORMAT void setup() { int16_t ret; uint8_t auto_clean_days = 4; SerialUSB.begin(115200); // Use SerialUSB for MKR boards while (!SerialUSB) { ; // Wait for USB Serial to be ready } delay(2000); // Initialize I2C on default pins (SDA/SCL on MKR ONE 1310) Wire.begin(); // Initialize Sensirion I2C layer (usually calls Wire.begin internally) sensirion_i2c_init(); while (sps30_probe() != 0) { SerialUSB.println("SPS sensor probing failed"); delay(500); } #ifndef PLOTTER_FORMAT SerialUSB.println("SPS sensor probing successful"); #endif ret = sps30_set_fan_auto_cleaning_interval_days(auto_clean_days); if (ret) { SerialUSB.print("error setting the auto-clean interval: "); SerialUSB.println(ret); } ret = sps30_start_measurement(); if (ret < 0) { SerialUSB.println("error starting measurement"); } #ifndef PLOTTER_FORMAT SerialUSB.println("measurements started"); #endif #ifdef SPS30_LIMITED_I2C_BUFFER_SIZE SerialUSB.println("Your Arduino hardware has a limitation that only allows reading the mass concentrations."); SerialUSB.println("See https://github.com/Sensirion/arduino-sps#esp8266-partial-legacy-support"); delay(2000); #endif delay(1000); } void loop() { struct sps30_measurement m; uint16_t data_ready; int16_t ret; do { ret = sps30_read_data_ready(&data_ready); if (ret < 0) { SerialUSB.print("error reading data-ready flag: "); SerialUSB.println(ret); } else if (!data_ready) { SerialUSB.println("data not ready, no new measurement available"); } else break; delay(100); } while (1); ret = sps30_read_measurement(&m); if (ret < 0) { SerialUSB.println("error reading measurement"); } else { #ifndef PLOTTER_FORMAT SerialUSB.print("PM 1.0: "); SerialUSB.println(m.mc_1p0); SerialUSB.print("PM 2.5: "); SerialUSB.println(m.mc_2p5); SerialUSB.print("PM 4.0: "); SerialUSB.println(m.mc_4p0); SerialUSB.print("PM 10.0: "); SerialUSB.println(m.mc_10p0); #ifndef SPS30_LIMITED_I2C_BUFFER_SIZE SerialUSB.print("NC 0.5: "); SerialUSB.println(m.nc_0p5); SerialUSB.print("NC 1.0: "); SerialUSB.println(m.nc_1p0); SerialUSB.print("NC 2.5: "); SerialUSB.println(m.nc_2p5); SerialUSB.print("NC 4.0: "); SerialUSB.println(m.nc_4p0); SerialUSB.print("NC 10.0: "); SerialUSB.println(m.nc_10p0); SerialUSB.print("Typical particle size: "); SerialUSB.println(m.typical_particle_size); #endif SerialUSB.println(); #else SerialUSB.print(m.nc_0p5); SerialUSB.print(" "); SerialUSB.print(m.nc_1p0 - m.nc_0p5); SerialUSB.print(" "); SerialUSB.print(m.nc_2p5 - m.nc_1p0); SerialUSB.print(" "); SerialUSB.print(m.nc_4p0 - m.nc_2p5); SerialUSB.print(" "); SerialUSB.print(m.nc_10p0 - m.nc_4p0); SerialUSB.println(); #endif } delay(1000); }
polluSensWeb - connect any UART pollution sensor via COM port!
- Details
- Category: polluSensWeb
- Hits: 241
Create a Chart
Signals
UN Ocean Gaps, TFA Chemical Risk, €15B Water Investment, EU Microplastics Standard, EV Ship Fire in Pacific
- Details
- Category: Econews
- Hits: 56
1 — UN Ocean Conference Exposes Gaps in Marine Protection
Only 2.7% of global oceans are fully protected — far short of the 30% by 2030 target.
Officials and researchers called for:
- stricter enforcement of marine pollution rules,
- limits on plastic and chemical pollution,
- better data sharing on marine ecosystem health.
2 — TFA, a New "Forever Chemical," Under EU Review
Trifluoroacetic acid (TFA), a persistent byproduct of PFAS, is now found in rainwater, groundwater, and human breast milk across Europe.
The European Chemicals Agency may soon classify it as a reproductive toxin — a step that would trigger new monitoring and regulation.
3 — €15 Billion EU Investment to Protect Water
The European Investment Bank will invest €15 billion over 3 years in water protection projects, aiming to:
- reduce water pollution,
- improve wastewater treatment,
- cut water waste,
- fund innovation in monitoring and treatment.
4 — First EU Standard for Microplastics Testing
The EU Joint Research Centre (JRC) has released the first reference material for microplastics in water — a PET-based standard for calibration.
This supports the new EU Drinking Water Directive rules requiring microplastics monitoring.
5 — Burning EV Ship in Pacific Raises Pollution Fears
The cargo ship Morning Midas, carrying ~3,000 cars (incl. ~800 EVs), caught fire and was abandoned about 300 miles southwest of Alaska.
Lithium-ion batteries and fuel onboard continue to burn. Salvage efforts are underway.
AP News | WSJ
Page 1 of 46
