Print Page | Close Window

resistor based door triggers

Printed From: the12volt.com
Forum Name: Car Security and Convenience
Forum Discription: Car Alarms, Keyless Entries, Remote Starters, Immobilizer Bypasses, Sensors, Door Locks, Window Modules, Heated Mirrors, Heated Seats, etc.
URL: https://www.the12volt.com/installbay/forum_posts.asp?tid=135798
Printed Date: April 28, 2024 at 2:03 AM


Topic: resistor based door triggers

Posted By: freqsounds
Subject: resistor based door triggers
Date Posted: January 12, 2014 at 2:20 PM

Hello,

Sorry if this is in the wrong place, but I'm not sure where else would qualify this question. I am doing a remote start in a car, but the door triggers change a resistance value on ground. I'm trying to figure out how to detect this, because using diode isolation supplies only 7 volts.

From the service manual for the car, it states:

"The switch contains a single pole breaker and 2 resistors. When the door is closed, the breaker is open and the resistance is 1.8 ohms. When the door is opened, the breaker makes and a resistance of 620 ohms is connected in parallel with the original resistance. The total resistance then drops to 460 ohms. The voltage measured will be approximately 4.1V when the breaker is made, and approximately 7.4V when open. If the control module sees 10.2V or 0V, it will be interpreted as an error in the circuit."

So I'm assuming I would have to create a circuit to detect this, but what could I use to detect the difference in resistance?

-------------
No question is stupid or not worth asking. You were once a noob, right? :)



Replies:

Posted By: cutter122
Date Posted: January 12, 2014 at 2:30 PM
whitch car model?




Posted By: freqsounds
Date Posted: January 12, 2014 at 2:34 PM
It's a 2009 Saab 9-3. The wire is gray, but it doesn't break the ground.

-------------
No question is stupid or not worth asking. You were once a noob, right? :)




Posted By: oldspark
Date Posted: January 12, 2014 at 3:43 PM
A voltage comparator circuit using eg an LM339.




Posted By: freqsounds
Date Posted: January 12, 2014 at 4:07 PM
oldspark wrote:

A voltage comparator circuit using eg an LM339.


Thanks for that! Is there a sample schematic out there that would help? I'm limited with my knowledge of chips!

-------------
No question is stupid or not worth asking. You were once a noob, right? :)




Posted By: KPierson
Date Posted: January 13, 2014 at 12:02 AM
Are you sure you didn't mean a 1.8K resistor instead of a 1.8 resistor? When you parallel two resistors together the resulting resistance is always less then the smallest resistor. Therefore, if you paralleled a 1.8 ohm resistor with a 620 ohm resistor the resistance would be less then 1.8 ohms.

If you parallel a 1,800 ohm resistor with a 620 ohm resistor you would get about 460 ohms.

You will need to find out which case you are looking for 4.1 or 7.4. If it were me I would set a comparator up at 5.7 volts and either look for anything above or below depending on which case I am interested in. I would not take the fault conditions in to consideration.

-------------
Kevin Pierson




Posted By: oldspark
Date Posted: January 13, 2014 at 6:24 AM
I agree with KP - your "1.8 ohms" should be 1.8K = 1.8 kilo-ohms - ie, 620 Ohms in parallel with 1800 Ohms = 460 Ohms.


For circuits maybe look at R. Paisley's Comparators (especially "Comparator Operation" & the following "Input Vs. Output Results") or 1. Basic Comparator Circuit (about 2/3rds down the page).

The rule for a comparator is that its output is ON when its - input is HIGHER than its + input.
And for the LM339, ON means GND - ie, it can sink up to ~15mA to 0V aka GND depending on which manufacturer). (The LM339 has an Open Collector output - ie, it is floating (not connected) when OFF, and connected to GND when ON.)

So, using KP's suggested 5.7V as a reference voltage and assuming a supply +V of 12.6V, a 10k & 12k resistor should do...
IE: 12k from +12.6V to LM339 pin 5 (+) and 10k from pin 5 to 0V (GND) means pin 5 will be 12.6V * 10k/(10k + 12k) = 12.6 * 10/22 = 12.6 * 0.45 = 5.72V.
Pin4 (-) goes to the 1.8k resistor side of the breaker.
When pin 4 exceeds 5.72V, the pin 2 output will connect to 0V/GND (18mA max).
When pin 4 is less than 5.72V, output pin 2 will "float" - ie, connect a 10k resistor between pin 2 and +V to pull it to +V (eg, +12.6V).
Note that the 10k resistor from +V to the output pin 2 means 1.45mA with +V = 14.5V (the typical max voltage of a 12V system).

Don't forget to supply power to the LM339 - ie, +V to pin 3 (Vcc) and 0V/GND to pin 12 (GND).
And all (input) pins of unused comparators should be tied to 0V/GND to prevent spurious triggering of unused comparators (the LM339 is a quad comparator, hence 4 comparators in the one 14 pin package; but there are 8-pin dual comparator equivalents).

The LM339 handles Vcc supply voltages over 30V so a vehicle's 12V system is no problem. But you might want some filtering (capacitors)...

I'd suggest connecting pin 2 (the sensing input) thru a 10k resistor (or 12k etc) to the door circuit (ie, the breaker & its 1800 Ohm resistor).
A 0.1uF cap could then be added (pin 2 to GND) for some filtering if needed.
And if the door circuit has spikes (which is doubtful since it will go to an electronic circuit and not to relay coils etc), diodes could be added to protect the LM339 input(s). (IE - reverse biased diodes from the input pin to each rail (GND & +V) with diodes lines (cathodes) towards +ve; any diode - small signal 1N4148, 1N914 etc, or power diodes 1N400x etc).


Sorry if that's a bit much, but it covers several circuit basics (Google LM339 or 'comparator" applications & circuits).


Of course if you prefer simpler electronic circuitry and programming, there is always the PICAXE 08 (08M2) - an 8-pin 08M2 with a 5V regulator & a similar input circuit (voltage divider = 2 resistors, a cap and protection diodes) and output buffer (transistor or MOSFET to control high current devices) and you the program all behavior instead of changing comparator circuit values.


And dare I mention that by my rough calcs, that door circuit has another resistor and a maybe certain supply voltage (eg - a 620 Ohm resistor with its +V = 10V) whereas the comparator circuit varies its reference voltage (5.7V) depending on its +V - not that that should be a problem in this case (ie, discriminating an alleged 7.4V from 4.1V - not that the documentation specifies what the supply voltage is or if that circuit has a regulated supply...?)...
Ah, Hallowed be the Ori PICAXEs...




Posted By: freqsounds
Date Posted: January 13, 2014 at 7:45 PM
oldspark wrote:

I agree with KP - your "1.8 ohms" should be 1.8K = 1.8 kilo-ohms - ie, 620 Ohms in parallel with 1800 Ohms = 460 Ohms.


For circuits maybe look at R. Paisley's Comparators (especially "Comparator Operation" & the following "Input Vs. Output Results") or 1. Basic Comparator Circuit (about 2/3rds down the page).

