Maker Pro
Maker Pro

Activate a relay when resistance is within a certain range

kapazo

Feb 21, 2014
7
Joined
Feb 21, 2014
Messages
7
Hello guys! first of all i have to say that i am a bit noob as far as circuit design etc is concerned.i have basic skills of electronics. i need a circuit that when a specific value of resistance is applied to one end then just activate a relay. is there any board on sale that does this? is it difficult to create something like this? Thanks.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Hi there and welcome to Electronics Point :)

I don't know if you can buy something like that, but it's not hard to design. You need a circuit called a window comparator.

You connect your resistance and a known resistor in series across the supply voltage to form a voltage divider. This produces a voltage at the point where the resistances join that depends on the resistance you're measuring. Then you feed that into a window comparator that will only activate its output if the voltage is between two specific limits.

What resistance are you trying to detect?

What tolerance on the resistance do you want to accept?

What supply voltage do you have available?
 

kapazo

Feb 21, 2014
7
Joined
Feb 21, 2014
Messages
7
i intend to use it at my car steering wheel control. in the center console i have 2 wires from steering wheel buttons. and depending on the button i press they get different values. for example 240 k ohms. and i want when this value for example is measured to activate a relay. Did that help? what more information should i provide.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
That's a good start.

Are we talking about a real car or a game contoller?

Is this resistance connected to anything else?

What are the buttons for?

What do you want to activate with the relay?

What is the overall purpose of the project? Please don't tell me it's a secret.
 

kapazo

Feb 21, 2014
7
Joined
Feb 21, 2014
Messages
7
yes we are talking about a real car. this resistance will not be connected to anything else. i want to activate a button from keyboard to skip tracks from my tablet. so my goal is to controll my tablet from my steering wheel controls. i know there is joycon which does exactly what i want but i cant use otg while charging with my tablet.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
So you have two buttons on your steering wheel and when you press one of them, a 240 kΩ resistance is connected across two wires in the centre console which currently aren't connected to anything. You want to detect that specific resistance (a range of, say, 230~250 kΩ) and activate a relay. The contacts of that relay will somehow activate something on your tablet. Is that right?

So you have a 12V automotive supply available?

What about the other button?
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
OK. I'll assume you don't want to do anything with the other button and you're only interested in a resistance of 240 kΩ. I will use a reed relay for the output because they are small and cheap and don't require much power. I'll draw up a design soon.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
OK, here's my suggested circuit.

272635.001.GIF

It's based around an LM393N dual comparator IC. This device contains two circuits that compare two voltages and produce an output signal according to which is greater. They are shown as triangles inside the IC outline.

With VR1 set to about 60 kΩ the series combination of VR1 and R1 is 240 kΩ. This resistance forms a voltage divider with the resistance you're measuring. When that resistance is also 240 kΩ the voltage at R2 will be half the supply voltage.

R2 feeds this voltage into one input of each comparator inside U1 (pins 3 and 6) and protects U1 from damage due to spikes, noise etc on the input.

R3, VR2 and R4 form a three-resistor voltage divider that generates two voltages that are proportional to the supply voltage. These two voltages are used as thresholds by the comparators in U1 - the high threshold voltage is on pin 5 and the low threshold voltage is on pin 2. The two threshold voltages are balanced around half the supply voltage (because R3 and R4 are the same value), and VR2 sets the difference between these two threshold voltages.

The first comparator in U1 (pins 1~3) detects when the sense resistance is lower than the low threshold. When the voltage on pin 3 is lower than pin 2, the comparator responds by driving pin 1 low. This pulls the base of Q1 down to about 0V and turns OFF Q1 and the relay, K1.

The second comparator in U1 (pins 5~7) detects when the sense resistance is higher than the high threshold. When the voltage on pin 6 is higher than pin 7, the comparator responds by driving pin 7 low. This pulls the base of Q1 down to about 0V and turns OFF Q1 and the relay.

