Most of us have used the sniff test to decide whether a slightly expired bottle of milk or a week-old box of takeout is still good to eat. But while the human nose can be quite astute, it doesn't always catch everything. Each year, millions of people in the U.S. are sickened by food-borne pathogens that thrive in undercooked or spoiled food.

A new proof-of-concept device created by UC Berkeley researchers can sniff out gases emitted by harmful bacteria, allergens and other food safety hazards.

Most of us have used the sniff test to decide whether a slightly expired bottle of milk or a week-old box of takeout is still good to eat. But while the human nose can be quite…