The rule for a comparator is that its output is ON when its - input is HIGHER than its + input.
And for the LM339, ON means GND - ie, it can sink up to ~15mA to 0V aka GND depending on which manufacturer). (The LM339 has an Open Collector output - ie, it is floating (not connected) when OFF, and connected to GND when ON.)

So, using KP's suggested 5.7V as a reference voltage and assuming a supply +V of 12.6V, a 10k & 12k resistor should do...
IE: 12k from +12.6V to LM339 pin 5 (+) and 10k from pin 5 to 0V (GND) means pin 5 will be 12.6V * 10k/(10k + 12k) = 12.6 * 10/22 = 12.6 * 0.45 = 5.72V.
Pin4 (-) goes to the 1.8k resistor side of the breaker.
When pin 4 exceeds 5.72V, the pin 2 output will connect to 0V/GND (18mA max).
When pin 4 is less than 5.72V, output pin 2 will "float" - ie, connect a 10k resistor between pin 2 and +V to pull it to +V (eg, +12.6V).
Note that the 10k resistor from +V to the output pin 2 means 1.45mA with +V = 14.5V (the typical max voltage of a 12V system).

Don't forget to supply power to the LM339 - ie, +V to pin 3 (Vcc) and 0V/GND to pin 12 (GND).
And all (input) pins of unused comparators should be tied to 0V/GND to prevent spurious triggering of unused comparators (the LM339 is a quad comparator, hence 4 comparators in the one 14 pin package; but there are 8-pin dual comparator equivalents).

The LM339 handles Vcc supply voltages over 30V so a vehicle's 12V system is no problem. But you might want some filtering (capacitors)...

I'd suggest connecting pin 2 (the sensing input) thru a 10k resistor (or 12k etc) to the door circuit (ie, the breaker & its 1800 Ohm resistor).
A 0.1uF cap could then be added (pin 2 to GND) for some filtering if needed.
And if the door circuit has spikes (which is doubtful since it will go to an electronic circuit and not to relay coils etc), diodes could be added to protect the LM339 input(s). (IE - reverse biased diodes from the input pin to each rail (GND & +V) with diodes lines (cathodes) towards +ve; any diode - small signal 1N4148, 1N914 etc, or power diodes 1N400x etc).


Sorry if that's a bit much, but it covers several circuit basics (Google LM339 or 'comparator" applications & circuits).


Of course if you prefer simpler electronic circuitry and programming, there is always the PICAXE 08 (08M2) - an 8-pin 08M2 with a 5V regulator & a similar input circuit (voltage divider = 2 resistors, a cap and protection diodes) and output buffer (transistor or MOSFET to control high current devices) and you the program all behavior instead of changing comparator circuit values.


And dare I mention that by my rough calcs, that door circuit has another resistor and a maybe certain supply voltage (eg - a 620 Ohm resistor with its +V = 10V) whereas the comparator circuit varies its reference voltage (5.7V) depending on its +V - not that that should be a problem in this case (ie, discriminating an alleged 7.4V from 4.1V - not that the documentation specifies what the supply voltage is or if that circuit has a regulated supply...?)...
Ah, Hallowed be the Ori PICAXEs...


That's correct, sorry about the typo! It's 1.8k ohms. This is pretty intense and almost makes me wonder if I should just put a proximity sensor in the car and be done with it LOL.

I am trying to wrap my head around how all the components work together. I understand what they do, but I don't understand how to mix them together to get them to do what I need it to. Perhaps its because my limited knowledge on integrated circuits. I checked out the site and was overwhelmed! :)

So, if I understand correctly, this can monitor all 4 doors, right? Each door in the car (including the trunk) are set up with the exact same circuit. I would need a 2nd IC for the trunk?

If I were to build a circuit as you described, how would I test it? With my car having sensitive circuits, I'd hate to put my first circuit in the car and fry the BCM by accident!

I am good with schematics and can build a circuit based on one. It just takes me forever to figure out what it does. I built the circuit in this PDF: https://www.treyadcox.com/93/Saab%209-3%20Remote%20Start.pdf to get the remote start to work. I had to consult with someone to figure out what the delay circuit was, but I still can't understand how exactly it works.

I think for this to work, I would have to do some extreme studying and understand the terms and formulas. Is this circuit the only solution for something like this? I have the motivation to learn, but don't have a whole lot of time; I have to get the car back together. :) I truly appreciate everyone's help!



-------------
No question is stupid or not worth asking. You were once a noob, right? :)




Posted By: oldspark
Date Posted: January 13, 2014 at 10:11 PM
Actually IMO it's easier to do than understand. Or certainly easier than trying to understand my gibberish above. In some ways it may be easier than that SAAB circuit.

All I reckon you need to understand is...

