analog inputs: op-amp + divider - Russian - now MCP6004

Hardware inside and outside of the ECU
User avatar
hasse.69
donator
donator
Posts: 77
Joined: Wed Dec 04, 2013 3:34 pm
Location: Sweden Linkoping/Vadstena

Re: analog inputs: op-amp + divider - Russian

Post by hasse.69 »

Ok , i thought that Jared was up to some new construction.
I have the resistors but where do i get hold of the op-amps.
Like this?
http://www.aliexpress.com/item/Free-shipping-VNS14NV04-40V-12A-8-SOIC-VNS14NV0-14NV-VNS14N-14NV0-VNS14-14NV04/1570042497.html
I think i will have to do a step by step for us electronically challenged :roll:
//Hasse.
"Electronically challenged of the world, unite!"
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: analog inputs: op-amp + divider - Russian

Post by AndreyB »

For 0.2 - this one - you would need three quad rail-to-rail op-amps in 14-SOIC package (quad means four channels per chip, not dual as in v 0.1)
The official one would be LMV324ID (LMV324IDR is the same thing)

"Electronically challenged of the world, unite!"
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
hasse.69
donator
donator
Posts: 77
Joined: Wed Dec 04, 2013 3:34 pm
Location: Sweden Linkoping/Vadstena

Re: analog inputs: op-amp + divider - Russian

Post by hasse.69 »

C230 and D230 what is that.
Yes i know they are capacitor and some sort of diod.
But links pliiiiiiiiiiis.
As you can se down here :lol:
I
I
I
I
\/
"Electronically challenged of the world, unite!"
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: analog inputs: op-amp + divider - Russian

Post by AndreyB »

hasse.69 wrote:C230 and D230 what is that.http://i.imgur.com/v7T4Ps0.png
Image
This picture answers the C230 question and we would need a smarter person to elaborate on D230.
Good thing is that D230 (and other diodes) it is optional, it is just for protection. As long as you promise me not to put +12 on the input pins you should be fine.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
abecedarian
Posts: 386
Joined: Fri Nov 15, 2013 10:49 am

Re: analog inputs: op-amp + divider - Russian

Post by abecedarian »

russian wrote:For 0.2 - this one - you would need three quad rail-to-rail op-amps in 14-SOIC package (quad means four channels per chip, not dual as in v 0.1)
The official one would be LMV324ID (LMV324IDR is the same thing)

"Electronically challenged of the world, unite!"
Any particular advantage to that op-amp as opposed to AD8659?
I mean other than the latter is around $4 in small quantity (AD does offer samples though so one could probably get enough for the board for free), and it can be powered by up to 18v which would alleviate some of Jared's concerns about getting too close to the upper rail and dumping power back to the MCU supply rail.
You can lead the horticulture but you can't make them think.
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: analog inputs: op-amp + divider - Russian

Post by kb1gtt »

The LMV324ID was chosen because it's on Seeedstudio's OPL list, as well it's available in many common sources like digikey and is often found in local electronics shops. It's widely available with good enough specs and low cost. That's why it was chosen. I'm sure other op-amps can be used but the pin outs will need to be verified before it can work.
Welcome to the friendlier side of internet crazy :)
User avatar
abecedarian
Posts: 386
Joined: Fri Nov 15, 2013 10:49 am

Re: analog inputs: op-amp + divider - Russian

Post by abecedarian »

My question was more about functional differences than if the fab could install them, since you have mentioned concerns here and elsewhere about using 5v VCC rail-rail ops.
I did check the pin-outs and they were the same; both are 14 lead SOIC.

But I forgot you were using Seeed and their assembly services. Did you ever check in to Elecrow? They can do parts sourcing if needed.
You can lead the horticulture but you can't make them think.
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: analog inputs: op-amp + divider - Russian

Post by kb1gtt »

I forget exactly why, but I got shaky in the knee's with http://www.elecrow.com/ I seem to recall they had some complaints on the internet about quality, and I seem to recall they were un-clear about what exactly there part sourcing entailed. For example, it doesn't appear they will put those parts on a PCB, but perhaps it does. I can't tell from here.
Welcome to the friendlier side of internet crazy :)
User avatar
abecedarian
Posts: 386
Joined: Fri Nov 15, 2013 10:49 am

Re: analog inputs: op-amp + divider - Russian

Post by abecedarian »

