You have a rasping cough. Your speech is reduced to a whisper and your throat is raw and aching. You cannot sleep. So you tell your sad story to your doctor, who faces a simple issue: do you have a viral infection, or is a bacterium responsible for your illness?

It sounds a trivial issue. In fact, the problem goes beyond your immediate health and has implications for the general wellbeing of society. If your doctor makes a misdiagnosis and – thinking your condition is caused by a bacterium – prescribes a course of antibiotics, the decision could have harmful side-effects.

Crucially, you will not recover more quickly from your illness, because antibiotics have no effect on viruses. At the same time, the inappropriate use of that antibiotic will only further the spread of anti-microbial resistance, which has now become a global crisis.

More than 700,000 people a year are killed by drug-resistant infections, the result of decades of global misuse of antibiotics. “The world is facing an antibiotic apocalypse,” says England’s chief medical officer, Sally Davies.

Halting this misuse has become an urgent goal for doctors. And one solution, based on research carried out at Leeds University, is aimed directly at the conundrum facing GPs: how to differentiate, speedily, an infection that is caused by a virus from one that is triggered by a bacterium.

(A bacterium is a single-celled organism; viruses are smaller and can only reproduce by invading and hijacking a cell’s own genetic material.)

The Leeds project involves groups of engineers, biologists and clinicians at the university, and has led to the development of a prototype chip the size of a large matchbox. From a pinprick of blood it can identify chemicals that are released by the body when it has been infected by bacteria. In short, it can tell when a person is suffering from a bacterial or a viral infection, and once completed it should help to reduce misdiagnoses, and, in the process, the spread of anti-microbial resistance.

Scientists hope to have a working device ready for use in five years or so. Tests using the chip have already been carried out and validation tests undertaken in hospitals.

“The next phase will be a large-scale clinical trial,” says project leader Professor Christoph Wälti, of Leeds University’s school of electronic and electrical engineering.

Wälti stressed that the chip would not indicate to a GP which type of bacterium was infecting a patient. “It will merely tell them that they have not been infected by a virus, and that antibiotics might well be appropriate. A GP should then have a good idea of which particular type of antibiotic to prescribe, depending on which organ is infected in a patient – their lungs or throat or bladder, or whatever is the source of their infection. On the other hand, if the chip shows you have a virus, the doctor will know not to give you antibiotics.”

The chip takes advantage of the fact that when a patient is infected either by a virus or a bacterium, one of the body’s first responses is to release chemicals that are intended to limit damage to cells. “Crucially, viruses trigger the release of different types of chemicals to those that are released by bacteria,” Wälti told the Observer.

The device designed by his colleagues contains agents that react with the chemicals released in the blood during the early stages of an infection by bacteria. Crucially, these are bound to electronic sensors, which then give a reading about levels of the various blood chemicals in a sample taken from a patient. These will show whether he or she is suffering from a viral or a bacterial infection. At present, it is possible to determine whether an infection is bacterial or viral, but that takes many hours of testing in a laboratory. The Leeds University device is not only conveniently sized, it will take only minutes to provide its diagnosis.

“Our talks with GPs and healthcare officials made it clear our device would have to be able to produce a definitive diagnosis in only about 10 to 15 minutes,” Wälti says. “You cannot expect people to come in one day and then return the next to get their result, especially if you are going to say to the patient that he or she has a virus and there is nothing much you can do for them. Speed is therefore critical. And that pushes the technology to the limit. However, we believe we have overcome those issues.”

Apart from the fact that western doctors are over-prescribing antibiotics to patients who expect to be given a drug for whatever complaint they have, there are other reasons for the spread of drug resistance. In many countries, both land and fish farmers use antibiotics as growth promoters and indiscriminately pour them on to their livestock feed, while drug manufacturers often fail to dispose of their industrial waste appropriately. In the latter case, the result is antibiotics leaching into streams and rivers with alarming results, particularly in Asia.

However, the medical misuse of antibiotics remains a key problem.

“We need to develop some way to make it easier for doctors to use antibiotics as precisely as possible in future,” says Wälti. “That is why we have developed this device.”