Function to calibrate sensor nodes