Environmental monitoring using microcontroller