Scientists have developed a new sensor to prevent fires and explosions caused by lithium-ion batteries.The sensor is designed to detect ethylene carbonate (EC) gas, which is released when the battery is damaged or overheated.The sensor uses a covalent organic framework (COF) material, called COF-QA-4, to detect EC gas at low levels.This low-cost and energy-efficient sensor could be used in electric vehicles and other devices to provide early warnings and prevent accidents.