- a comparator is a device (chip, circuit, (gate??) with 2 inputs and an output.

- the output is ON when the comp's '+' input has a lower voltage than its '-' input.
NOTE - that + & - input has nothing to do with +ve or -ve voltage; it's merely the labels used to designate which input, namely non-inverting (+) or inverting (-). That jargon comes from Op Amps (Operational Amplifiers) on which Comparators are based. (Instead of buying quad OpAmp chips/integrated-circuits) and adding components to make them into Comparators, manufacturers have already done that in chips like the LM339.)

- you connect your tested voltage to one input.
- the other input has the 'reference' voltage - ie, the voltage where you want the output to turn on or off (aka change state).
- the Ref voltage is set using a (resistive) voltage divider (see Wiki).


That's basically it.
The other considerations are whether it's to be on or off when the tested/probed voltage is above or below the Ref voltage [that determines if the Ref is a + input or - input and hence tested input is - or + (ie, inverting or non-inverting) respectively] and misc other things...

The Misc's include supplying power to the Comp circuit (ie, the chip) and whether the output can handle the load.
Also voltage supply & ranges but that's not an issue since the LM339 etc uses a "single supply" (eg, +12V & GND, not +12V, 0V/GND and -12V) and your sampled voltage falls within its 0V to +12V range. (When I say +12V, I really mean whatever voltage the car is - eg, 10V to 14.4V etc.)
Then there are esoteric misc's like spike protection, noise filtering, tested voltage variation (from what the book said) etc. That's also called bluddy OldFart's rambling and is probably not an issue in this case. Or to paraphrase, an LM399 is cheap enough to suck and see and then worry about that esoteric crap if required (or if going into production...).


So yet again I have added extra ramble to a mere 'simple understanding', but maybe it will now be clearer.
BTW - my replies often take several reads - ie, a bit at a time. And my parentheses denote extra or incidental info that may not be needed but may pre-empt future questions or make readers aware of possible issues or alternatives.


Re one Comp per door hence one "quad pack" LM399 for 4 doors - yes, BUT...
It may be possible to do all (or 2) with a single comparator.
EG - from the National LM339 Datasheet page 5 is the following "OR" circuit - ie, output f is OFF if A or B or C are high.

posted_image
- with thanks to National Semiconductor

Firstly, that circuit is merely an example. You would use different resistor values and have a different Ref voltage.

Secondly, merely to explain how it behaves (without going into the resistive voltage divider Voltages that appear), I've written the following.
NOTE - I thought the circuit was wrong but even I got confused about "ON" versus "high" or "low". Don't worry about such "[Logic" issues - they'll blow my your brain. Suffice to say it is all easy to change later if you get confused (ie, swap + & - inputs).

If output f is OFF, the 3k resistor to V+ pulls f high (aka Logic 1), ie...
If any of inputs A or B or C go high to V+, then the + input voltage is higher than the Ref - input voltage (+0.075V in that circuit) and hence the output is off (high).
If no inputs are high, then the inverting (-) input's voltage is higher than the non-inverting (+) input thereby turning the output (transistor) on which pulls output f low to GND.
(So yes oldfart, that circuit is correct. Of course it is - it's National!)

The point being that if you only want one output if any door is open (or closed, whatever), then you could use that circuit.
It's the same if you only want to combine 2 doors so you only need one chip (LM339) for the lot.   
Or combine more so that you have spare comparators to invert or buffer the output... (that's another story!)

And now your brain should well and truly be fried! As if circuitry isn't bad enough, you have also been introduced to Logic circuits where low & high and 0 & 1 and off or on are totally arbitrary and depend on what you call "active" (eg, high, or 1, or 1 but low, or.... posted_image


Oh yeah, just as these comparators are almost infinitely configurable, so too there are almost infinite ways to do this.
However IMO it's either something DIY like this, or DIY using a PIC 08M2 etc, or more expensive circuits whether commercial & processor or analog based etc.


PS - IMO there no need to include the previous reply in your reply. Of course that's merely my view (I like to save screen space, bytes, & paper).
If I do, I usually only quote the relevant lines(s) else delete and use dots ... to replace the bulk between the first & last lines.




Posted By: KPierson
Date Posted: January 13, 2014 at 10:40 PM
Can you just monitor a dome light?

-------------
Kevin Pierson




Posted By: freqsounds
Date Posted: January 16, 2014 at 4:28 PM
KPierson wrote:

Can you just monitor a dome light?


I could, but my dome lights stay on for 60 seconds after the doors are closed. It would cause a 'door open' error on the alarm if I arm right away. Although, it would give myself enough time to have a cigarette before I get to where I'm going! :)

I'm thinking the proximity sensor would probably be my easiest option. I can always go back and try to build the circuit later, but this would take care of things until I get a chance to play with the circuit.

-------------
No question is stupid or not worth asking. You were once a noob, right? :)




Posted By: KPierson
Date Posted: January 16, 2014 at 9:13 PM
You can turn off that zone tripped warning beep.

-------------
Kevin Pierson




Posted By: freqsounds
Date Posted: February 03, 2014 at 4:28 PM
KPierson wrote:

Can you just monitor a dome light?


I could, but the lights stay on for 60 seconds after the door is closed. I really wish the DBALL would work since it's a GM-manufacturered car... I thought about hooking it up, but didn't want to chance it.

-------------
No question is stupid or not worth asking. You were once a noob, right? :)




Posted By: freqsounds
Date Posted: February 03, 2014 at 8:00 PM
Alright, so I was able to study all this context as I was snowed in all week last week. After 3 trips to the electronics shop, two circuit boards, and two soldering iron tips, I was able to get it working!

I attached a schematic of what I used. Please keep in mind this is my first schematic, and some info may not be 'standard' or 'correct'.

I had to put the threshold voltage on pin 4, and the input on pin 5. The reason is because if a door is opened, the voltage will drop to 4.1V. If all the other doors were closed, it would keep ground on the outputs. So by flipping the polarity on the LM339's inputs, the outputs will see ground when the voltage drops below the threshold.

In addition, I couldn't diode isolate all 4 doors into one input on the LM339. The reason is because with all doors closed, it would show 7.4V on the input. If a door was opened, that door would drop to 4.1V, but the other 3 doors would remain at 7.4V, and the highest voltage wins. Simply put, the voltage would never fall below the threshold unless all doors were opened at the same time.

In my schematic, I added an LED to the circuit. This will allow me to see at a glance whether the zone is triggered. According to the Service Manual for the Saab, the hood and trunk pins work the same way -- resistance based triggers. So I used a second LM339. As you stated, the unused inputs need to be terminated to eliminate false readings. So because we inverted the polarity of the inputs, I wired up a 10k resistor to the +12V instead of GND (not sure if the resistor was actually required though - it worked with or without).

Alright, back to the LED. With 3 separate triggers in this module, each output was spliced and diode isolated to the LED (if that makes sense). The (+) side of the LED to direct +12V, and the GND to the anodes of the diodes. This way if a zone is triggered, the door, trunk, and hood don't all trigger at once.

I tested the circuit as I was building it using a battery charger at 2A.

I haven't put it in the car yet, but I'm pretty confident it will work. I tested using a potentiometer on each input of the circuit.

Thanks for everything guys! I'm glad this was able to work out, because this proximity sensor has been going off every night a cat crawls under the car. Neighbors are pretty mad! xD

posted_image
posted_image
posted_image

-------------
No question is stupid or not worth asking. You were once a noob, right? :)




Posted By: freqsounds
Date Posted: February 09, 2014 at 11:52 PM
Hey guys, I think I'm back to the drawing board on this one. I put the circuit in the car and it works great! For the first 10 minutes...posted_image

What the service manual doesn't tell you is that the BCM cuts off the voltage on these switches after 10 minutes. When metering, the lines are dead, around .3V until the BCM 'wakes up'

So, other than taking a before-and-after reading on the resistors, is there any way I can just detect the resistance itself where voltage isn't a factor?

I smell a new circuit! posted_image lol

-------------
No question is stupid or not worth asking. You were once a noob, right? :)




Posted By: freqsounds
Date Posted: February 11, 2014 at 2:04 PM
*bump* Anyone?

-------------
No question is stupid or not worth asking. You were once a noob, right? :)




Posted By: oldspark
Date Posted: February 11, 2014 at 5:50 PM
That means disconnecting at least one end of the resistance and measuring it - ie, injecting your own voltage and measuring the current. So forget that...

You need to use a mechanical solution - ie, tap into whatever switch it is that switches the resistors and see if that's closed or open. That too can be tricky unless its a grounding switch, but it's easier than measuring resistance.

Any chance of fitting an optic or micro switch etc to whatever moving parts are involved?




Posted By: freqsounds
Date Posted: February 11, 2014 at 6:26 PM
That's what I was thinking, and it'd have to be for each door. Sounds like too much work haha!

I have been thinking about it all day today. I wonder if I can find a +12V wire that shuts off at about the same time the door voltage does. If so, I can use a relay to turn off the circuit to the alarm. Since the car knows when that door opens and wakes the BCM, I'm thinking it might just work, especially if I put a time delay to the LM339 circuit card. Does this sound like something that might work?

Unfortunately, these door latches are sealed with rivets. I'm afraid to pull it apart lol.

