The comparator input should have a series resistor (1 meg or so) to protect it from transients picked up by the foil or wires. -----Original Message----- From: Thomas McGahee [mailto:tom_mcgahee@SIGMAIS.COM] Sent: 07 January 1999 13:26 To: PICLIST@MITVMA.MIT.EDU Subject: Re: Ideas for Pic-based Motion detector? Foster, Be aware that unless the two wires are both enclosed in some sort of Faraday cage (such as a simple grounded metal enclosure) you will have a nice 30 foot antenna that is going to pick up all kinds of local RF. If you want to go with a variable capacitance type circuit I would change from using wires to using two thin foil strips instead. That will allow a MUCH greater capacitance value as your starting value, and will make the circuit less prone to errors due to the proximity of other objects. Since you are not interested in absolute position information, but only want to detect rapid CHANGES, you might want to investigate using a circuit similar to the following: O +Vcc | | \ V Vref (adjustable) / | \ | |\ / -----| \ comparator | | >----> Output pulse *--------*-----| / | | |/ \ --- / --- 30 foot foil capacitor \ | / | | | | | --- --- - - The comparator must be one with a very high input impedance and capable of operating with very small input currents... on the order of picoamps. Most FET type op amps will do. The two resistors should be high values, such as 22 Megohms. They set a midpoint voltage of Vcc/2. Normally the capacitor is just charged to that level. But if the plates of the capacitor are moved rapidly, then the voltage at the junction will change. If the comparator has been properly adjusted then a pulse will appear at it's output indicating the change was detected. If the capacitance is too small to begin with, then the two resistors will have to be made even larger. Instead of a comparator you could connect a buffer op amp to the capacitor and look at the output on a scope (use AC input selection to remove the DC bias). Turn the gain up and you should see a "noise" that represents the system vibration or movement. Hope this helps. Fr. Tom McGahee Electronics Department Don Bosco Technical High School ---------- > From: adastra > To: PICLIST@MITVMA.MIT.EDU > Subject: Ideas for Pic-based Motion detector? > Date: Wednesday, January 06, 1999 6:52 PM > > Greetings, PICMASTERS: > > I need to devise a system which will detect a small movement between two > adjacent wires. The wires would be about 30 feet long and spaced > (non-uniformly) about 1 inch apart. They are normally stationary (fixed to > moveable objects), and I need to detect if they are suddenly moved either > closer together or farther apart, approximately plus-or-minus 1/4 inch, as a > result of an impact on one of the objects. (For various reasons, simple > contact switching will not work in this application.) > > I am thinking of a system where an RF signal(say,100 khz)is applied to one > wire and picked up by the other. The gain of the return signal could be > automatically set to establish an accurate baseline level, and an output > signal generated if the level changed suddenly. > > Perhaps the PIC could generate the RF signal, modulate it, and synchronously > detect the return. (Maybe the synchronous detection is overkill?) I also > need the PIC to generate some specific digital output data when the movement > is detected, but that is less of a mystery to me than the transmit-receive > scheme I am contemplating, as outlined above. > > Any comments or links pertaining to this (or any alternative)approach would > be much appreciated. > > (I guess this is essentially an analog problem, and I apologize if it is too > far off topic.) > > Thanks, Foster