They had decent reviews by people over on 43oh.com as an alternative to Osh, Seeed and others.

Anyhow, it was just a thought that if they can source any part and assemble boards it might open up some design options. ;)
You can lead the horticulture but you can't make them think.
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: analog inputs: op-amp + divider - Russian

Post by AndreyB »

Digikey BOM added to the top post
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by kb1gtt »

Digikey BOM updated to correct buggered diodes. Digikey BOM found here https://www.digikey.com/classic/RegisteredUser/BOMBillOfMaterials.aspx?path=1&exist=1&id=1504225 replacement diode is BAS70-04FILM
Welcome to the friendlier side of internet crazy :)
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by AndreyB »

Q: What is the purpose of the OP AMPs on this board?

A: two reasons:
1) op-amp isolates the voltage divider from the input circuitry - this way we are not affecting whatever is going on in the input wire, this means we can attach this input board in a slave mode with the original ECU still on while we want to just sniff what's going on. This case we are not using the pull-up or pull-down resistors, we are just following and divinding the input voltage.
2) extra protection for the MCU ADC
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by AndreyB »

Ops:
We have an issue with the schematics: op-amp channel #3 pinout is wrong:
Image
but we have
Image
and this is wrong:
Image

This affects the 'Adc Amp 12ch rev 0.2' module, but this DOES NOT affect Frankenstein because on Frankenstein apparently the board does not follow the schematics:
Image
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
mobyfab
Posts: 139
Joined: Tue Oct 29, 2013 10:09 am
Location: Versailles, France

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by mobyfab »

Why did you put the divider after the opamp ?

The higher output resistance might affect the ADC. (but no much)
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by AndreyB »

mobyfab wrote:Why did you put the divider after the op-amp?
So that I can use this schematic to sniff wires while the stock ECU is running the engine.

These resistor values should be fine four stm32 ADC.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
mobyfab
Posts: 139
Joined: Tue Oct 29, 2013 10:09 am
Location: Versailles, France

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by mobyfab »

I see :)

Yeah the ADC has 1kohm/8pF input so it should not affect it too much.
User avatar
UnaClocker
Posts: 46
Joined: Tue May 13, 2014 12:14 am
Location: Tacoma, WA

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by UnaClocker »

Why use op amps at all? Just adds more cost to the BOM and more complexity to the build of the board. More components to fail (as you've already experienced). You can simply use voltage dividers. ECM's all over the world have had 5v CPU's for decades, and 12v electrical systems, they simply use a voltage divider to get the 12v down to 5v. You can do the same thing to get down inside the 3.3v range. Even with 0-5v signals coming in like the TPS (if you can't just run the TPS off 3.3v) or a wideband O2 sensor (you can recalibrate some of them to give a 0-3.3v signal).
That's about the only signals that you're going to get that are over 3.3v, everything else is based off the reference voltage you feed to it (coolant/air temp sensors, crank sensors (which would come in as digital anyways), etc)..
edit: also, as for protecting the MCU, just put a 10k inline between the voltage divider and the MCU, it'll prevent enough current from flowing to damage the chip.
Brian from Tacoma, WA
84 Dodge Rampage
01 PT Cruiser
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by AndreyB »

Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
UnaClocker
Posts: 46
Joined: Tue May 13, 2014 12:14 am
Location: Tacoma, WA

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by UnaClocker »

Yeah, I only read page 1, didn't notice the extra pages before replying. Fair enough.
Brian from Tacoma, WA
84 Dodge Rampage
01 PT Cruiser
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by AndreyB »

Question about the rail-to-railness of out op-amps.

Supply voltage is 4.5v (board powered via USB), input is a 10K pull-up - to the same 4.5v
What is the expected op-amp output? Because I am getting 3.9v, is that expected, or is it supposed to be higher? Wonder if the cheap op-amps do not perform well or if that's in my head.

The datasheet is @ http://www.ti.com/lit/ds/symlink/lmv324.pdf but after 120 seconds of reading I cannot produce the answer.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
kb1gtt
contributor
contributor
Posts: 3758
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by kb1gtt »

Is that op-amp input, or harness input that you are measuring the input voltage? Also per figure 23, the positive rail should be off by only 10mV so you are far worse than the expected.
Welcome to the friendlier side of internet crazy :)
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by AndreyB »

I've just tried the same with original Texas Instrument chip and I get more or less the same results: 4.5v input gives 4.0 output. Why?

