original code
copied from the book _Atomospheric Monitoring with Arduino_