SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By hassmaschine
#141082
the pins on the connector appear to be hooked directly into a 5v line (just for the senders) which is connected to the ADCs with the resistors. not what I expected, which was the connectors to be hooked directly into the ADCs and 5v connected with the resistors.

I'll give the caps a try, I've got a ton laying around that I never used for anything...

it's a pretty huge variation, +/-5 liters in a second or so. It wasn't noisy at all until I removed the 5v input from the ADCs. When I look at the output voltage from the op-amp it seems pretty stable, although my DMM is a peice of junk HF special (I have a fluke, but the voltage input is dead). I don't get it.
By Mee_n_Mac
#141086
Do you think the sender circuit is like the below and now what we thought originally ? Either can work but I'd be surprised to see 5V routed to the gas tank w/o something to limit it's current. Also 5 L is about what, a little less than 1/10 of a tank ? That should be over 100 mV of noise, which seems awfully large (and should be measurable with an AC voltmeter / DMM.
BMWsender.jpg
You do not have the required permissions to view the files attached to this post.
By Mee_n_Mac
#141091
hassmaschine wrote:the pins on the connector appear to be hooked directly into a 5v line (just for the senders) which is connected to the ADCs with the resistors. not what I expected, which was the connectors to be hooked directly into the ADCs and 5v connected with the resistors.
Hang on ... didn't you put a varying resistor (rheostat) across one of these pins and ground and measure the voltage at that pin and the resulting tank reading for the new cluster in order to get a cal curve to be matched by the old sender + op-amp circuit ? That is to say that the model of a 5V source connected through a resistor to the pin (that the sender connects to) must be correct.

This being that 1'st set of data ...
(new gauge, 5v reference)
Empty 0.91
1/8 1.06
1/4 1.20
3/8 1.58
1/2 1.90
5/8 2.16
3/4 2.38
7/8 2.58
Full 2.75
By hassmaschine
#141097
nice - added a couple .22uf caps where you have marked C1 and C2 (just what I could find laying around). now it's a very clean, stable signal.. man, I really need a better DMM. :)

anyway, regarding how the cluster is wired - it's actually not exactly either of what you've drawn. I'll have to study it some more, but the resistor goes between the ADC and 5v, and then the level sensor (my op-amp in tihs case) goes between 5v and ground.

I'm considering cutting the 5v trace to one of the level sensor input pins. I can short them together at the CPU, since they'll get the same voltage input anyway it doesn't matter if there's one or two wires (this is how it's wire now, actually). Then I can use the other pin for 5v instead of having to solder a wire to the board..
By Mee_n_Mac
#141098
hassmaschine wrote:nice - added a couple .22uf caps where you have marked C1 and C2 (just what I could find laying around). now it's a very clean, stable signal.
Well that's good but I'm giving up on trying to figure out what's in the new instrument cluster. Now it sounds like the sender is a 3 terminal device, perhaps a pot and not a 2 terminal rheostat.

http://en.wikipedia.org/wiki/Potentiometer
By hassmaschine
#141116
I'm still certain it's a voltage divider/rheostat (the level sensors only have 2 pins, Vin and ground). it's just not connected in the order that we thought.

Anyway, so far my prototype is working great - actually, the signal is even better now than it was with the original level sensors! now to order boards/components. I'll have to take a pic of my prototype, man it's ugly!

Once it's built of course I have to calibrate it.. but I may be out of time for a few weeks. I'm going to be teaching a class at the local tech school which is going to be a big time sink I'll bet. When that's over, I'll start to finish this thing up and get it in the car. :)
By hassmaschine
#143011
just to update - I'm not dead, and the project continues. the final board is built and tested, it works perfectly :)

I've started teaching a class in my "spare" time, so I haven't had the energy needed to finish this as quickly as I'd like to.

Next step for me is to get the the new cluster wired in (using the old one as an adapter board of sorts), then physically modify the housing to fit inside the "old" chassis. Another thing I need to do is split a VR-crank signal so I can drive the tach, I have a friend who can help with that though.
By hassmaschine
#143713
Mee_n_Mac wrote:
hassmaschine wrote:I think what may be confusing is these 2n2222a circuits.. they are totally unrelated to the U1 and U2 op-amps! the only thing they really share is a ground plane. I actually realized that the backlights run on 5v, not 12v. I adjusted U1 to run on 5v now. but, it was still unrelated to the indicator LEDs.. :)

I tried the indicators without 12v connected to the upper pin in your diagram - it doesn't work. I found that the signal voltage and the voltage at that pin need to match for it to switch on the ground plane - since the signal from my car is 12v, the other pin needs to be a constant 12v as well. I do appreciate the possibility of saving some space - but, the circuit works perfectly. the resistors are to prevent frying the 2n2222a (already melted two). The pin at the CPU is an output, not an input - the cluster won't "see" anything (I've tested it too). All I'm doing is shorting the LED's to ground. the diode is keeping 12v from feeding back into the cluster where it doesn't belong. Maybe there's another way I can configure the 2n2222a to eliminate the extra parts?
It's good that it works, it just annoys me there's a mystery unsolved. :mrgreen:
hassmaschine wrote:moving onto the more difficult problems - testing my crude prototype op-amp circuit, I've found a problem. The circuit I built doesn't follow the curve I want exactly, but it doesn't matter for testing purposes - what I want to see is the output voltage range match what the cluster is expecting. it does that easily, I have a range of about .1v to 3.15v. the cluster only needs .9 to 2.75v

BUT - when I hook it up to the signal pins from the cluster, it gets "clipped". it will stop decreasing at about 1.6v. even though the output from the op-amp at that point is less than half a volt. This must have something to do with how the ADCs are built - they must be putting out some amount of voltage thats leaking into my circuit? this is where i get foggy..
I believe I understand why. Some posts back I believe you generated a cal curve for the new cluster. From that it seemed the cluster had a 5V source fed through a few hundred ohm resistor that would normally be connected to the sender. What's happening is your op-amp is "fighting" that source and resistor (Rint below). As the voltage output from the op-amp drops, the op-amp must sink more and more current from that 5V+resistor. At some point it can't sink any more and the output won't go lower. From Fig 2-13 in the op-amp datasheet I believe that current to be around 15 mA, which is just about what the op-amp would be sinking at low voltages.

http://ww1.microchip.com/downloads/en/D ... 21613c.pdf
BMWcircuitB.jpg
dunno if you're still reading this or not.. but, I ran into a similar issue with the cluster LED backlight dimmer circuit.

When I apply straight voltage, the voltage measured at the LEDs is the same (12v, way too much!). However, when I hook up the op-amp, I get about half of what I'd expect (~3v instead of 5-6v).

I believe what's happening is the op-amp and built in resistors are acting like a voltage divider. Some of that voltage is going into my op-amp circuit and only half is making it to the LEDs.

So I have two thoughts: one, I could just build a simple voltage divider and trim it to the voltage I like for the LED backlights (but then my dimmer switch won't work). Or, could I go with much larger resistors in my op-amp. I used ~5000ohm resistors for it (I don't remember the exact values but they're in that ballpark). what if I multiplied that by 10 or 100? say 50k ohm or 500k ohm? then the resistance of my op-amp circuit would be much higher than the resistors for the LED backlights. Would that work? I'm thinking voltage is sort of like water, and takes the path of least resistance. heh.
By Mee_n_Mac
#143715
hassmaschine wrote:dunno if you're still reading this or not.. but, I ran into a similar issue with the cluster LED backlight dimmer circuit.

When I apply straight voltage, the voltage measured at the LEDs is the same (12v, way too much!). However, when I hook up the op-amp, I get about half of what I'd expect (~3v instead of 5-6v).

I believe what's happening is the op-amp and built in resistors are acting like a voltage divider. Some of that voltage is going into my op-amp circuit and only half is making it to the LEDs.

So I have two thoughts: one, I could just build a simple voltage divider and trim it to the voltage I like for the LED backlights (but then my dimmer switch won't work). Or, could I go with much larger resistors in my op-amp. I used ~5000ohm resistors for it (I don't remember the exact values but they're in that ballpark). what if I multiplied that by 10 or 100? say 50k ohm or 500k ohm? then the resistance of my op-amp circuit would be much higher than the resistors for the LED backlights. Would that work? I'm thinking voltage is sort of like water, and takes the path of least resistance. heh.
I'll have to respin my brain on this topic but my first inclination is to say that if you're driving a bunch of LEDs with an op-amp and getting a lower voltage than expected, it's because the LEDs are drawing too much current from the op-amp, more than it can supply. You may need a high current driver circuit for the backlight (perhaps Google emitter follower). When I get some free time later tonight, I'll think some more on it.
By hassmaschine
#143716
ok, so I'd have to add some sort of amplifier after the op-amp to increase the current?

it's somewhere around a dozen LEDs, all SMD style.

reading the "emitter follower" wiki now..
By Mee_n_Mac
#143720
hassmaschine wrote:ok, so I'd have to add some sort of amplifier after the op-amp to increase the current?

it's somewhere around a dozen LEDs, all SMD style.

reading the "emitter follower" wiki now..
Are you trying to control the backlight brightness via an op-amp ? That's not going to work very well, even with some higher current driver. Generally LEDs are PWM'ed to control brightness.
By hassmaschine
#143730
yes - when I straight vary the input voltage, it works pretty well. I'm not really too worried about the gain, as I'll likely use full brightness all the time anyway. it just makes it easier to power them from the light switch if I can use the backlight power from the original cluster (which has to go through the op-amp to work anyway).

an emitter follower seems like it could work. I need to do some more reading to have a better understanding - but it looks like I could use one of 2n2222a's, and i just need to figure out what resistor size to use?
By Mee_n_Mac
#143736
The first thing to do is figure out what it is you're driving ... a bunch of bare naked LEDs (likely) or LEDs with some dropping resistors (hmmmm) or something else. Do you have 1 input line for all the LEDs or multiple pins ? Do you believe all the LEDs are tied to ground ? Or to +Battery ? That is should your "driver" be supplying a high voltage or a ground ?
By hassmaschine
#143745
all the LEDs are grounded. the current limiting resistor(s) are built in as well. I'm providing power to turn them on, and they're all powered at the same voltage source. from testing it appears they want around 5v (all the others are run off 5v, but I don't have the light contol module to activate the LED backlights the "normal" way).

basically I don't care about the gain of the OP-AMP- it's purpose is to invert the voltage from the light switch/dimmer, which I always run at full brightness. I'll fine tune the voltage output at the op-amp for the brightness I want.

btw, even if I crank up the op amp to say, 7v output, it still only gets about 3v to the LEDs.
By Mee_n_Mac
#143747
hassmaschine wrote:all the LEDs are grounded. the current limiting resistor(s) are built in as well. I'm providing power to turn them on, and they're all powered at the same voltage source. from testing it appears they want around 5v (all the others are run off 5v, but I don't have the light contol module to activate the LED backlights the "normal" way).

basically I don't care about the gain of the OP-AMP- it's purpose is to invert the voltage from the light switch/dimmer, which I always run at full brightness. I'll fine tune the voltage output at the op-amp for the brightness I want.
Any chance you could post a schematic or wiring diagram of what you think you have ? I gleam you're taking the voltage off a pot that's used to dim lights somewhere and when that voltage goes lower and lower you want the LEDs to get brighter and brighter ?? Thus you've got some inverting op-amp circuit to (try to) do that. That op-amp then drives a bunch of resistor+LEDs that are in parallel. So what you seem to need is an amp that can supply more current at about the same output voltage as the present op-amp circuit. You might be able to find a "power amp" to replace the op-amp in your circuit or one that follows it (op-amp output goes into power amp input).

OTOH when you say that "it's purpose is to invert the voltage from the light switch/dimmer, which I always run at full brightness," it sounds like you have a fixed voltage, that's either there or not, and the problem is just that it's not the correct voltage for the LEDs. There may be a much better and simpler way to make the LEDs turn on if this is the case. But I do need to know the circuit as best a you can and what the "wrong" voltage from this switch/dimmer is. Depending on the current involved, you might be able to get rid of this op-amp circuit and just use a reasonable power dropping resistor (though a DC-DC converter would be less wasteful and run cooler and a linear regulator+resistor would split the difference btw these 2 approaches).
hassmaschine wrote:btw, even if I crank up the op amp to say, 7v output, it still only gets about 3v to the LEDs.
If my understanding is correct, that's to be expected. The op-amp can't provide all the current needed by the LEDs. They are in effect shorting the output of the op-amp to ground (even if it's not a "hard" short). But let's be very clear with the terms used so there's no mistake. When you said "about 3v to the LEDs", did you really mean ~3V between the connector pins that go to the resistors+LEDs and ground ? The actual voltage across just the LEDs themselves should only ever be 1.5 to maybe a little over 2 V, even when driven at their max current levels.

Can you measure what the current draw needed by all the resistors+LEDs is ? I'm thinking you could put an ammeter inline with an ~ 4.8V battery pack and connect the resistors+LEDs to that. With that measurement, we could know what's needed for a "driver" of some sort.