I'd advise checking out the Help Center for the EMS and then asking more specific questions from there. To give you a short answer, you will need some kind of server on the device with the sensor, which in your case is the Raspberry Pi. You can use the EMS, but if you need a more custom solution, you can choose from one of several SDKs and go from there. Getting the EMS up and running is as simple as putting it on the device (download it under PTC Software Downloads on support.ptc.com), configuring it (see the config.json.complete file for a full list of configuration options, but you should just need the Platform IP, port, and an Application Key), and then creating a remote thing on the Platform which can be bound to your device.
For more details on this, you can see the EMS Developer's Guide
You can also follow the below link in addtion to what Tori mentioned in her comment.
In this QuickStart Guide, you will configure an edge agent to quickly connect edge devices to the ThingWorx platform. This edge agent utilizes Node.js to extend the ThingWorx Edge C SDK to communicate with the ThingWorx platform.
Here's another excellent resource:
That tutorial shows how to connect humidity and temperature sensors to a Raspberry Pi, and then send that data to the ThingWorx platform. I should be fairly simple to adapt the techniques demonstrated there to your IR sensor.