Simple algebra. Plug one of them into the other and simplify:
mv = code * 5000/1024
temp = (mv - 500) / 10
temp*10 = mv - 500
temp*10 = code * 5000/1024 - 500
temp*10 = (code * 5000) / 1024 - 500
(add divisor/2 before performing an integer division for rounding)
temp*10 = (code * 5000 + 512) / 1024 - 500
temp*10 = ((code * 5000 + 512) >> 10) - 500
One multiply, one shift right by 10, one addition, and one subtraction. Then convert to BCD and display it.
However, if you have an 8-bit ADC, you're probably going to want to divide by 256 instead of 1024 (shift right by 8 instead of 10) and add 128 instead of 512.
And here is an algorithm for converting binary to BCD: http://www.eng.utah.edu/~nmcdonal/Tutorials/BCDTutorial/BCDConversion.html
Just run that, split into groups of 4 bits, and drive each digit in the display with one group (after decoding to the proper 7 segment signals, of course).
There are a bunch of separate questions in the text here, so I'll talk about those too.
My first question is that if I use both op amp of the first AD712, then will it cause any issue? Can one opamp in an IC affect the other opamp(s) in the same package?
This won't do any harm - the IC manufacturers test their parts as if you'll be using both of the components.
I understand that voltage divider with these resistances will be fairly linear. Is this correct?
Hmm. The issue I see is that you're loading your low pass filter. This isn't necessarily a bad thing, but it might not do what you expect - you no longer have an RC filter, but an R(C || R) circuit, which has a different response.
Is it possible to change your circuit so that the low pass filter is built into the buffer? For example, you could use a generic 1st order active low pass filter:
Then, your voltage divider won't have an effect on the low pass filter (since the op-amp can supply the extra current to the R||C branch, leaving your voltage divider untouched).
I also understand that I lose the resolution, as the ADC can read 0.0049 volts as-is (10bit ADC with vref = 5v) which means that the ADC should be able to read 0.01volt difference when voltage is divided (.01 at input will be 0.0040 at divider and .02 will be 0.0090 at divider).
Right - that's the point. This way your voltage steps are bigger (bad) but your maximum measurement is higher (good).
Does the above sound logical or am I missing something fundamental?
This all makes sense to me.
All Op Amps are rail to rail with supply of +12 and -12. What if I supply +5..+5.5 to last buffer op amp so that its output never exceeds its rail which can allow me to skip the schottky diodes?
This could work. Be careful, though: most rail-to-rail op-amps can only get close to their rails when they're not supplying much current to their output. If your output is +4.95 V with a +5 V rail, when your ADC pulls in a spike of current, the output will momentarily drop. I don't know how far - this depends on how much current your ADC takes and how good your op-amp is near the rail - but it's something to think about.
How much gain can I get from DC perspective without any problems?(I tried to understand the gain-vs-frequency charts but I cant get it. DC is 0 Hz or 1 Hz)
I don't really know how to answer this - it might be a stability question, and I don't have much experience there. DC is 0 Hz.
Should I put some bypass capacitors on signal line? e.g. after trans-impedance amp , put a small cap in parallel to let the high frequency signal (noise) to ground out...
how do I decide the value of Capacitor such that it does not cause delay in my signal?
You're already doing this! Half of your low pass filter is a capacitor to ground.
You can choose a capacitor based on the amount of resistance around it. As you know, a resistor and capacitor in series make a low pass filter, which has some amount of phase shift associated with it. The decision is essentially a tradeoff between the cutoff frequency and how much phase shift you can tolerate at your signal's frequencies.
side note: this is an enormous question. If you can narrow down your question into something more specific, you'll get much better + faster answers. A lot of people will stop reading as soon as they see a wall of text, so the shorter your question is, the better.
Best Answer
Remove D7, and I think the output situation will improve.
The 1N5817 has a reverse leakage current of up to 1 mA. That combined with resistor R17 lets the 5V rail pull the output away from its intended value.
D7 acts like a resistor and forms a voltage divider with R17. The result is somewhere between the 5V rail and the output voltage from U2.
The 1N5817 is more for high current applications.
You'll need to find a replacement for D7 with a far lower reverse leakage current.
The ADS1115 can only tolerate 5.3V on its analog input when operating on 5.3.
You will need a diode with a low foward voltage (less than 0.3V) to really protect the ADS1115. You will need a diode with a very small reverse leakage current to minimize the error in your protection circuit.