A nanoscale sensor network for precision agriculture optimizing water and nutrient distribution