move to test sensor function
move test into function and add log ling