Jump to content

Greetings Know How community


G+_Ardi x
 Share

Recommended Posts

computer.png

Greetings Know How community. I have a project, where arduino needs to know if switch(DH) is whether closed or open. There is a relay (BF ) in parallel to the switch. I only need to know the position of the switch if the relay makes a connection between B and F. (The switch is car ignition and I will NOT be making any physical modifications to it. Happy to hear and discuss on your ideas??

Link to comment
Share on other sites

Ardi x I guess you could use a current sensor, with a resistor across it, attached to the hot-end of the ignition coil wire. You could then turn this into a digital 1 or 0 (on/off) using a voltage comparator.

 

I really don't see any other way to do this without "modifying" the circuits, and the above is the only way to go (the only modification you would be making is clamping a sensor to the ignition coil wire).

 

This is an example from sparkfun:

https://www.sparkfun.com/products/11005

Link to comment
Share on other sites

If the connections between B and F are a contact closure, you would be unable to determine if the switch is closed while B-F is also closed, without modifying the circuit. You would have to do the following:

 

- connect a diode from H to F in place of the wire connection (assuming H is battery positive and F is the switched load, anode to H, cathode to F). Closing the switch will cause the diode to conduct, powering the load.

 

- Connect a resistor (maybe 10 kohm) from H to ground. This will pull the switch output low, even if the relay is closed, because the diode will be reverse biased.

 

- Create a voltage divider with a couple of resistors to reduce the 14.4 volt battery voltage to below 5 volts, so an Arduino input can handle it. (You can use the 10 k resistor above as a part of the divider.

 

When the switch is closed, the Arduino will see a digital high; when the switch is open, the Arduino will see a digital low.

 

The diode will need to be sized to handle the load current, whatever that is. It will also add a 0.6 to 0.8 volt drop, so be sure the load can handle that.

Link to comment
Share on other sites

Based on the circuit that you provided, the Arduino can only "see" the switch at D-H when the contacts at B-F are open. Once the B-F contacts close, anything that happens beyond that connection is invisible to the Arduino.

I notice that some people here are assuming that the EFGH line is above ground, but as this is an automobile circuit (you said D-H is an ignition switch), the EFGH line is chassis ground, correct?

Link to comment
Share on other sites

William L. DeRieux IV Where would you attach the current sensor in the diagram.? The person who asked the original question said "I only need to know the position of the switch if the relay makes a connection between B and F" If you put your clamp-on sensor after the B-F contacts, once the B-F contacts close, your sensor won't read anything, regardless of whether D-H is open or closed, thus will not indicate the state of the D-H switch. Putting the clamp on sensor before the B-F connection will read current when the D-H switch closes, but will continue to read current when the B-F contacts close, regardless whether the D-H switch is open or not. Neither solution solves the person's question.

Link to comment
Share on other sites

cosmic Ray It will probably require more than 1 current sensor attached to the circuit so that it becomes a digital logic problem where you would have to come up a truth or logic table that describes the state of the relay and switch.

 

Without modifying the circuit, the only way to know what is going on is to use external phenomenon such as reading magnetic fields from the conductors (a current sensor).

 

I'm sure that B-F is not really a relay, but is instead the relay contacts (the part that the relay coils wither connect or disconnect) meaning that B-F is essential another switch.

 

Detecting the state of two switches, using the above, turns this into a binary logic problem.

 

Like I said, the options are severely limited without modifying the circuit.

Link to comment
Share on other sites

cosmic Ray

Here's quick sketch of what I'm talking about:

This should be the truth table with C1/C2 being current sensors, S1 is B-F, and S2 is D-H.

 

If Ardi x (the op) wants to know the position of D-H (S2) only when B-F (S1) is closed.....

 

The you would read current at C1/C2 like this:

 

C1=current flow

C2=no current flow

D-F (S2) is open

 

C1=current flow

C2=current flow

D-F (S2) is closed

 

In other words, when D-H (s2) is open C2 will have no current flow indicated. Like wise it is closed only when C2 indicates current flow.

 

I suppose C1 could be eliminated altogether -- remembering that C2 only read the current passing through the conductor it is attached to (and when D-H is open, this will be 0).

 

Also, C1 could in theory be connected between the relay contacts of B-H so that you could bread current flow through it.

 

Like I said, this is merely a binary logic problem at this point.

13350%20-%20truth_table.jpg

Link to comment
Share on other sites

William L. DeRieux IV Hi William, thanks for the detailed explanation and the diagram with logic chart, however your logic is not correct.

Your chart looks good until the last entry, which should read "closed - closed - flow - No flow". Now both line 2 and line 4 would show No flow through C2 whenever S1 is closed, which is correct.

 

Looking back at the original diagram, (and I also am assuming that B-F are relays contacts, not the relay coil), once B-F (your S1) closes, there will be no flow past that point. B-F effectively "shorts out" the rest of the circuit.

 

So again, once B-F closes, your S2 won't read anything, and thus won't indicate whether D-H is open or closed.

 

S2 only works when B-F is open, which is the opposite of what the person wants.

Link to comment
Share on other sites

cosmic Ray

S2 only works when B-F is open, which is the opposite of what the person wants.

 

I only need to know the position of the switch if the relay makes a connection between B and F.

 

If B-F closes (and based on what you said) -- the Arduino would never see D-H and this means that what Ardi x wants to do is not possible.

 

To make this work at all...there would have to be a resistor between terminals A and B so that B-F would not be a dead short (allowing some current to flow through D-H, if it were closed).

But again, this requires physical modification of the circuit.

 

It would be beneficial to have more information about why the position of D-H is critical only when B-F closes and what this is being used for (as that info might help to determine another way to do it).

 

As of, right now, I really can't see why the position of D-H matters, only, if B-H closes (D-H wouldn't matter at that point).

Link to comment
Share on other sites

William L. DeRieux IV Hi William. To quote you:

"If B-F closes (and based on what you said) -- the Arduino would never see D-H and this means that what +Ardi x wants to do is not possible."

 

Exactly the point I was trying to make (glad we agree on that!)

 

As to your resistor theory, I was thinking of something similar, although I would use two resistors, one in series with the B-F switch (relay) and one in series with the D-H switch. This would give us, when both switches were closed, a parallel resistance circuit, which would allow some current through DH even when BF was closed (and which would be detected by your C2 sensor). It would also give a different current reading when BF was open and DH closed, and a zero current reading when DH was open. The three readings could be used to give a remote indication of the state of the switches.

Link to comment
Share on other sites

cosmic Ray Putting a resistor in series with B-F / D-H would require modifying the circuit (something they said they didn't want to do) -- but I can't see any other way of doing it.

 

I think that the requirements of this Arduino project might need to be re-evaluated.

 

I guess we'll have to wait for Ardi x to give that more detailed explanation of what they are trying to accomplish.

Link to comment
Share on other sites

 Share

×
×
  • Create New...