How to connect PIR to PC

Thread Starter

Jane1

Joined Sep 28, 2011
13
I would like to connect PIR motion sensor to PC ( either to USB or COM port).

What interface/convertor must I use?

Thanks
 

BMorse

Joined Sep 26, 2009
2,675
Most PIR sensors have a TTL logic output, in order to interface it to your PC, you will have to have some kind of RS232 to TTL IC such as the MAX232CPE, this will enable you to interface to COM port, and also use this IC to connect to a USB to RS232 dongle to connect it to a USB port, then you will have to write some code on the PC to receive the signal from the PIR, you can most likely use the DCD pin on the COM port to get the input from the PIR sensor.
 

GetDeviceInfo

Joined Jun 7, 2009
2,196
the real trick is in how you will interpret any signal on your port. You may want to consider wake on ring, or poll a comm port input. A toggle on the USB port will generate a useful interrupt. What strategy are you considering on the PC side?
 

Thread Starter

Jane1

Joined Sep 28, 2011
13
Thanks for the reply

I was thinking about the daemond/service running on PC that will check com port's value in regular periods.According to the value I will trigger an action.
Is that workable?

@GetDeviceInfo:Can you explain a little more "
A toggle on the USB port will generate a useful interrupt"

Thanks
 

GetDeviceInfo

Joined Jun 7, 2009
2,196
Thanks for the reply

I was thinking about the daemond/service running on PC that will check com port's value in regular periods.According to the value I will trigger an action.
Is that workable?

@GetDeviceInfo:Can you explain a little more "
A toggle on the USB port will generate a useful interrupt"

Thanks
Have no idea if that's workable as I have no idea what your objective are.

Not at all familiar with the PCs' USB host controllers, but with all the micros / dedicated host controllers I've worked with, pulling D+ or D- low will generate an interrupt, indicating attachment. I'm making an assumption, but I can't see any reason you couldn't hook into this event.
 

BMorse

Joined Sep 26, 2009
2,675
Not at all familiar with the PCs' USB host controllers, but with all the micros / dedicated host controllers I've worked with, pulling D+ or D- low will generate an interrupt, indicating attachment. I'm making an assumption, but I can't see any reason you couldn't hook into this event.

You could do that, but the amount of overhead code you would have to write to poll for a device on the USB port would be much more than just using a USB to serial dongle, then all Interrupts that occur on that specific comm port can be polled easier using a simple Comm Object in VB or any application that supports the MSComm Active X control, or any application that can use a comm port for that matter, even Hyperterminal....
 
Top