Magnetic nanoparticles can bind to biomarkers. The particles dispersed in solution become clustered if the targets exist, leading to a different T2 relaxation time. The relaxation switch mechanism has been applied as a biosensor for various biomarkers. However, the change in relaxation rate is related to the nanoparticle size and concentration. Some theoretical models have been applied to predict this rate of change in search for the optimal system parameters. In this work, an open-source Monte Carlo algorithm has been developed to simulate water diffusion in microscopic environments with nanoparticles and the effective T2 relaxation times.