Design of a portable optical sensor for methane gas detection