Nanosensors could aid drug manufacturing