data collector code - arduino based