I was checking out the entire schematic for the central locking system, and everything ties into the CIM (Column Integration Module). I was thinking of pulling it apart to see if there's a 'status wire' inside. This module is also receives signals from the remote. I would like to find at least the 'Lock' circuit for the remote so I can keep my auto-windows-down feature (i.e. tie the alarm to that circuit and latch it to roll the windows down).

The problem with the CIM is they're expensive, and if they go bad, a dealer has to program them and re-marry/re-flash every module in the car.

Oldspark, you've been a great help with all of this! Thank you for your help! How do you feel about controlling the power to the LM339 circuit via relays? If it's a good idea, should I use a micro SPDT 12V relay to keep the heat low?

-------------
No question is stupid or not worth asking. You were once a noob, right? :)




Posted By: oldspark
Date Posted: February 11, 2014 at 7:18 PM
There MUST(??) be a way of synching or latching this beast. I feel it - but ATM my head's too heavy to realise it.


Relays for the 339?
My first comment is that - except if ON when 'the power source' is on (ie, IGN on or alternator is charging) - I consider it silly to use something to turn something on when that use more power than the thing being turned on. IE - a relay consumes say 60mA to 250mA whereas the LM339 itself consumes ~2mA, maybe 5mA.

Chances are that whatever you use to energise the relay can power the 339 circuit direct, else via a MOSFET or transistor (on the +ve side, but -ve/GND side may be ok in this case).



FYI (ramble only...) - note 'the power source' issue. I use a relay to turn on my dash's 3 digit voltmeter. The voltmeter consumes 7mA.   But it's only on when IGN is on and hence the relay is a negligible addition, and irrelevant once the alternator is charging.
And the relay is required because it's a 2-wire voltmeter. Hence it measures voltage across its 2 wires and - of course! - I'm measuring battery volts - not battery volts after fuses, connectors IGN switches, etc.
Admittedly I am using a tiny DIP relay with a 1k coil (hence ~12mA or equivalent to a LED) and it also has manual activation and hold-on with a timer, but the point is that's one application where a 250mA relay to power a 7mA load is valid, and quite acceptable.

But I often see ridiculous installs where some high current drain is used in standby applications - eg, NE555 timer circuits on batteries or monitoring solar applications (the 555 itself consumes 10mA), or energised relays to turn on things when IGN is off (instead of using an SPDT NO contact), etc.




Posted By: freqsounds
Date Posted: February 11, 2014 at 7:49 PM
oldspark wrote:


Relays for the 339?
My first comment is that - except if ON when 'the power source' is on (ie, IGN on or alternator is charging) - I consider it silly to use something to turn something on when that use more power than the thing being turned on. IE - a relay consumes say 60mA to 250mA whereas the LM339 itself consumes ~2mA, maybe 5mA.



I agree, and I was thinking the relay would only be on for 10 minutes tops, and using ground while armed, it would only power the relay if the car was armed.

Also, thinking about how you can 'pull' a voltage, what if I diode isolate the door triggers and use a resistor to 'pull' +12V when the lines die? This would prevent the LM339 from triggering, right?

I'm just trying to think of some options! posted_image

-------------
No question is stupid or not worth asking. You were once a noob, right? :)




Posted By: oldspark
Date Posted: February 12, 2014 at 2:53 AM
To pull a voltage you first have to convert it into doll form...
Sorry - wrong forum... posted_image posted_image posted_image

I re-read this thread to see if I have understood correctly and noticed your " I couldn't diode isolate all 4 doors into one input on the LM339...". That's where you'd use the circuit I posted on page 1. Each door goes to one resistor (ie, A, B, C, or D).
Assume the Ref signal is set correctly near the 'normal' door outputs - ie, with all doors closed there is a certain voltage at the 339's + input.
When one door opens, it lowers the voltage to the 339's + which is enough to flip the 339's output.

Forget the detail for now - even I don't know if + has to be greater than - for the output to be on, or off... I'd have to research that - ie, re-read what I wrote earlier. The point is the principle. (IMO get the high-level aka concept right, then you merely work out or drill down into the details. That's how I used to do the impossible like electronic Haldas, dim fluorescent lights, impossible software tasks, faster than light travel (anti-grav), etc.)

The concept here is:
- you know diode isolating 4 doors to ONE point means the highest voltage overrides...
- but connecting each door thru a diode to one of the ABCD 100k resistors is NOT the same point...
- and (intuitively?) if all inputs are 7V then 339 + is 7V but if ONE of those drops to 3V then so too will the 339's + input.

I used 7V & 3V to approximate whatever your door voltages are (details... merely details) and to make this next line easier:
If one input goes low, the 339 + will be 6V.
If 2, it's 5V. 3 => 4V.
And if all 4 doors are 3V, then 339 + is 3V.

Anyhow, hence you'd set the Ref voltage (339 -) to 6.5V.

And if I've confused the 339 + & - then swap those inputs in the above. (Mere details - but you said you had to swap... but that might have been based another circuit... Ah, details!)


BTW - diodes would not be required for the page 1 circuit/diagram since the doors are joined via 100k resistors (hence 200k between 2 doors) and that 100k is much bigger than the door's max resistance of 1.8k. (IOW the current thru the 100k's are negligible compared to the 1.8k etc.)
Diodes would be used if the resistances were of similar magnitude, or diodes could be used to ensure isolation. They'd be nice to omit for calculation purposes, but since the REF voltage would be adjustable via a trimpot (variable resistor aka TRIMable POTentiometer), it's no big deal.

And you can usually change 'a high voltage overriding lower' to 'a low voltage overriding higher' by changing diode direction, and maybe pull up-or-down resistors etc. But lets forget such details for now. (Or rather, let ME forget about them!)



Ok, I digressed.
But for the sake of readdressing a missed issue, or pointing out the minor yet major difference between OR-ing aka diode-joining into ONE point as opposed to joining via different inputs, or alternatively joining via resistors to a single point...


But I'll adjourn here and address the lost power problem in my next reply.





Posted By: oldspark
Date Posted: February 12, 2014 at 3:28 AM
So the BCM shuts off the voltage to the doors. Hence you cannot 'sense' using the 339 etc.

I therefore wonder how the vehicle/BCM senses when the door opens, but let's (or let me) not worry about that for now.

[ Apologies. Tho heavy headed this morning, I now seem to be in a non-thinking state of mind - ie, a refusal to think. That may be a reflection of locals and their reaction to recent political actions, fires, and general ongoing moronics. I then tend to go into shutdown mode - I get sick of repeating the same decades old lines to the same old audience. ]


My initial thought - series diode between the BCM and each of the doors to isolate the BCM. You supply power via a diode and resistor to each door to continue using the 339 approach.


Issues:

Will the diode effect the BCM's measurement of the doors?
Ans: Maybe or probably not if the BCM has a typically wide tolerance for the voltages measured, or if Schottky diodes are used (ie, a 0.3V drop instead of 0.6-0.7V)

What resistor do you use?
Ans: I had inconsistencies when calculating the resistance used by the BCM to the doors. But that could be solved with more info - ie, what system voltage was used for the Service Manual's statements? (ie, 'The voltage measured will be approximately 4.1V when the breaker is made, and approximately 7.4V when open...', or BCM circuit, or a proper solution to various simultaneous equations...


