If you ever get caught up in a chemical or biological weapons attack, your cellphone may save your life. Or at least that’s the ambition of the Department of Homeland Security.

The Department’s science and technology team has begun talks with four cell-phone manufacturers on designing ‘nextgen’ phones that would be able to sense a wide variety of noxious chemical compounds in the air – and alert the user. The director of the “Cell-All” program at the DHS, Stephen Dennis, tells CNN that within a year, “We expect up to 80 prototype cell phones to be developed that can be then tested against various agents.”

The vision is to alert cell-phone users to all sorts of risks – from accidental gas leaks to a terror attack using poison gas. For example, if ammonia escaped from a train wreck, the gas would trigger an alert. The chip – at current prices – would cost as little as $1.

One of the technologies being examined is a porous silicon “nose” that is based on – amazingly - the beetle shell. Professor Michael Sailor at the University of California San Diego uses silicon to mimic the way a beetle’s complex shell produces iridescence. Sailor uses chemistry to give silicon particles a sponge-like structure. The particles’ pores are designed to recognize and sop up molecules of certain toxins. So these “artificial” noses can potentially detect scores of chemical compounds.

NASA is also involved – helping with the chemical sensing, and using technology designed for measuring air quality in the space program.

“They rethought the platform,” says Dennis, scaling it down to ‘nanosize.’

The application would go beyond warning the consumer. Dennis’ team is already consulting emergency service providers to see how phone alerts might be automatically fed to authorities. Dozens of alerts from multiple phones in one location would help responders quickly to assess the nature and extent of the threat. In technical jargon, this “crowd-sourcing” helps provide a more accurate read-out of the threat. (So for example if someone spilt some bleach at a laundromat, it would not translate into a major public emergency.) The alert process would take less than a minute – and that seems a lot more efficient than hundreds of panicked citizens dialing 911.

Imagine how useful such an application would have been had you been a Tokyo commuter on March 21 1995, when members of the Aum Shinrikyo cult released sarin gas in five coordinated attacks on the city’s subway. Eight people died; more than 5,000 were taken to hospitals.

Don’t expect the application to be ready tomorrow – the “Cell-All” folks acknowledge it could be several years before it is commercially available. The manufacturers involved have to grapple with design issues, power drain and other challenges. And the sensors have to be designed in such a way that the number of “false positives” is kept to a minimum. A lot of false alerts would not do anyone’s nerves much good.

The DHS stresses that the technology would be optional in phones and that data transmissions would be anonymous.