adding final code for sensors capturing with arduino