Djävla SAABs! (That's Swedish for bluddy SAABs. More accurately doggamned SAABs (or statanic, devilish, etc).)   
Of course maybe I could blame GM if they are the true designers of the bluddy SAAB.
Now if it was a SAAB Viggen I'm sure I'd be more enthusiastic. After all and plane that is laughed at by NATO et al but is later copied by many, and can shot down SR-71 Blackbirds, outmaneuver MIGs, etc...


I guess I'm just thinking aloud. (And whinging a-very-loud.)
And giving you some electronics (conceptual) theory for the heck of it.
Can't you just buy and old 3-cylider 2-stroke SAAB? posted_image


Till next...




Posted By: freqsounds
Date Posted: February 12, 2014 at 6:51 AM
Lol!

It's a 2009 9-3 Aero V6 6-spd. It's the best car I've ever owned IMO. It's fun to drive, sporty, but a wiring nightmare. xD

In regards to the diode isolation, allow me to explain what I meant. Each door signal would come in to the circuit and immediately hit a diode to isolate the BCM. From the diode, each signal would go to their respective input on the LM339. After the diode and before the input, a resistor would pull +12V to the signal wire when the BCM turns the power off. Is this how it works? Similar to pulling the signal to ground in the first circuit on page 1.



-------------
No question is stupid or not worth asking. You were once a noob, right? :)




