The World Health Organization (WHO) calls tuberculosis drug resistance "a formidable obstacle" to treatment and prevention of a disease that killed 240,000 people in 2016.

The technology, developed by researchers at the Brock University in Canada, builds on an earlier version of the microscopic robot - called the three-dimensional DNA nanomachine - created in 2016 to detect diseases in a blood sample within 30 minutes.

The team re-designed the nanomachine so that it could uncover mutations in the genes found in the bacteria that causes tuberculosis.

The nanomachine holds the potential to determine, within one hour, whether or not tuberculosis bacteria contain the genetic mutations that make them resistant to the basic, first-line drugs prescribed to fight tuberculosis.

According to WHO, resistance occurs mostly because patients do not adhere to the strict schedule of antibiotics they need to take to get cured.

The bacterial cells' genes change so that the bacteria can survive future exposures to the same antibiotics, which means a second-line treatment is then required.

It takes a while before health-care professionals and patients realise the first-line drugs aren't working, which is why quick detection of drug resistance is so crucial, said Feng Li, who led the study published in the journal Chemical Science.

"Once you confirm there is tuberculosis infection, you have to use the diagnosis to guide the therapeutic strategy. Normal infection and drug-resistant strains require two completely different types of strategies," said Li.

The current testing for resistance is an arduous, time-consuming process that can take anywhere from two to six weeks and requires high-level equipment and training.

In the meantime, the disease worsens in patients, who can also pass the disease along to others.

The nanomachine consists of a 20-nanometer particle made out of gold. Short and long DNA strands are attached to the gold particle and these DNA molecules are used as building blocks to construct and operate the nanomachine.

Graduate student Alex Guan Wang used a computer simulation model to design the long strands, which are able to seek out differences in nucleotides contained within the tuberculosis bacteria's genes.

A nucleotide is the basic structural unit and building block for DNA, and it's within these that mutations caused by drug resistance would be found.

The short DNA strands attached to the nanomachine carry fluorescent signal reporters.

The nanomachine is dropped into serum extracted from human blood. If the long strands detect the mutations found in specific nucleotides, the machine turns on and glows; if the sample is disease-free, the robot remains off.