By using tiny carbon nanotubes tuned electronically to particular gases, researchers turned smartphones into toxin sensors. Cynthia Graber reports