Only if the voltage from the sense resistance is between the thresholds will both comparators allow their outputs to be pulled up to the positive supply rail by RP. This turns Q1 ON and energises the relay.

K1 is a reed relay with a coil voltage rating of 12V and a coil resistance of about 1 kΩ.

Normally a relay coil would need a diode connected across it to suppress the inductive kickback from the relay but in this circuit it is driven by an emitter follower (Q1) so no diode is needed.

CD is a 0.1 µF ceramic capacitor used to decouple the power supply for U1, and must be connected as directly as possible between pins 8 and 4 of U1, with its leads as short as possible, for reliable operation.

RS and DS protect the circuit against negative voltages and high-voltage surges and noise that are common in automotive power sources, and CS smooths the positive supply rail. RS must be a fusible resistor.

There is no filtering in the circuit to remove noise. The reed relay has a slight delay on energising and de-energising which may be enough to avoid problems. If the relay activates briefly when it shouldn't, you can add a 0.1 µF or 1 µF capacitor between Q1's base and the 0V rail.

The simplest construction option is stripboard. Connections (CN1~6) can be made with wires or dedicated plug/socket connectors.

The counter-clockwise and clockwise ends of the trimpots are indicated on the diagram.

To adjust the circuit, connect the desired resistance to CN1 and CN2 and adjust VR1 until the voltage at CN1 (measured relative to the circuit's 0V rail) is exactly half of the voltage on the positive supply rail (Q1 collector, etc). Then adjust VR2 for the desired window range.

You can replace VR2 with a fixed resistor of say 47 kΩ to get a window of about ±6%, or a resistor of 100 kΩ for a window of about ±12%.

Here's a list of Digi-Key catalogue numbers for the components:

CD 100 nF / 0.1 µF ceramic
http://www.digikey.com/product-detail/en/C420C104K5R5TA7200/399-4491-1-ND/818348

CS 100 µF 25V electrolytic
http://www.digikey.com/product-detail/en/UVR1E101MED/493-1061-ND/588802

DS 1N5929B 15V/3W zener
http://www.digikey.com/product-detail/en/1N5929BRLG/1N5929BRLGOSCT-ND/917658

K1 relay - two options
http://www.digikey.com/product-detail/en/9007-12-01/306-1280-ND/1914956
http://www.digikey.com/product-detail/en/HE3621A1200/HE208-ND/133261

Q1 2N3904
http://www.digikey.com/product-detail/en/2N3904BU/2N3904FS-ND/1413

R1~4 180 kΩ (x4)
http://www.digikey.com/product-detail/en/RNMF14FTC180K/S180KCACT-ND/2617454

RP 10 kΩ
http://www.digikey.com/product-detail/en/RNMF14FTC10K0/S10KCACT-ND/2617809

RS 33Ω fusible
http://www.digikey.com/product-detail/en/ULW2-33RJA25/985-1001-1-ND/2401865

U1 LM393N
http://www.digikey.com/product-detail/en/LM393N/LM393NFS-ND/458695

VR1,2 100 kΩ (x2)
http://www.digikey.com/product-detail/en/CT6EP104/CT6EP104-ND/738305

Stripboard
http://www.digikey.com/product-detail/en/8022/V2018-ND/565947

IC socket for U1
http://www.digikey.com/product-detail/en/AR-08-HZL-TT/AE10011-ND/821765

Suitable connectors
see http://www.digikey.com/product-search/en?pv286=83&pv286=86&FV=ffec5387,ffec5388,ffec538e,ffec538f,fff40016,fff803be,140716,141677,142158,142583,940002,1640056,e7c0002,13fc0001,13fc0006,13fc0007,13fc0008,14000001,14000002&stock=1&quantity=1&pageSize=500
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
How did you determine that pushing the button causes a 240K resistance when it is pushed? That sounds very unlikely to me. And what resistance is it when not pushed?

Bob
 
Top