I am testing this on pull-up channels, so I have a disconnected board permanently powered up from USB @ 4.5v and I check voltages right on op-amp pads: pads #5 & #10 are where I measure input voltage and pads #6 and #9 are where I measure output voltage.

Jared, you have a Frankenstein board. Can you check the same on one of the channels with a pull-up resistor?
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
DaWaN
Posts: 51
Joined: Sat Sep 20, 2014 6:54 pm
Location: Benschop, Netherlands

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by DaWaN »

kb1gtt wrote:Is that op-amp input, or harness input that you are measuring the input voltage? Also per figure 23, the positive rail should be off by only 10mV so you are far worse than the expected.
Not entirely true: because these inputs have to source about 1.5mA due to the resistor divider you can see a drop of up to 50mV, but 500mV seems a bit extreme.. Not sure what is going on.
Russian: can you measure the total resistance to ground of an unpowered board at pads #6 and #9 ? It should be around 3kOhms, but if it is less it explains at least the behavior of the op-amp.
Where did you source the opamp ? any chance of getting a fake or something like a LM324 ?
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by AndreyB »

DaWaN wrote: Russian: can you measure the total resistance to ground of an unpowered board at pads #6 and #9 ? It should be around 3kOhms, but if it is less it explains at least the behavior of the op-amp.
Where did you source the opamp ? any chance of getting a fake or something like a LM324 ?
Just measured and confirm #6<>GND and #9<>GND are both 3KOhm, these are outputs going into the x2 1.5K voltage divider so that's as expected I guess.

I have chips from two different sources: from a reputable digikey and from a pretty random eBay seller (at least the seller is from US)

Both chips show LMV324I label. It's a bit interesting that the TI logo is slightly different between the chips - on one the whole Texas outline is filled zone, on another one part of Texas is left unfilled. Weird that the logo does not match between different sources... But neither show 4.5 output and both show comparable 0.5v / 0.6v offset.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by puff »

etch it with acid, then use a microscope to check if its counterfeit… :D
but at least it's good to know that inputs and outputs of the opamp should have similar values.

may be your voltmeter is too cheapo and has low impedance? :?:
DaWaN
Posts: 51
Joined: Sat Sep 20, 2014 6:54 pm
Location: Benschop, Netherlands

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by DaWaN »

Do you have an oscilloscope ?
Although unlikely it might be a problem with the opamp oscillating, some opamps are not "unity-gain stable".
I expect the LMV324 to be unity-gain stable: the old National semiconductor datasheet says this:
The LMV321/358/324 can directly drive 200pF in unity-gain without oscillation.
If you have an oscilloscope it might not hurt to check.

Another check: do you have the unused inputs of the opamp connected to a fixed voltage ? Keeping unused inputs floating can also cause erratic behavior of the opamp. No other outputs connected to a lower impedance to ground than 3Kohms ?
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by AndreyB »

DaWaN wrote:If you have an oscilloscope it might not hurt to check.

Another check: do you have the unused inputs of the opamp connected to a fixed voltage ? Keeping unused inputs floating can also cause erratic behavior of the opamp. No other outputs connected to a lower impedance to ground than 3Kohms ?
oscilloscope shows a boring straight line

all outputs are 3Kohm dividers. Two inputs are 500K pull-downs (these outputs show 0v), two outputs are 2.7K pull-ups - these two both show the same ~4.0v outout (0.5 below power supply which is 4.5v in case of my desktop USB for whatever reason)

Also checked with +12 power supply and Frankenso own 5v. This time I have perfect 5v power and same -0.6v offset on op-amp output.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by puff »

didn't get that thing about dividers on all and pull-ups on the two. any chance to see that piece of scheme? what else you expect to see with those pull-ups?
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by AndreyB »

puff wrote:didn't get that thing about dividers on all and pull-ups on the two. any chance to see that piece of scheme? what else you expect to see with those pull-ups?
LMV324IDT has four channels. The question was if any of the channels were not soldered/floating. dividers are on the output and pull-ups/pull-downs are on the inputs.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
puff
contributor
contributor
Posts: 2961
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

Re: analog inputs: op-amp + divider - Russian - LMV324IDT

Post by puff »

got it. you measured that 0.6v offset with dividers in place? could it be so that the divider is 'stronger' than the maximum output current of LMV324? have you tried measuring output without divider? or changing divider for, say, 10K?
Post Reply