sensor logic