Connecting a passive infra-red sensor to a computer via a USB port

So, we are linking a sensor to a computer via USB, using a female USB connector and male USB wires.
The sensors are connected to a circuit.
A sensor has 3 pins, vcc, ground, output signal.
I would need to combine all of these 3 signals, probably using a micro controller or an OR gate.

The sensor is a Passive infrared sensor, with 2 jumper modes, to fire only once every X time while their is movement. and to fire constantly which there is movement. http://www.parallax.com/tabid/768/productid/83/default.aspx

(Not actual project)If I would want the signals to be processed by the computer to output " I sense someone" when ever a sensor fires, what would I need to do?

Questions to answer are:

-How would the computer understand the signal from the usb? Using a device driver? or something else(please specify).

-Based on a normal Passive infrared sensor, the high output signal is only around 3.3v and a gate needs a minimum of 3.5v to identify that it is high, what is your thoughts on this?

-How can a program say in C language call the class of a driver that processes the input of the USB?

-I read that the usb can burnout if you are careless about the energy you input on it, so what is this healthy energy( Vcc , Amps) range? ( and how do I achieve this?)

There are 3 other persons in our group to build this project and we are like lost lambs at the moment XD. We are majoring in I.T.

Thank you for your time. XD

I hope I have understood your post correctly.

You can't connect anything to a PC's USB port unless that something is also a USB device because the PC will need to be able to ask it what sort of device it is and then load the appropriate software to communicate with the device.

As far as I know you could connect your PIR to an Arduino and connect the Arduino to the PC's USB port. The Arduino will take care of all the complexities of USB communication.

You would write a program for the Arduino that would understand the signals from the PIR and pass on suitable messages to the PC.

...R

Hi Robin, yes that is a great idea. That is why I'am in Arduino's forum wall x).
What Arduino should I get for this though(we need the cheapest but still easy to use)? and about linking the 3 sensors?

"You would write a program for the Arduino that would understand the signals from the PIR and pass on suitable messages to the PC."

I would try and research more about learning Arduino programming but any help and clarifications would be greatly appreciated ^_^.

Thanks Robin! :smiley:

When you mentioned "using a female USB connector and male USB wires" I wasn't sure if you were just thinking of connecting the PIR wires directly to the USB port.

ralphjared:
That is why I'am in Arduino's forum wall x).

I would have thought you would implement the whole solution on the Arduino and have it print your diagnostic message via the USB serial link to the PC.

I was thinking of say a C program
if(arduino=="on")
{
cout<<"hello you"
}

where the variable arduino is from the driver of arduino that changes from on and off based on the input of the 3 sensors. :slight_smile:

ralphjared:
I was thinking of say a C program
if(arduino=="on")
{
cout<<"hello you"
}

where the variable arduino is from the driver of arduino that changes from on and off based on the input of the 3 sensors. :slight_smile:

I wouldn't recommend representing your boolean values as strings, but otherwise you seem to be on the right lines. Go give it a try. (Don't forget that in C++ each statement needs to be terminated by a semicolon.)

Now we bought our sensors and an Arduino uno 3 I believe, here's the data sheet for the sensors. Error, Electronic & Electronics Components Depot United States
I have troubling questions about what we bought.
-The site says it only requires 50 micro Amps(Is this right?), from a 5V arduino output(power source is USB 2) ,this means that we have to use a 100k ohm resistor? or does the 5v output of the Arduino already have resistance(1k ohm?).

-The sensor only outputs 0.3v how would I increase it to the required voltage for the Arduino to consider it high?(I cant seem to find the high signal voltage, is it 3.0v+?), we would probably use a step up circuit and I only know that it uses transistors and capacitors but I don't know the values or the models to get.

-We have 3 sensors, should we connect all 3 to the Arduino? or use an OR gate first, then connect them to the Arduino? We just need to know if any of the sensors fire up, we don't need them to be identified individually.

Thanks again :smiley:

No resistor needed, that is just how much current it needs from the supply.

I believe the datasheet is showing the output is normally low (0.3V) and will go high (to ~ supply voltage) when the PIR is triggered.

Connect all 3 to an OR gate, don't want 2 lows dragging down an attempted high.

Oh yes, the data sheet we got from the seller says it outputs 3v when high :slight_smile: .. since the OR gate only need 2.4, there shouldn't be a problem about that.

The current it needs will just be sucked up by itself, but because the needed current is very low, wouldn't it uhm... heat up? or because the sensor already have resistors embedded on it?

Thanks :smiley:

ralphjared:
The current it needs will just be sucked up by itself, but because the needed current is very low, wouldn't it uhm... heat up? or because the sensor already have resistors embedded on it?

Why would low current cause a device to heat up, and why would a sensor need "embedded" resistors?

I don't think you have a firm grasp on some of the basic principles of electronics. If a device needs X amount of current, that means it "pulls" the current from you power source.

oh ok thats great, thanks :slight_smile: