If you’ve watched recent movies about apocalyptic conditions wiping humans off the face of the earth, you’ve probably come across characters building underground bunkers they can burrow into in order to survive. These bunkers are often shown to be fitted with sensors (usually fictional ones) to detect different kinds of danger – an earthquake, an incoming storm, or even radioactive materials. But Apple thinks you might just need your iPhone for this. The latest patent the company was granted shows a mobile device with the ability to detect poisonous gases.

Spotted first by PatentlyApple, the patent describes a future iDevice – an iPhone or an Apple watch – that will feature a gas detection sensor to warn you if you’re in a potentially fatal environment. This is quite useful if there’s a gas leak in your house, at your workplace, or out in the field.

One of the claims in the patent suggests the sensor can detect toxic gases like carbon monoxide (CO), nitrogen dioxide (NO2), sulfur dioxide (SO.sub.2) along with other gases such as methane(fart detection will be nice, thanks),and nitrogen monoxide (NO).

Here’s a drawing in the patent filing that shows an Apple Watch-like wearable kitted out with the necessary sensors:

A sample of the Apple Watch with gas detectors

This is not the first time Apple’s patented ideas for gadgets with environmental sensors. Some of its earlier patents show that the company’s been toying with the idea for a while, like a device with sensors to detect pressure, humidity, and gases and a device with sensors to detect metal oxide.

The company believes such features could soon become strong selling points for its hardware products. Earlier this week, Apple filed a report that claiming that climate change could encourage sales of its phones and watches, as they offer functionality that could be handy during natural disaster situations, including emergency alerts, SOS broadcasts, and easy-access flashlights. Thanks for the pleasant thought, Apple.

The Apple Watch – with its heart rate detection capability on older models, and the ECG functionality on the latest one – has already helped saved many lives. But it’ll be cool to see more alert systems on the iPhone as well.

While these features sound really amazing, Apple will have to make sure that all of this works intuitively and a person doesn’t have to go looking for a feature during an emergency. Of course, features like gas detection are in the patent stage, so it might at least a few years before we see them on real-life devices.

Having personally experienced emergency scenarios like being caught in the middle of a storm and an earthquake that took many lives, I recall how difficult it was for people to contact rescue workers and local authorities during these calamities several years ago. I’m all for technology that can help people protect themselves from the elements. Hopefully, it won’t be too long before these features become more widely available in mobile devices.

Read next: How DeepMind's AI defeated top players at StarCraft II