Code adopted from http://www.isp-sl.com/pcsensor-1.0.1.tgz