How does IoT sensor work?