Resistor keys

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
myp71
Posts: 585
Joined: Wed Apr 23, 2003 1:01 am
Location: Colorado
Contact:

Resistor keys

Post by myp71 »

Is there a circuit that would turn on a relay when the right resistance matched the pre-programmed resistance?<p>In other words I would like to use a resistor as a "key" to open up the relay contacts the resistors would have to match up from the "key" resistor and the resitior in the circuit when their value is matched the relay opens.<p>Thanks
User avatar
Chris Smith
Posts: 4325
Joined: Tue Dec 04, 2001 1:01 am
Location: Bieber Ca.

Re: Resistor keys

Post by Chris Smith »

Standard Transistor Biasing will do that job. <p>The transistor biased to a given resistor, will open or conduct, thus latching the relay. <p>Another transistor, parallel to the other and set just above that value resistor can either short out the circuit all together, acting as a tamper proof mechanism for the lock, or reset it if you use any logic circuits. EG...0 to 9 ohms does nothing, 10 opens it, and 11 and above cancels it. <p>There will always be a plus and minus accuracy of around 10 ohms or more depending on the transistor batch,.... meaning the numbers will be more like 0 to 50,..... 50 to 60,...... 70 and above.
rshayes
Posts: 1286
Joined: Tue Mar 04, 2003 1:01 am
Contact:

Re: Resistor keys

Post by rshayes »

A bridge circuit can be used to compare your key resistor to a reference resistor. One side of the bridge would consist of the standard resistor in series with the key resistor from the power supply to ground. The junction between the two resistors will be at half the power supply voltage when the resistors are equal. A comparator can be used to compare this voltage to the voltage obtained from a divider with two equal resistors from the same power supply to ground. The output of the comparator will change at the point where the reference resistor and key resistor are equal.<p>What you probably want is a small window around the correct value. This can be done by adding a small resistor between the two equal resistors. One end of this resistor will be slightly above half the voltage and the other end will be slightly below. Two comparators are used. One is arranged to go high when the input voltage is above the low voltage. The other is arranged to go low when the when the input voltage exceeds the higher voltage. The two comparator outputs are wired in parallel with a single pull up resistor. The result is that the output will be low for voltages below the lower reference, high for voltages between the two references, and low again for voltages above both reference voltages. An addditional transistor will probably be needed to drive even a low power relay.<p>The LM339 (Quad) or LM393 (Dual) comparators would be suitable for this if the resistors are not extremely high valued (where bias currents of the comparators become significant). Resistors in the 1 to 10 kilohm range are probably reasonable. A single supply in the 9 to 12 volt range would be adequate.<p>The advantage of a bridge is that it depends only on the resistor values, which can easily be accurate to 1% and stable to better than that. The supply voltage is not critical.
Bernius1
Posts: 349
Joined: Sat Sep 21, 2002 1:01 am
Location: NY
Contact:

Re: Resistor keys

Post by Bernius1 »

Stephen's idea is it. GM's C3 engine comuter has a similar effect at the diagnostic terminal. When you short it, you get blink codes. At several hundred (? 300) ohms, you get more advanced diagnostics, and again at around 1200-1500 ohms, you get the digital stream. (excuse the numbers, I'd have to re-read the book.) All I would add is that a 2-resistor key would be more error-free and tamper-proof.
This makes me think; AM / FM / PPM / PWM / SSB ; Is it possible to encode a signal through resistance modulation? If so, you'd be modulating current, so will a trans-conductance amp detect it ?
Can't we end all posts with a comical quip?
wd5gnr
Posts: 104
Joined: Wed Dec 19, 2001 1:01 am
Contact:

Re: Resistor keys

Post by wd5gnr »

For a simple circuit I would also do this with a bridge. However, for microprocessor devices without A/D it is still easy to do this without an A/D.<p>You can hook the resistor up to a capacitor. Suppose the resistor connects between +5V and the capacitor. The capacitor connects from the resistor to ground. A microprocessor pin connects to the junction between the resistor and the capacitor.<p>First you output a 0 on the pin. This discharges the capacitor. Next, you switch the pin to an input. At first the pin will read 0 because the capacitor is basically a short circuit until it charges. As it charges, it will eventually exceed the input threshold and you will read a 1. The time it takes to see that 0 to 1 transistion will be proportional to the resistance. <p>The Basic Stamp uses this in the RCTime and POT commands. In fact, one of the Basic Stamp app notes uses a matrix of resistors and push buttons to make a "1 wire keypad" -- the idea is to make a "push button potentiometer" and read it as described above. The Parallax app note covers the Stamp I and my book, Microcontroller Projects with Basic Stamps (from CMP books) has a version for the BS2.
myp71
Posts: 585
Joined: Wed Apr 23, 2003 1:01 am
Location: Colorado
Contact:

Re: Resistor keys

Post by myp71 »

A bridge circuit-does that require a stamp?<p>Or there was metion about a LM339 (Quad) or LM393 (Dual) what would be the difference between these quad and dual and is this in addition to the stamp?<p>
Also I would like more info on the Standard Transistor Biasing.what kind would work for this app?<p>Thing is microprocessors and stamps are just too far above me right now in knowledge and budget wise :) <p>thanks for the information
:D
Bernius1
Posts: 349
Joined: Sat Sep 21, 2002 1:01 am
Location: NY
Contact:

Re: Resistor keys

Post by Bernius1 »

Look in your textbooks at how an NPN transistor is wired (basic ckt). The base resistor limits lo-side current, and either a collector or emitter resistor limit collector current. Sometimes a second base resistor ties to ground. The two make a V-divider and set base voltage. ( If equal, in a 9V ckt, the base is at 4.5V) If you have an emitter resistor, it raises the potential at the trans's emitter. As the emitter voltage gets to within .7V of the 4.5V, it will begin to turn off ( insufficient bias voltage). Conversely, as the base resistor tied to ground is decreased, as it approaches zero, it will reverse bias the B-E junction.
Can't we end all posts with a comical quip?
User avatar
Edd
Posts: 885
Joined: Sun Jan 27, 2002 1:01 am
Location: Dallas Tx
Contact:

Re: Resistor keys

Post by Edd »

If you weren’t to well versed on some of the circuitry, additionally refer to this schematic:<p>http://home.cogeco.ca/~rpaisley4/Comparators.html<p>Go to the 8th schematic window down to see the Voltage Window Detector Circuit.
For resistive values use a 1kΩ load resistor for the comparators outputs. Use 10KΩ resistors for R1 and R2 and a lower value for R3…its value , as proportioned to R1 and R2 sets the narrowness/width of the comparators window of acceptance of their sampled input.Smaller value, tighter window.
Using a value of ~25-50kΩ for RV .Place your obscured ( ~47k-100 k&#8486) metal film resistor in a housing with external contacts .This would be plugged in so that it shunts across RV’s wiper to gnd. Then adjust RV to its value where the output derived reference voltage falls in the center of the windows acceptance range and trips on the comparators output.End result… the unit switches on when that resistor value is plugged in.
If the logic output needs to interface to a control relay, drop on down to the relay interface circuit lower down on the page.<p>Info Addenda:
http://www.national.com/ds/LM/LM139.pdf
LM339 Da Da Sheet
Page 16 has devices pinout…12VDC pwr to pin #3
Ground pin #12…select any 2 comparator sections.<p>73's de Edd
[email protected] .........(Interstellar~~~~Warp~~~Speed)
[email protected].........(Firewalled-Spam*Cookies*Crumbs)
;) ;)<p>[ February 02, 2004: Message edited by: Edd Whatley ]</p>
rshayes
Posts: 1286
Joined: Tue Mar 04, 2003 1:01 am
Contact:

Re: Resistor keys

Post by rshayes »

The schematic referred to by Edd Whatley shows the basic idea. The potentiometer would be replaced by your reference resistor on one side (power supply to wiper) and your key resistor on the other side (wiper to ground).<p>The LM339 is four comparators in a 14 pin package. Only two are needed, but this chip is very common and easy to get. The LM393 is two comparators in an eight pin package. This is smaller, but may not be as easy to get.<p>The comparator outputs go high when the resistors balance, no basic stamp or other additional circuits are needed unless you need them for some other purpose. Some buffering will be necessary to drive a relay.<p>The LM393/LM339 comparators are relatively well behaved, but should have a bypass capacitor across the power supply close to the chip, probably a .1 uF ceramic capacitor.
myp71
Posts: 585
Joined: Wed Apr 23, 2003 1:01 am
Location: Colorado
Contact:

Re: Resistor keys

Post by myp71 »

ok on this circuit using the lm339 what pins do I use on this digram?<p>And I asked before about a buffering for a relay could you guys tell me again (I could not find the "relay interface circuit" further down on the page Edd was talking about) <p>also Edd was saying use a lower value than R1, R2 for R3.will any lower values work?<p>Thank you all
rshayes
Posts: 1286
Joined: Tue Mar 04, 2003 1:01 am
Contact:

Re: Resistor keys

Post by rshayes »

As a start, assume that your reference resistor, key resistor, R1, and R2 are all 10.0K 1 percent resistors. The divider using the key resistor and reference resistor could have an error of +/- 1%. The divider using R1 and R2 will also have an error of +/- 1%, and this could be in the opposite direction to the first divider. The middle resistor, R3, will be small and will not afect the error very much. The window width should be wider than 4%, as a start choose 5%. Most of the power supply voltage will appear across R1 and R2, with only 5% appearing across R3. The sum of R1 and R2 should be 19 times that of R3. If R1 and R2 are 10.0K each, their sum is 20.0K, and R3 should be about 1.05K.<p>If you are willing to adjust the reference resistor to matck the key resistor, the window can be narrower. This would mean a smaller value for R3.<p>The buffer circuit for the relay will depend on how much current the relay takes and whether it should be normally energized. I wouldn't ask the comparator outputs to sink much more than a milliamp or so. This would mean a 4.7K pull up resistor with a 5 volt supply or a 12K resistor with a 12 volt supply. A saturated switching stage will have a current gain of 10 to 20 using bipolar transistors. This would require two stages unless a sensitive relay is used, but the transistors are cheap. If a 10 or 12 volt supply is used, the buffer could use a small MOSFET. Remember to use a diode across the relay coil to control the transient generated when the relay is switched off.<p>[ February 02, 2004: Message edited by: stephen ]</p>
myp71
Posts: 585
Joined: Wed Apr 23, 2003 1:01 am
Location: Colorado
Contact:

Re: Resistor keys

Post by myp71 »

Thank you :D <p>just to be sure I can use a 1k for R3 right?<p>Yes it will be 12vdc power and the relay will be an automotive type(200ma) <p>so just use a power fet<p>g= circuit trigger <p>d= relay -<p>s= gnd<p>thanks again :D :D
rshayes
Posts: 1286
Joined: Tue Mar 04, 2003 1:01 am
Contact:

Re: Resistor keys

Post by rshayes »

The 1K resistor for R3 should be OK.<p>If you have it, a small power MOSFET should be OK for a buffer. Turn on will be relatively slow since the gate of the FET will be charged from a fairly high source impedance, possibly in the 100 microsecond range. The relay is much slower, so this won't really matter very much.<p>The peak power in the MOSFET will be 600 milliwatts when the device is halfway on (6 volts and 100 milliamp). Something larger than a TO-92 case will probably be necessary.<p>Don't forget transient suppression, that relay can probably generate quite a spike when it is turned off.
myp71
Posts: 585
Joined: Wed Apr 23, 2003 1:01 am
Location: Colorado
Contact:

Re: Resistor keys

Post by myp71 »

ok one more question what pins do hookup to the lm339's what goes where?<p>
thanks again :) <p>Ryan(myp71)
myp71
Posts: 585
Joined: Wed Apr 23, 2003 1:01 am
Location: Colorado
Contact:

Re: Resistor keys

Post by myp71 »

pin 3 goes to + vdc input and pin 12 goes to gnd I got that, oh and the ceramic capacitor goes to these pin 3 and 12 right?<p>I just need to know what input pin I use and output pins also do I gnd the unused pins both input and output?<p>
Thank you
myp71<p>[ February 03, 2004: Message edited by: my p71 ]</p>
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest