How to connect PIR to PC

Discussion in 'General Electronics Chat' started by Jane1, Sep 28, 2011.

  1. Jane1

    Thread Starter New Member

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

    What interface/convertor must I use?

    Thanks
     
  2. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    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.
     
  3. GetDeviceInfo

    Senior Member

    Jun 7, 2009
    1,571
    230
    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?
     
  4. Jane1

    Thread Starter New Member

    Sep 28, 2011
    13
    0
    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
     
  5. GetDeviceInfo

    Senior Member

    Jun 7, 2009
    1,571
    230
    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.
     
  6. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234

    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....
     
Loading...