You mention "precision" in your post -
1) The ESP32 not exactly a precision ADC for starters. Looks like its 12 bits
but with error of several bits. And other cautions mentioned in datasheet.
ESP32 Analog To Digital Conversion Accuracy
The ESP32 is a powerful microcontroller with many input/output ports. Specifically, it contains two 12-bit multiplexed analog to digital converters (ADCs) for a total of 18 channels. ADC1 is attached to eight GPIOs from 32 to 39. ADC2 is attached to 10 GPIOs (0, 2, 4, 12 to 15 and 25 to 27)...w4krl.com
2) The OPA380 not rail to rail, so be aware of that. There are datasheet recommendations
to use an output pulldown to get it to swing to - rail. + rail still not RRIO.
3) The circuit with 5V OPA380 supply will yield higher dynamic range. It also eliminates
the bias accuracy offset which can contribute error if you are trying to achieve absolute
accuracy in photodiode current versus output.
Regards, Dana.
--- Updated ---
The reverse bias spec is a max rating for the diode, not the design
setpoint for the diode.
Regards, Dana.
* Why the MSP602 as buffer? No one recommended this. The datasheet includes example ciruits for photodiodes. All are in TIA instead of buffer configuration.i have made 2 different circuit one with msp602 (as buffer amplifier) another with opa380 with 5V bias input
It´s not the problem of 12bit vs 16 bit. The problem is that especially the ESP32_ADC is very nonlinear. It is worse than any 8 bit ADC I´ve seen.You are correct the 12 bit ADC is not precise so i have added ads1115 which has 16 bit adc.
There is a graph for the noise and reverse bias -but I do not see that - but I think the noise decreases with the bias voltage? Or it is the other way?Reverse bias mainly a speed issue, operating with 0 Vdc bias otherwise
acceptable with a TIA, which gets rid of bias errors and noise.
Hi,
I see you get confused now.
Take a break. Maybe a cup of coffee. Then come back after a a quarter of an hour and read all the posts and the datasheets thoroughly.
****
now to your last post:
* Why the MSP602 as buffer? No one recommended this. The datasheet includes example ciruits for photodiodes. All are in TIA instead of buffer configuration.
* I see no OPA380 with 2.8V photodiode bias. All have 2.8V bias. One is 5V supplied while the others are still 2.8V supplied.
--> please define your requirements first. Tell us your requirements. Then decide (with our help) a solution.
*****
It´s not the problem of 12bit vs 16 bit. The problem is that especially the ESP32_ADC is very nonlinear. It is worse than any 8 bit ADC I´ve seen.
--> same as above: first define your requirements. What linearity/accuracy/precision/sample rate/signal bandwidth do you need? Then decide which ADC to choose.
Maybe the ADS1115 is good for your application. I don´t know yet. But it has the drawback of not giving access the it´s VRef.
Klaus
Noise is random frequency, a continous but random up and down. Obviously you can´t calibrate it.*Noise not a problem as i take dark reference (by switch off led) and i will subtract manually.
... isn´t a good way to design. Especially not in times when there is so much nonsense in the internet.someone said
You are correct that errors play only a very minor role in this application.Hi,
At first I´d like to correct some misunderstanding:
Noise is random frequency, a continous but random up and down. Obviously you can´t calibrate it.
What you describe is called "offset calibration".
***
I miss the requirements given in values with units. It helps us to find the right solution four you. But even more important for you to have a target. Without target you sometimes will loose time with over-engineering things, but on the other hand you will lose performance by ignoring errors.
In my eyes it makes no sense to have a 12bit (0.025% resolution) or 16 bit ADC, while the LED current most probaly drifts by (expected) by 4% within a couple of seconds. The error in LED current is 160 times the resolution of a 12 bit ADC.
When your PCB design is not perfect you may cause a jump of ADC value in the range of several percent every time you switch ON/OFF the IR LED.
What I want to say: you need to focus on the part that causes the biggest error. Improve this part. The ADC and maybe the amplifier will be the least critical.
You may improve ADC and amplifier to perfection, but if the IR diode error is that big, then you gain nothing. Really nothing. It´s just a waste of time.
I don´t want to encourage you. I want you to get very good performance with acceptable effort and cost.
But indeed it does not matter what "I want". You have to decide which way to go. So see my posts just as my personal recommendation.
*****
If I understand correctly: this is the measurement idea:
1) IR LED (ON/OFF)
2) --> fixed lumenous IR intensity on skin
3) --> measure reflection (when IR is ON/OFF)
4) --> calculate some values
***
errors. (numbering as above)
1) thermal drift of LED current, aging of LED, influence of LED current to other analog circuitry
2) distance, stray reflections, stray light, angle, location of skin/sensor ...
3) photodiode linearity, thermal drift, amplifier offset drift, gain drift, reference drift, ADC nonlinearities, ADC offset drift, ADC gain drift, ADC reference drift, influence from other circuitry
4) error in formula/algorithm, resolution and rounding errors, ...
There will be more errors.
I guess 1) and 2) will introduce the biggest errors.
****
I don´t recommend to do all at once. I recommend to work step by step.
From deciding requirements in values and units, power supply, IR_LED current, amplifier, ADC to software...
I almost forgot: you need to decide the mesurement timing. Your analog circuit will need time to settle, the ADC will need time to get stable values.... Thus the correct timing is essential.
Example: A first order filter will need
1 tau to settle to about 35% error
2 tau ... 10 % error
3 tau ... 3% error
4 tau .... 1% error
5 tau ... 0.3% error (equals about an 8 bit ADC resolution)
6 tau ... 0.1% error
7 tau ... 0.03% error (about 12 bit resolution)
and so on (as a rule of thumb)
... most probably you will - or at least you should - dismiss all ADC samples and calculations until you get stable, predictable and useful values.
Klaus
added:
... isn´t a good way to design. Especially not in times when there is so much nonsense in the internet.
Best is to use reliable informations. In case of "I2C" there is a free document with the I2C specification. This is the most reliable source of information. Every designer should keep on this specifiaction.
To keep it short:
I2C definitely needs pull up resistors. If they already exist: good for you.
The value depends on many things. 4k7 or 3k3 are good values to start.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?