Initial report by Rich Miller, 26th of September, 2005.
The QT 140 is a capacitance sensor, distinguishing itself from the rest of the Qprox lineup in that it operates four separate sensor channels independently. It’s function is based on its ability to sense an increase in capacitance in its sense circuit. When capacitance on one of its sensor channels grows, the QT140 (which from here on I will refer to simply as “Q”) takes to mean that contact has been made. There is a good, detailed explanation of this here.
Once contact has been detected, the Qprox simply outputs +5V (or sinks the circuit to ground) througn the appropriate signal output. Each output functions as a “button” – a simple digital input – to a microcontroller. As the chip does output 5V, more than enough for many loads such as an LED or two, they can operate well independently of a microcontroller for simple controls or testing.
The QT140 is easily configurable with a number of different input and output options making it fairly adaptable to an application’s needs.
PC peripherals, appliance controls, access systems, instrument panels, security systems, pointing devices, gaming controls, interactive sculpture
4.3 and 4.4 are from the data sheet. Note that at the top of 4.4 are all the test values for the components of a QProx circuit. In other words, these are parts that we can use.
In my testing, I used the typical 5V Vdd, but used .1µF capacitors for Cs and got reasonably good results. I set the QT140 to sink the PIC inputs to signal a positive contact. This is done by connecting the Output Option pin (16 or OC on the Pin Chart, below) high to +5V, forcing the output pins on the Qprox function to sink -or pull low to ground - the input pins on the PIC. The basic concept is explained fairly well here : http://www.winpicprog.co.uk/pic_tutorial_extras.htm
The important things to note immediately are the sense channels and the option pins, which we’ve gone over a bit already. The sense channels (SNS1-4, A&B) are paired because a capacitor (Cs) of nominal value - 39nF as a recommended starting point and .1nF as tested – should be placed across each pair of leads. Electrode (Cx) leads can apparently be wired to either A or B, but it is suggested that they be connected to the A pin to take advantage of whatever protection they’ve built in against EM interference. Together, the capacitance of the electrode and the value of capacitor on each channel form a sort of reference point for the Q. When it senses this value increasing, it debounces the switch three times (a built-in feature!) and then signals a contact on the sensor’s corresponding output. Not incidentally, changing the values of Cs and Cx changes the sensitivity of the electrode. A higher value capacitor (Cs) makes the electrode more sensitive.
The other thing to note here is the application of the option pins, 16, 17, 24 and 25 on the chart. Pin 16 is the Output Option Pin, outlined above. Pin 17 is the AKS, or Adjacent Key Suppression, which you can see was not strapped in testing though it should have been. This acts as it sounds, by suppressing false signals from keys that are close to the true signal. Strapping it high turns AKS on and low turns it off. No negative effects from letting it float have so far been encountered.
The functions of the OPT pins is somewhat more complicated. The options are for the number of seconds a pin can be triggered before being reset by the chip. In the infinite range, which was chosen for testing relating to needs of another specific application, this reset function is sacrificed. The toggle option toggles the states from high to low or vice versa with each independent contact.
Below is the wiring schematic for connecting the Qprox to a PIC 18F252. Note again that the QProx Output Option pin (16 or OC on the Pin Chart above) is pulled high. The inputs to the PIC (B.0-B.3) are wired accordingly with 1K? resistors pulling those pins high. Just for kicks, I wired the PIC to sink the LEDs, too. The only discrepancy from the actual test circuit is the use of 1K? resistors on the Sens pins. This was suggested as a means to protect the chip from stray voltage discharges, but testing proved the electrodes to be too insensitive in the tested configuration otherwise.
Give a code sample for the microcontroller you developed the example on. Link it to the Code group of the wiki, formatting the link like this: QproxTest
In limited testing so far, the QT140 has proved to be a hardy, versatile sensor, consistently producing correct output signals despite varying conditions and inconsistent wiring? Each time the power is cycled, the QT140 re-evaluates each input and sets a new base capacitance value if necessary. There is also a reset pin that will accomplish the same thing without cycling the power. The beauty of this is that the sensor can quickly be adjusted to changing conditions. In testing, the power to the circuit was turned off, an electrode dropped into a plastic tub of tap water, and then the power turned back on. The sense wire, the water and the tub itself had all become parts of the sense circuit.
Other tests performed involved shaping of the electrodes. Flat, dished (concave), and looped copper mesh, as well as a narrow strip of the same material, were all soldered to leads and tested in the circuit, as was a plain copper wire. The plain wire tripped the circuit at each touch. The flat electrode triggered the sensor when a finger was positioned within Ľ” of either side of it. The dished electrode appeared to focus the field to the center of the concave side so that sense was acquired within ˝” of the surface, while the convex side had to be touched to trigger the sensor. The strip was not much more sensitive than the bare wire.
First off let me say that this is not intended as, and should not be assumed to be, a scientific analysis of the sensor tested. It was as systematic as I could manage, but as the conditions under which I did the testing were less than ideal, I make no claim that a similar test would produce the same results. My intention is to provide an idea of the range of capability of the QT140 and similar sensors.
The majority of testing was performed on November 20, 2005 in Queens, New York. A soldered bread board was created for the purposes of making the testing conditions as uniform as possible. All of the electrodes tested (with the exception of the first electrode created, the 3/8” NYC tap water electrode) were constructed using a coaxial cable lead with the shielding grounded against electromagnetic interference and soldered pins to fit the test circuit as pictured in the first image.
A wide range of capacitors were looked at for testing, but ultimately the list was narrowed to seven for comparison. The parameters for this choice were having a value that falls within or above the stated Cs range of the sensor (1nF-100nF), that they were of a sufficiently different value from others being tested, and seemed likely to prove of interest to us. Most of the capacitors were of the “monolithic” variety, though I also tested some of the Mylar variety. All were non-polarized. Each of the capacitors selected was first tested on a Radio Shack digital “true RMS” multimeter to get a somewhat accurate reading of its capacitance.
The method for testing was simple methodical repetition of the same steps over and over and over…. I tested each electrode in the sample with each of the capacitor values, recording the data at each step. The conditions in the testing area were relatively consistent, though it should be noted that this testing was performed in the cold of November, which means that the air was dry, having an affect on capacitance. Results may be different under more humid conditions.
The electrodes tested ranged from the obvious copper wire and copper screen to the greatest extremes I could come up in short order. This included a 175 lb. anvil and 4’ fluorescent tubes. I knew it was a long shot, but I had to try it, at least. I have to admit that my testing method for the anvil was pretty shoddy (though I stand by the rest as reasonably good), so if you had your heart set upon using that anvil you have laying around as a sensor, fret not. I may have just fubbed the test. Let me know if you have success.
The measurements indicated on the chart were taken with a plastic graphic design ruler that did not seem to affect the results. They represent an approximately radial distance from the electrode surface to the tip of the finger. Each measurement was tested several times before selecting what I felt was the most representative measurement. That is, I recorded the most frequent result.
So far as the rest of it goes, I think the chart pretty well stands alone.
|Capacitor (Cs) Value||4.86nF||22.6nF||49nF||100nF||150000pF||221nF||1µF|
|Solid Conductor 22 Awg. Copper 12" long, straight, uninsulated||firm contact||light contact||light contact||light contact||light contact||light contact||light contact|
|Stranded Conductor 22 Awg copper 12" long, straight, insulated||no sensitivity||contact along 8" of electrode||contact along 1.5" of electrode (2 fingers)||firm contact||light contact||light contact||1/4" away, length of electrode: unstable.|
|Stranded Conductor 22 Awg copper 12" long, straight, uninsulated||light contact||light contact||light contact||light contact||light contact||light contact||1/4" away, length of electrode: unstable.|
|Solid Conductor 14 Awg. Copper 12" long, straight, uninsulated||firm contact||light contact||light contact||light contact||light contact||light contact||light contact|
|Stranded Conductor 16 Awg copper 12" long, straight, insulated||no sensitivity||light contact over 3" (four fingers)||light contact over 1.5" (two fingers)||light contact||light contact||one finger triggers within 1/8 of an inch||one finger triggers stabily within 1/4"|
|Stranded Conductor 16 Awg copper 12" long, straight, uninsulated||light contact||light contact||light contact||light contact||light contact||one finger triggers within 1/8 of an inch||one finger triggers within 1/4 of an inch|
|3/4" Diameter Phillip-like spring (measured in axial distance from large end of spring)||light contact||light contact||light contact||light contact||light contact||one finger parallel to spring end||one finger 1/4" from spring end|
|1/16" I.D. NYC Tap Water Filled Silicone tube, 48" long||no sensitivity||no sensitivity||no sensitivity||no sensitivity||no sensitivity||no sensitivity||no sensitivity|
|3/8" I.D. NYC Tap Water Filled Silicone tube with 3", 22 Awg. Copper wire lead in water, 48" long||1-1/4" from lead||4" from lead||4-3/4" from lead||linear taper field surrounding electrode from 1.5" around tubing at end of copper lead to 0", 5" from lead||no sensitivity||no sensitivity||no sensitivity|
|Salt Water (NaCl) Filled 1/16" Silicon Tube, 48" long||no sensitivity||no sensitivity||no sensitivity to one finger, 3" (four fingers) contact triggers to to 7.5"||one finger to 8", four fingers to 19"||0ne finger to 13", 3" (four fingers) contact triggers to to 22"||0ne finger to 17.5", 3" (four fingers) contact triggers to to 26"||0ne finger to 13", 3" (four fingers) contact triggers to to 38"|
|Salt Water (NaCl) Filled 3/8" Silicon Tube, 48" long||no sensitivity||sensitivity to greater than 6" contact area to 48"||sensitivity to greater than 2" contact area to 48"||sensitivity to one finger's contact to 48"||sensitivity to light contact to 48"||sensitivity to light contact to 48"||sensitiveto three fingers' presence 1/4" from surface of tube to 48"|
|Sea Salt Water (KCl) Filled 1/16" Silicon Tube, 48" long||no sensitivity||no sensitivity||no sensitivity||3" firm contact sensitive to 8", greater than 7" contact sensitive to 15"||3" firm contact sensitive to 11", greater than 7" contact sensitive to 18"||three fingers' light contact to 15.5"", greater than 7" contact sensitive to 26"||one finger light contact to 25", three fingers' light contact to 48"|
|Sea Salt Water (KCl) Filled 3/8" Silicon Tube, 48" long||no sensitivity||sensitivity to greater than 6" contact area to 48"||sensitivity to greater than 2" contact area to 48"||sensitivity to one finger's contact to 48"||sensitivity to light contact to 48"||sensitivity to light contact to 48", senses full hand from 1/2" distance||no sensitivity|
|Bowl of Water 1" x 4" x 7" with immersed 2" x 2" screen electrode||no sensitivity||one finger's contact sensed||one finger's contact sensed||one finger's contact sensed||one finger's contact sensed||senses full hand from 1/8" above water's surface||senses full hand from 1-1/4" above water's surface|
|Bowl of Water 3" x 13" x 10.5" with immersed 2" x 2" screen electrode||no sensitivity||no sensitivity||one finger's contact sensed||one finger's contact sensed||one finger's contact sensed||senses full hand from 1" above water's surface||senses full hand from 5 " above water's surface|
|2"x2" Copper Wire Screen, 6 wires to the inch||firm contact||light contact||light contact||senses finger from 1/16" distance||senses finger from 1/8" distance||senses finger from 1/2" distance||senses finger from 1" distance|
|2"x2" Copper Wire Screen, 80 wires to the inch||firm contact||light contact||light contact||light contact||senses finger from 1/4" distance||senses finger from 1/2" distance||senses finger from 1-1/8" distance|
|5"x5" Copper Wire Screen||firm contact||light contact||light contact||senses finger from 3/8" distance||senses finger from 5/8" distance||senses finger from 1-1/4" distance||senses finger from 2-1/2" distance|
|Anvil||no sensitivity||no sensitivity||no sensitivity||no sensitivity||no sensitivity||no sensitivity||no sensitivity|
|Fluorescent tube, loose (48"Phillips F32T8)||no sensitivity||no sensitivity||no sensitivity||no sensitivity||no sensitivity||no sensitivity||no sensitivity|
|Fluorescent tube, In Fixture (48"Phillips F32T8)||no sensitivity||no sensitivity||no sensitivity||no sensitivity||no sensitivity||no sensitivity||no sensitivity|
Use of the QT140 is pretty straight forward. I did find the datasheet's advice reguarding the use of grounded and shielded sensor lead cables was helpful. Shielding the lead completely eliminated reads off the cables themselves. The capacitors on the board, however, act like perfect little sensors, themselves, so plan to have them either away from activity or shield the whole board.
I inadvertently tested the QT140's need for its own, discreet power regulator. A Pic on the same circuit tripped up the QProx when it lit up a number of LEDs at the same time. Discreet circuits is definately the way to go.
There is nothing in the literature to tell you this works, but I used both ten and twenty MHz half-can powered occilators to time both the QT140 and a PIC. Wired to the OSCIN pin and left the OSCOUT pin barren. Worked fine.
A Note on Board Design
It should probably be noted that I am a proud guy. Silly as it may be, when I solder a board, I like to use the space as efficiently as I can. This caused me endless pain on a project because I had placed a row of female headers between the voltage regulator and the PIC on a board mounted in a small cavity in a sculpture. I had about a dozen wires to connect individually to the board. I did not have fun. Please let my folly be your guide; Place your connectors out in the middle of an empty field where little deer graze on unharvested grain. Don't wedge them into a little bit of unused space.