Basic example how to output sensor readings as a JSON API using an ESP8266 NodeMCU module and some sensors. Everything on the picture below was bought from ebay for no more than $10.
- BME280 (temperature, pressure, humidity)
- TMP102 (temperature; but more accurate than the BME280)
- TSL2561 (illuminance; full spectrum, ir spectrum & visible spectrum)