how to make a unity script to interact with the outside world

I wanna use unity to simulate a hardware project I’m working on. The idea is I want to trigger an output from the hardware by using an event in Unity itself. It’s supposed to be something like this:

function OnTrigeerEnter(){
if(gameObject.tag == “Sensor”)
{
//output 5 volts from computer’s USB port
}

much like where a controller vibrates when you’re playing a game. I wanna do something similar

You must use some USB interface cable or device - take a look at this answer.