worked on algorism for scanning the sample
write a new function to read out the voltage