Diabetes mellitus is a very silent disease, which, according to various studies, has been growing every year, among them are patients with type 2 diabetes mellitus that is characterized by why they do not produce enough insulin in their body, causing them to inject insulin in an uncontrolled way, caused discomfort by the number of times they inject. Some patients do not know if they have type 2 diabetes, and over time several inefficient and expensive diabetes screening systems have been developed, limiting their use by everyone. Similarly, if this disease is not detected in time, it can compromise other parts of the body so it is always necessary to control your eating habit, on the other hand, this type 2 disease can be detected in fasting of the patient. According to the problem exposed, in this research a self-detection system of type 2 diabetes mellitus was carried out by aspirating a urinalysis to detect through the sweet smell of urine if the patient may have type 2 diabetes mellitus by means of gas sensors and carbon nanotubes fused by a microcontroller. Through the operation of the system, it was observed that the tests were performed with an efficiency of 98.99%, being an accepted value for a reliable and safe diabetes analysis, demonstrating that it can detect type 2 diabetes mellitus by aspirating the smell of urine.