The lov-iot project is about the use of sensors connected as internet of things to measure and raise awareness of air and water quality.
You can probably find a bunch of code here that reads out different kinds of sensors and runs on an esp32 to send the data via wifi.