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 » Thu Jan 23, 2014 7:16 pm

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-shi ... 42497.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
russian
Site Admin
Posts: 9527
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

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

Post by russian » Thu Jan 23, 2014 7:26 pm

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!"
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

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 » Thu Jan 23, 2014 7:55 pm

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
russian
Site Admin
Posts: 9527
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

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

Post by russian » Thu Jan 23, 2014 8:02 pm

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.
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

User avatar
abecedarian
Posts: 387
Joined: Fri Nov 15, 2013 10:49 am

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

Post by abecedarian » Fri Jan 24, 2014 4:02 am

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: 3412
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA
Contact:

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

Post by kb1gtt » Sun Jan 26, 2014 2:52 am

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: 387
Joined: Fri Nov 15, 2013 10:49 am

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

Post by abecedarian » Sun Jan 26, 2014 6:08 am

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: 3412
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA
Contact:

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

Post by kb1gtt » Mon Jan 27, 2014 1:18 am

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: 387
Joined: Fri Nov 15, 2013 10:49 am

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

Post by abecedarian » Mon Jan 27, 2014 3:52 am

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
russian
Site Admin
Posts: 9527
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

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

Post by russian » Wed Jan 29, 2014 3:47 pm

Digikey BOM added to the top post
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

User avatar
kb1gtt
contributor
contributor
Posts: 3412
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA
Contact:

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

Post by kb1gtt » Sun Mar 16, 2014 11:06 pm

Digikey BOM updated to correct buggered diodes. Digikey BOM found here https://www.digikey.com/classic/Registe ... id=1504225 replacement diode is BAS70-04FILM
Welcome to the friendlier side of internet crazy :)

User avatar
russian
Site Admin
Posts: 9527
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

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

Post by russian » Wed Apr 02, 2014 3:03 pm

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
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

User avatar
russian
Site Admin
Posts: 9527
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

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

Post by russian » Wed Apr 02, 2014 4:30 pm

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
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

User avatar
mobyfab
Posts: 137
Joined: Tue Oct 29, 2013 10:09 am
Location: Versailles, France
Soldering skill: yes
Coding skill?: yes

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

Post by mobyfab » Fri Apr 04, 2014 2:22 pm

Why did you put the divider after the opamp ?

The higher output resistance might affect the ADC. (but no much)

User avatar
russian
Site Admin
Posts: 9527
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

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

Post by russian » Fri Apr 04, 2014 2:23 pm

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.
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

User avatar
mobyfab
Posts: 137
Joined: Tue Oct 29, 2013 10:09 am
Location: Versailles, France
Soldering skill: yes
Coding skill?: yes

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

Post by mobyfab » Fri Apr 04, 2014 2:47 pm

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
Contact:

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

Post by UnaClocker » Wed May 14, 2014 12:56 am

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
russian
Site Admin
Posts: 9527
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

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

Post by russian » Wed May 14, 2014 1:07 am

https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

User avatar
UnaClocker
Posts: 46
Joined: Tue May 13, 2014 12:14 am
Location: Tacoma, WA
Contact:

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

Post by UnaClocker » Wed May 14, 2014 1:15 am

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
russian
Site Admin
Posts: 9527
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

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

Post by russian » Thu Nov 27, 2014 2:43 am

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.
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

User avatar
kb1gtt
contributor
contributor
Posts: 3412
Joined: Tue Sep 10, 2013 1:42 am
Location: ME of USA
Contact:

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

Post by kb1gtt » Thu Nov 27, 2014 1:03 pm

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
russian
Site Admin
Posts: 9527
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

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

Post by russian » Thu Nov 27, 2014 1:58 pm

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?
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

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 » Thu Nov 27, 2014 5:13 pm

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
russian
Site Admin
Posts: 9527
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

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

Post by russian » Thu Nov 27, 2014 5:31 pm

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.
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

puff
contributor
contributor
Posts: 2720
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

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

Post by puff » Thu Nov 27, 2014 5:47 pm

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 » Thu Nov 27, 2014 8:22 pm

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
russian
Site Admin
Posts: 9527
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

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

Post by russian » Thu Nov 27, 2014 8:37 pm

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.
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

puff
contributor
contributor
Posts: 2720
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

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

Post by puff » Thu Nov 27, 2014 9:14 pm

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
russian
Site Admin
Posts: 9527
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Soldering skill: yes
Coding skill?: yes
Contact:

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

Post by russian » Thu Nov 27, 2014 9:19 pm

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.
https://rusefi.com/s/howtocontribute
very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions
my skype is arro239

puff
contributor
contributor
Posts: 2720
Joined: Mon Nov 11, 2013 11:28 am
Location: Moskau

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

Post by puff » Thu Nov 27, 2014 9:40 pm

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