Remember all those times your parents told you it was rude to sigh? Well, you can discount that advice entirely, because sighing's actually a crucial reflex that keeps our lungs healthy, and researchers have just uncovered the switch in our brain that controls it.

The team identified two tiny clusters of neurons in the brain stem that automatically turn normal breaths into sighs when our lungs need some extra help - and they do this roughly every 5 minutes (or 12 times an hour), regardless of whether or not you're thinking about something depressing.

"Unlike a pacemaker that regulates only how fast we breathe, the brain’s breathing centre also controls the type of breath we take," said one of the researchers, Mark Krasnow, from Stanford University School of Medicine.

"It’s made up of small numbers of different kinds of neurons. Each functions like a button that turns on a different type of breath," he explains. "One button programs regular breaths, another sighs, and the others could be for yawns, sniffs, coughs and maybe even laughs and cries."

The team has now been able to identify for the first time the 'sigh' button, and it's surprisingly simple, bypassing our conscious brain altogether - which in biology suggests that it's one of the most crucial reflexes, just like 'flight or fight'.

"Sighing appears to be regulated by the fewest number of neurons we have seen linked to a fundamental human behaviour," said one of the researchers, Jack Feldman from the University of California, Los Angeles.

So why is sighing so important? It turns out that, without it, the tiny balloon-like sacs in our lungs known as alveoli can collapse and struggle to reinflate themselves.

"A sigh is a deep breath, but not a voluntary deep breath. It starts out as a normal breath, but before you exhale, you take a second breath on top of it," Feldman explained. "When alveoli collapse, they compromise the ability of the lung to exchange oxygen and carbon dioxide. The only way to pop them open again is to sigh, which brings in twice the volume of a normal breath."

This first became clear to scientists when patients started dying in the earliest iron lung devices, which didn't factor in providing people with these extra deep breaths - a design flaw that's since been fixed. "If you don’t sigh every 5 minutes of so, the alveoli will slowly collapse, causing lung failure," said Feldman.

For most of us that's not an issue, but for people who suffer conditions that stop them from breathing deeply - or, at the other end of the spectrum, who sigh so often that it becomes debilitating - it's not so simple. Which is why it's so important to work out how the process is regulated.

To do this, the team worked with lab mice, which sigh up to 40 times an hour. They screened more than 19,000 gene-expression patterns in the animals' brain cells, and eventually honed in on 200 neurons that manufacture and release one of two neuropeptides. These neuropeptides were known to influence breathing in humans, but no one had been able to work out how.

By studying the pathway in mice further, they found that the peptides stimulate a second set of 200 neurons, which then activated the mouse's breathing muscles to produce a sigh.

When the team increased the amount of peptide being produced, the mice started sighing 400 times an hour, instead of 40. Alternatively, they were able to stop the mice sighing altogether when they blocked the peptides.

"These molecular pathways are critical regulators of sighing, and define the core of a sigh-control circuit," said Krasnow. "It may now be possible to find drugs that target these pathways to control sighing."

Further research is needed to confirm that this same pathway exists in humans, but the similarities in the mouse and human systems suggest we're on the right track.

One thing that still remains a mystery, however, is whether emotional sighing works the same way.

"There is certainly a component of sighing that relates to an emotional state. When you are stressed, for example, you sigh more," said Feldman. "It may be that neurons in the brain areas that process emotion are triggering the release of the sigh neuropeptides - but we don’t know that."

We'll have to wait for the answer to that question, but in the meantime, don't feel bad about sighing to your heart's content. Your alveoli will thank you for it.

The research has been published in Nature.