Facile route to highly photoluminescent carbon nanodots for ion detection, pH sensors and bioimaging.