... we need to guess what the "sensor" is and what "interface" it uses...
-->
* decide which sensor to use
* read it´s datasheet
* connect the sensor according datasheet
* set up the interface according datasheet
* communicate with the sensor according datasheet
* decide how to process the sensor data
* decide the data format to be transmitted via UART
* then send the data through UART
Your diagram has DB9 connectors which is associated with an older type of serial interface. It's okay if your computer uses that older style of serial interface. (Possibly a parallel port 25 pins.)
However if your computer only has USB then you'll need to use that communication protocol.
Your cable appears to be a null modem. It uses a ground wire, and data goes through the other wire. The DB9 connectors have jumper wires between certain pins so you don't need to do all the handshaking protocols. It's the easier hookup and you can transmit ordinary ascii characters to your computer. The computer runs a utility program (typical name might be Hyperterminal, etc.), and displays characters as it receives them.
Your program needs to open a communication channel. Make settings match the computer's (baud rate, parity, 7 vs 8 data bits, full vs half duplex).
Voltage levels need to match.