  Nano-machines circulating inside the human body, collecting data on tissue
conditions, represent a vital part of next-generation medical diagnostic
systems. However, for these devices to operate effectively, they need to relay
not only their medical measurements but also their positions. This paper
introduces a novel localization method for in-body nano-machines based on the
magnetic field, leveraging the advantageous magnetic permeability of all human
tissues. The entire proposed localization system is described, starting from
10x10 ${\mu}m^2$ magnetometers to be integrated into the nano-machines, to a
set of external wires generating the magnetic field. Mathematical equations for
the localization algorithm are also provided, assuming the nano-machines do not
execute the computations themselves, but transmit their magnetic field
measurements together with medical data outside of the body. The whole system
is validated with computer simulations that capture the measurement error of
the magnetometers, the error induced by the Earth magnetic field, and a human
body model assuming different possible positions of nano-machines. The results
show a very high system accuracy with localization errors even below 1 cm.
