An input device is hardware that allows data or commands to be entered into a computer system, converting real-world information into a digital (binary) format that the CPU can process.
An output device is hardware that receives processed data from the computer and presents it to the user or another system in a human-readable or usable form.
A sensor is an input device that detects or measures a physical property of its surroundings and sends the captured data to a computer system for processing.