Posted By: oldspark
Date Posted: February 12, 2014 at 9:32 AM
To paraphrase:
From BCM thru a diode with line end towards door (ie, 1.8k & 620R to GND.
"Your" resistor from +12V to line-end/door-resistors.

So your resistor needs to be similar to the BCM's internal resistance, AND its +12V is only on when the BCM turns off. (Ah - we need a comparator to sense when the BCM is off...)
And your +12V should be whatever voltage the BCM uses internally (maybe 10.2V?), but that might not matter if the REF voltage can be set to a suitable value.


Have you ever heard of a PICAXE - specifically (say) the 08M2? They are like a self-contained microprocessor circuit but all on one chip.
The 08M2 has 8 pins and has timers, counters, analog to digital converters (ADCs), a DAC (digital to analog coverter), programming space for ~2,000 instructions, etc. About $3. Consumes 14uA (or was it 14nA?) in standby mode, blah blah blah. Programmable via a serial port (legacy PC stuff or via USB-serial converter).
Usually all PICAXE pins - EXCEPT the +V & 0V supply pins and one dedicated input - can be configured as inputs or outputs.   Hence the 08M2 can have 5 inputs and 1 output, or 4 inputs & 2 outputs etc.
Minimum config is a 78L05 5V voltage regulator plus 2 programming resistors; then add whatever input and output circuitry is needed.
Programming tools are free and there are heaps of open source projects & programs (see picaxeforum.co.uk).

The problem is the learning curve for programming etc, tho much can often be cut&paste with a few modifications. (Programs are often much the same - it's merely what they input and output that varies. Programs can often be thought of as a collection of building blocks (program segments or modules) that are put together in different orders to achieve a goal).
But I have been surprised how some have adopted the 08M2 (or bigger/more_complex equivalents) to substitute tricky or complex circuitry, and done so with apparent ease. (I've suggested it a few times on mp3car.com and been impressed by its uptake. FYI - I've been meaning to use PICs etc for 20 30 years & finally bought a few maybe 5 years ago, but have yet to actually use one!)

I'm thinking that the PIC could be programmed along the lines of "if I see 7V or 4V, then... but if I don't see that...".
If not the expected 7V or 4V, then maybe 'your' external resistor of say 10k** supplies the door voltage (which will then be much smaller than with the BCM - eg, 0.7V & 0.4V).
Sir PIC Esq then works like:
- if 7V or 4V or in between the BCM is on and hence the doors are closed, or one is open etc.
- if 0.7V or 0.4V or between, then the BCM is off (not that I care) and hence doors are closed or one open etc.
The "in between" voltages will be similar to that A, B, C, D input comparator circuit if all combined to one input, tho you could combine 2 into 1 input (hence 2 PIC inputs for 4 doors), or use one PIC input per door. (Tho the latter might require 4 ADCs and I think the 08M2 only has 3, but hey, they're mere details.)

** The 10k or whatever resistor is reasonably larger than the BCM's resistance so it does not effect the BCM/door voltages - and hence no diode/s needed (unless the BCM is so sensitive that that low current could wreck its inputs when it is powered off).    

Sir PIC also has the error routines like if 12V or 10.2V then something is wrong and same too for 0V (tho in practice 0V should always be programmed as "less than z Volts" where Z is lower than what we work with (eg, 0.4V) but high enough to allow for noise and wiring resistance etc - eg, Zero Volts is less than 0.2V.

Incidentally, the voltages I mention above are our real world voltages - ie, the actual door voltages.
These will be lower for the PIC because the PIC only handles voltages up to its own voltage supply (ie, 5V with a 7805 regulator, but can be down to ~2V) and we therefore scale down our voltages which will be up to 10.2V or 12V or 12.7V or maybe 14.4V etc.
Scaling down is a techy way of saying a two resistor voltage divider. (IE, it's easy in reality.)   

But anything is possible. Maybe Sir 08M2 turns on the door supply if it senses that the BCM is off. (Hence one output for that.)
Maybe it alerts you in case of a fault if the BCM etc does not do that (it should!).
Or add your hood switch; maybe a boot/trunk switch.


The beauty of uPCs and PICs etc is that once you have the interfacing (input & output circuitry) it is simply (LOL?) a matter of programming.
You reprogram changes to voltage set points etc - there is no trim-potting or component changes.
You might start by using 4 PIC inputs but then add stuff that requires more inputs or outputs. You might then combine the 4 inputs - move the other 3 inputs to the one and modify you program. (That assumes each input (door) has its own series resistor, but a design should probably have that for various electrical reasons but especially so that a capacitor can be added to filter out any noise on each input [an RC filter is much easier than software solutions].)
And a PIC can operate with negligible current (uA) so it can be on all the time.


Does any or all of that make sense?
Or do you want to stick with the analog solution for now?

I reckon we might be close to the analog/339 solution, but if it does get too complex...


But it's bed time. My alarm will show no mercy in less then 6 hours...


PS - there are various considerations for the 08M2 like choice of inputs - eg, might be able to have 5 inputs but there are only (maybe?) 3 ADCs), but they all have solutions (like maybe digital inputs but they'd only be good for sensing if eg IGN was on or off, not if 7V or 4V... unless a zenor circuit was used... posted_image ...)
Details. Mere details. (Did I mention the learning curve...? posted_image )




Posted By: freqsounds
Date Posted: February 12, 2014 at 10:40 AM
It actually makes perfect sense! I'm a web developer by trade, so hopefully it'll be easy enough to learn a new language posted_image

I will take a look into the PICAXE this afternoon to see what I'm getting into.

I almost feel like the analog solution is something 'simple'. If we could just 'disregard' any voltage less than 3V or somewhere around there, it'd be perfect! Or, set a 'default voltage' if that's even possible.

So to answer a question about the BCM. The service manual doesn't go into detail about a regulated voltage or anything like that. Metering while the car is off will yield the reference voltages (4.1 - open, 7.4 - closed, ±0.3V depending on the battery charge). I haven't tried metering these with the car running, so I don't know if these values increase as the battery is charging. But the voltage hangs around 14.0V when the engine is running. About 12.5 with the engine off.

This actually caused an issue with the original circuit, and I had to add another 2.2k resistor to lower the threshold more. At 14V, it pushed the threshold voltage too high and set the alarm off every time, thinking that 7.4V was a door opening.




-------------
No question is stupid or not worth asking. You were once a noob, right? :)




Posted By: oldspark
Date Posted: February 12, 2014 at 4:02 PM
Ahh - then you know how easy it is to get a program right. posted_image posted_image
(Man I am using those emoticons in this thread. I rarely use those - probably a legacy of my IT experience. Where was it I said something about shutting off from involvement? Hmmm...)
(Actually I just realised - I usually work high level & drill down..., but for uPCs I preferred assembler. And oddly enough my coding was largely bug free - ie, well past power-up and well into functionality before a problem might show.)


Tho the PIC etc might be the way, I'd still like to 339 it. Probably because you already have the stuff - and have done so excellently well** - and I feel it has such an easy solution.
{ ** not meaning to patronise etc, but you said <whatever> yet have done so much so well. I think we work alike. Everything is the same, just different. However, you actually do & achieve things. posted_image )

The charging voltage issue is solved with a voltage regulator for the 339. And it seems to confirm that the BCM is regulated (if I understood correctly), tho the ±0.3V depending on the battery charge doesn't. (Is the BCM off with the engine running? In simple theory cranking batteries vary from 12.7V to ~12.4V (20% discharged) but in practice from ~13.5V (surface charge) to ~11.5V (dead flat) and lower (under heavy loading - cranking etc).)


I might have another crack at those calculations. (I think I ended up iterating because I kept getting negative (resistance) values - hence something wrong with my calcs.)


Download the 3 intro refs to PICAXEs from picaxe.com, namely PICAXE Manuals.
OMG - they've added a 4th "Using Flowcharts". Who the heck would use them (except post-design for documentation for others)? Tho PICAXES may be different in that the flowcharting tools can translate into programs. Or maybe that can be done now for all languages?? (NB. I'm Oldspark = OldFart.)

Anyhow, work calls....




Posted By: freqsounds
Date Posted: February 12, 2014 at 4:39 PM
Haha! As long as I know you're not mad at me for trying!

I have that drive where I can't take 'no' for an answer, especially when it's something that I really want to see done. I'm always willing to learn and explore new areas. I'm no expert, I don't have a 'specialty', but I try to get at least a little experience in everything. I appreciate the compliment!

I would like to see the 339 work too, just because it seems so simple, and this 'roadblock' can't be the only thing to hold the project back! posted_image

The BCM stays on while the engine is running. I don't know if it temporarily shuts off during starting. I'm not even sure how I'd test that (during starting) other than metering the wires while cranking.

The battery charge I speak of is from having the car 'awake' too long. I think the last time I had 3.9V with a door open from repetitively opening and closing doors. So the car might be regulating the voltage, but I'm not entirely sure, and I'm not sure who might know. posted_image

I haven't had a chance to look up the PICAXEs yet. But I will take a look at those links this evening.

I've heard of Flowchart programming -- Microsoft Visio can translate a flowchart into simple code. It can generate database scripts based from a database diagram as well. So it might be something they're introducing so the 12 year old kids have something to do haha! posted_image

I have two installs tonight, and hopefully afterward, I can pull the circuit and play around with it. It's snowing here, but I should be able to get out there as long as I have my torpedo heater!

-------------
No question is stupid or not worth asking. You were once a noob, right? :)




Posted By: freqsounds
Date Posted: February 12, 2014 at 8:03 PM
Alright, so I took the circuit out, used a 10k resistor on the door signal inputs, and the light goes out. But this only works if the inputs aren't grounded. So if the BCM 'floats' these trigger wires, this might work. Using a potentiometer, taking the voltage less than 3.1V will turn the light off.

Now, if the BCM does ground these wires (wouldn't surprise me), can I use a diode to block that ground? I think (you might know for sure!) it would just pull it to 12V.

-------------
No question is stupid or not worth asking. You were once a noob, right? :)




Posted By: freqsounds
Date Posted: February 12, 2014 at 8:05 PM
Oh, and I was testing the circuit using 8xAA batteries to test the circuit @11.89V with this configuration. At 14V, would it act the same?

-------------
No question is stupid or not worth asking. You were once a noob, right? :)




Posted By: oldspark
Date Posted: February 18, 2014 at 2:25 PM
Sorry - I missed your last...


Your unregulated circuit will definitely change - ie, the voltage REF point will vary, tho it might not matter (ie, if it's far enough between 2 values or sufficiently under or above a single value).

As to the BCM I don't know.
Their quoted voltages should have a 'system' voltage stated - eg, 12.5V or 12.7V or 14.2V etc - otherwise it might mean it uses a regulated voltage.
If the BCM uses uPCs (PICs etc) for this sensing, then it should be regulated (since uPCs are usually 5V) but changing sensor voltages could also be handled by software (ie, senses system voltage and scales down thru software).
If it uses discretes whether non-regulated digital chips or analog circuitry, then it need not be regulated since all REFs and voltages will remain the same relative to each other - ie, vary in proportion to the system voltage.

Does that make sense?

Paraphrasing:
If a BCM is regulated then most likely so too are its sensor voltages.
Hence 'your' circuit also need to be regulated UNLESS the varying voltages do not cross the REF voltages (ie, REF is 5.5V and is still between the 7V swing from 6-8V and 4V swing from 3-5V).

Cool?

Keep in mind the voltages above are examples only. And they are the 'actual' voltages - not what might be scaled in your circuit. (EG - if using a 5V uPC or PICAXE, you'd scale the voltages down. But you might do that anyhow even on an unregulated 339 circuit...)


BTW - kick me if I fail to respond to your replies, or my promises! (ie, BUMP else PM)




Posted By: freqsounds
Date Posted: February 18, 2014 at 8:17 PM
You're back! Thought you forgot about this simple yet impossible rig. posted_image

That does make sense, and I was going to ask you about the door inputs as well -- the 7.4V will fry a PICAXE from what I read.

So if we staged down the voltage, would the variation between the voltages be too close to detect? What I mean is, lets say a door closed is 4 volts, and an open door is 3 (after staging down). Is it sensitive enough to detect the difference? I had this problem with the LM339 after using a resistor to pull down a (+) voltage.

By the way, I took my chances and tried the circuit with what I discussed in my last post, and it failed. The circuit didn't work at all whether the door was open or closed.

I've been doing quite a bit of other research, too. The car uses the CAN Bus, and the GMLAN. As a programmer, my thoughts are that statuses are the same across the board. A left front door open in a Saab is the same data sent over the CAN as a Chevrolet with its left front door open.... right?? My theory is if I use an ADS-ALCA, I can try to read from the CAN or GMLAN with a GM firmware. It's a shot in the dark, but what are your thoughts on trying this?

I noticed something the other day. Courtesy lighting. On the bottom of the door. It only comes on when the door is open, and it comes on every time. BUT, I have to get through a molex connector to get to it, which means adding pins to the existing connector. Finding these connectors is about as easy as building a circuit to monitor the door triggers! lol, but the connectors are $40 for a 10 piece set, so I have to be sure it'll work before I spend the money!

These lights are powered by the door latch. A wire runs from the door latch to a courtesy light in the bottom of the door. When the door is opened, the light comes on. All I would have to do is monitor the wire -- I think. With the BCM turning off, it might have the same effect as the trigger wires that go to the BCM. I can meter the wires when the BCM shuts off to check for this.

So, if this fixes my door and trunk issues, the last thing I would need a solution for is the hood pin. It's set up the same way, only there isn't a light under the hood. With the hood open, the pin rests at GND. Once the hood is closed, it gets a short burst of +12V, then goes back to GND. This car has me completely baffled, and I'm surprised the damn thing even works. posted_image

Regardless, I am enjoying every second of figuring this out. Once the procedure is done, I will be the first to have successfully install an alarm/remote start in this particular model. After being tortured on SaabCentral, I'll finally have a pile of crap to rub in their faces! Saab enthusiasts are a unique, insulting, and bitter community, especially if you're a noob. posted_image



-------------
No question is stupid or not worth asking. You were once a noob, right? :)




Posted By: freqsounds
Date Posted: February 18, 2014 at 8:38 PM
Lets just keep replying and see how many pages we can get! xD

-------------
No question is stupid or not worth asking. You were once a noob, right? :)




Posted By: oldspark
Date Posted: February 18, 2014 at 10:58 PM
What - you think I am one to waste energy and screen-estate by simply rambling on?
You newish Copper members are certainly wising up!


What you said about the door lighting gets back to what I said before - door switches. That's different to a lock/unlock or similar circuit.
But also as I said, the BCM might detect individual door openings and control the appropriate light.


The scaling has essentially no effect on whether it can be done. It's a case of whether the low voltage range overlaps with the high voltage range (ie, if open voltages overlap with closed).
Provided they do NOT overlap and set point (REF) can be set in that non-overlapping range (typically its mid point) then there should be no problems.

But such overlap can be solved by having your circuit use a regulated voltage so it does not vary.
IE, if all circuits are non regulated they should all remain the same relative to each other.
If one circuit is voltage regulated, then its associated circuits (eg, yours) should also be regulated. Hence they never vary.

I did cover that (unless I'm confusing various threads!) so maybe re-read and see if that now makes sense.
I might check too before my next reply...




Posted By: KPierson
Date Posted: February 19, 2014 at 10:35 AM
The ability of the picaxe to detect differences in voltages is based completely on the resolution of the ADC. I am not familiary with the picaxe but with the microcontrollers I use they have a 10 bit ADC. 10 bits is 1024 different possibilities giving you a voltage resolution of around 0.05vdc. In practice though, I wouldn't go that low I would most likely use the 8MSB to provide filtering leaving you with 256 steps which leaves you at about 0.02 vdc resolution.

So if you scale down the voltages by 3 you should have no issues determining open/close status. I would recommend using a voltage follower in between the car and the voltage divider circuit just so you don't load down the OEM circuit and cause issues with the BCM.

-------------
Kevin Pierson




Posted By: oldspark
Date Posted: February 19, 2014 at 3:32 PM
Thanks KP - that was something I didn't cover.
The 08M2 also uses 10 bit ADC (four channels).




Posted By: KPierson
Date Posted: February 19, 2014 at 7:43 PM
Oldspark what would you think about running the voltage for each door through a very big resistor (1 meg +) and then using a 5v zener diode on it? With the very large resistor it should have a very negligible effect on the OEM circuit and with the zener it would protect the input.

Since anything over 5vdc indicates that the door is closed you could just program the ADC to look at a small window around the "door open" voltage. When the voltages is in that range fire the output indicate a door is open.

The zener would eliminate the need to scale voltages.

Thoughts?

-------------
Kevin Pierson




Posted By: oldspark
Date Posted: February 20, 2014 at 4:36 AM
I think good as a way to turn on a transistor etc - provided the doors do not vary voltage with system voltage - but otherwise a resistive divider.

It's 2 resistors versus one zenor and a resistor, so reliability & cost wise, 2 resistors wins. Plus no zenor non-linearities (with temp, or current tho that should remain fixed) - not that that matters as a mere on/off or maybe above/below determination.   

Or, it's a scaling versus determination of what the post-zenore output is (manufactured tolerance, current thru zenor, and temperature variations).


IMO resistors are far more stable, and reliable.
And if underscaling is a concern (ie, you have a voltage higher than the ADC tolerance and blow the chip), then add a reverse polarity diode to +V (1N914 small signal or 1N400x or a Schottky) to clamp the excess voltage.
IMO the best input is via a resistor to the uPC/PIC etc input which has clamping diodes to both +V & GND to protect against voltage extremes. You add a resistor to GND is voltage dividing (scaling) us required. And a cap if filtering is required. (For filtaring the zenor, a series resistor is still needed.)

I hope that makes sense - ie, the "universal" hardened & scalable input template = voltage divider + cap + 2 diodes.


And if the voltage changes, change a resistor or substitute a trimpot - probably easier than getting another zener.


Plus with the 2-resistor voltage divider it is easy to calculate the output voltage (eg, Vout = Vin x 0.3) so it is easy determine what the ADC sees and hence program set points.


Do you agree? (Sorry about my poorly organised reply - maybe I should review & restate?)


IMO zeners are good for simple low current regulators or crowbar circuits, or as a simple way to turn on a device (transistor or logic circuit) once an input exceeds a certain value.
But otherwise, or if using an ADC, why not use a voltage divider and have the option of having multiple set points (eg, if 2V < Vin < 4V then...)?




Posted By: KPierson
Date Posted: February 20, 2014 at 3:42 PM
My main concern was loading the OEM circuit and thus changing the values. However, my initial thought of using a very large resistor to restrict current draw could be used for the voltage divider circuit as well.

However, you may run in to issues with tolerances with very large resistor (for instance a 1.5 meg resistor with a 5% tolerance could range anywhere from 1,425,000 to 1,675,000 ohms. When you do this for all four door circuits it may drastically reduce the accuracy of the total system. Of course caution could be taken to match the resistors I guess. The zener, to me, seems like a valid application as you maintain the original headroom (somewhat) between the different states.

-------------
Kevin Pierson




Posted By: oldspark
Date Posted: February 20, 2014 at 6:39 PM
Ahh - Cool! (Or to mock politicians and other fakers - "I'm glad you asked me that!".)


To me it's implicit that there is no loading of the OEM circuit - otherwise use a voltage follower etc (an op-amp type buffer circuit that mimics input without loading).
In this case with its 1.8k resistors etc, I'd want at least 10x the resistance, preferably 100x. Hence the 1.8k equivalent being >18k or pref 180k. Hence maybe 100k.

On the other side, we can't have too high an impedance/resistance for the PIC/uPC etc. But since these are usually quite high - eg, requiring mere nA else mA - that usually isn't a problem.


Before I mention skewing, re resistor tolerances...


Yes - resistors and all components have a tolerance. Now while therefore you might use 1% resistors if 1-2% accuracy is required, it may not matter....
VIZ - those tolerances represent the max difference between its marked or intended manufacture value and its actual value. Those tolerances do not indicate the natural variation of a component (due to temperature or arbitrary drift etc).
IE - an actual 1.005 meg resistor is the same whether it be a 1% or 5% or 10% tolerance.

The point being that using two 5% tolerance resistors might give an output that deviates up to 10% from your ideal calculated values, but that deviation remains fixed - eg 4% higher or 2% lower. And that is just a matter of recalibration.
Hence trimpots etc in analog circuits, and for digital - a reprogrammed REF value or a programmable scaler to modify whatever REF values or maps are used.

In some cases calibration isn't necessary - eg, in this case we may need to detect a ~60% swing (4V versus 7V) or a 20% swing (that 3V difference between 4V & 7V relative to a supply of up to 15V).
Hence 10% tolerance resistors might do (not that they exist anymore), but 5% should be fine. 1% or 2% would be overkill (but not as expensive as they used to be??).

[ Incidentally, in ye olde days one could almost guarantee that in a batch of 5% tolerance resistors you would never find any within 1% or 2% because that had been removed to supply as 1% & 2% resistors respectively. I'm not sure about manufacturing these days - I'd suspect all are manufactured as 1% and merely arbitrarily marked as 1% & 5% etc.   Just as all 1N400x diodes might be 1N4007s. ]


So component tolerance is more a question of whether you can calibrate the final product (trimpot or a software/firmware variable).


Back to skew (for want of a better or correct term)...
Except where the aforementioned loading of the OEM circuit effects OEM operation, any skew caused by parallel (linear) components is similar to the component tolerance issue.
EG - if our resistance is so high that the uPC's input affects the voltage divider's output, it may not matter - we simply recalibrate. (Alas constant current inputs are more complex but that only matters if wanting a continuous output like a temp or volt display etc instead of a simple REF point or two.)



How'z that sound? Yep, I've been there & done that...
Hence MY 'glad you asked that' because I do know the answer(s) - unlike most politicians and others that use that phrase (IMO it's a dead giveaway!).
Of course I'm even gladder if you see a flaw in my arguments or come up with something I haven't considered.



BTW - I too often thought of zeners etc as a linear drop-down device but came to the conclusion it's only good as a drop down of [level - eg, a 46V to 47V swing to 1-2V etc, aka an expanded scale.
But if that level changes, or the swing is too high eg 46-54V is 8V which is too high for a 5V or 3.3V ADC etc.
Or if the zener drop is too variable with temperature, or the zener is too unreliable or costly.
And zenors have their tolerance too - and vary with current.

So given the cheapness and simplicity of a voltage divider; the greater selection of resistors; and that it's the same circuit/PCB configuration but to which filter caps are easily added...
Hence my standard 2 resistor (+ cap + 2 diode) PCB input design. Any zenor drops would be external to that - eg, maybe to drop 450VDC CDI supplies to reasonable voltages.




Posted By: freqsounds
Date Posted: February 24, 2014 at 8:56 AM
You guys lost me again, haha!

Would it be feasible at this point to just us a 12V micro SPST relay to kick the circuit on when the BCM is awake? I can use the GWA wire to allow the circuit to only turn on when the system is armed.

This could be easier than inventing a new wheel. posted_image Although I'd like to get the circuit working, I might do it this way temporarily until we can figure it out.

-------------
No question is stupid or not worth asking. You were once a noob, right? :)




Posted By: oldspark
Date Posted: February 24, 2014 at 2:59 PM
You still need to sense voltage tho... (?)


Re above, KP thought the resistive voltage divider might load the original circuit and also offered an alternative method.
I explained why there is no loading and why resistor tolerance doesn't matter else is compensated.
I didn't compare what loading a zener would add (I suspect more than uA), but I think I gave a good argument for using the cheaper and common "universal" input circuitry - ie, 2 resistors, 2 voltage protection diodes and an optional filter (cap).

But KP's zener suggestion is a clever solution that is often overlooked - eg, for dropping voltages aka expanded scale applications, or when using discrete components.




Posted By: freqsounds
Date Posted: February 24, 2014 at 3:19 PM
I do need to sense the voltage, but only if the BCM is awake. When a door opens or the factory remote sends a command, the BCM wakes up. This would turn the circuit back on. I would just need to find a +12V source that the BCM shuts off when it goes night-night. posted_image

Ahh, gotcha! I never truly understood the Zener diodes. I had to use one for the ignition module because one of the relays needed a 1 second delay before being energized. I was lost with that part of the circuit, but followed the schematic to the exact specs.

-------------
No question is stupid or not worth asking. You were once a noob, right? :)




Posted By: freqsounds
Date Posted: April 16, 2014 at 9:10 PM
Alright, so I finally got a handle on how this car works.

The BCM will turn off in 10 minutes if the car is armed with the factory remote.

The BCM will sleep in 30 minutes if the car is not armed with the factory remote, but locked with the power lock button. This does not arm the factory alarm.

Now for the fun part!

There isn't a single circuit that is +12V and controlled by the BCM. The couple I found that are, are extremely low current and connecting anything to it will bog down the circuit and the BCM will 'protect' itself by shutting down the circuit.

There's an exception: the dome light circuit.

So the dome light works as follows:

The BCM controls the +12V via a relay. This relay is located on the back of the fuse box at the driver's door. There is a RED / grey wire coming from the BCM that handles supplies the +12V output for the dome lights.

The light bulbs are controlled by ground through the switches.

The BCM keeps the +12V output alive until it goes to sleep. Here's the caveat: When the BCM sleeps, the voltage floats between .5V and 3V. This will screw with the circuit we built.

The fix is to use a relay. Pin 86 goes to the RED / grey wire, and pin 85 goes to the alarm's GWA output. Now, the relay is only turned on when the system is armed AND the BCM is awake. As soon as the BCM sleeps, the relay shuts off, hence shutting off the LM339 circuit.

I haven't decided yet whether pin 87 is going to be (+) or (-) to control the circuit. This is going to have to be trial and error to see which one confuses the LM339's, which is the problem I had before (when you remove power, the LM339's get confused and float(?) even though voltage is being 'pulled' to the outputs). I'll report back later with a full pinout, description of where everything goes, how it works, and whether this is fully successful or not.

-------------
No question is stupid or not worth asking. You were once a noob, right? :)





Print Page | Close Window