Hello everyone,

I have the following circuit before feeding into an ADC (see attached image).

I am getting confused with it having a two voltage sources coming in. Can someone help me make sense of it. I can see there is a voltage divider before feeding into the ADC, but am having trouble understanding the circuit.

Here is my understanding of the circuit, and correct me if I am wrong, assuming that the Vin = 0V (grounded), then the voltage divider should give a reading of 0.3V ( R2/(R1 + R2)*3.3V (pull-up voltage) ). Now if I apply 1V, do I get 1.3V out? So when I apply 3.3V I effectively loose the .3V?

Because there is a 10-bit ADC (assuming there is no voltage divider, feeding directly into ADC), and I get 3.3V I should get a value of 1024 from the ADC, and 1.65V should get 512 from the ADC, and at 0V should get 0 from the ADC. So each step correspond to 3.3/1024=0.00322V/step.

Currently with the voltage divider at the front before feeding into the ADC, I get a result of 5 when applying 0V and a reading of 52 when applying 3.3V. I would like to scale the value appropriately in software, without losing any resolution i.e. when applying 0V get a result of 0, and when applying 3.3V get a reading of 1024.

Now I can just subtract 5, and this will mean I get a value of 0 when applying 0V and a value of 48 when applying 3.3V. Since I know the highest I can go 1024/48 = 21.33 (scaling factor) and use that as my scaling, but I only have 48 steps (each step correspond to 3.3/48 = 0.06875V/step) then, which meant I lost a lot of my resolution.

The strong pull-up resistor is used to help reduce noise as there are long cables potentially before feeding into the ADC.

skandebaba:
Here is my understanding of the circuit, and correct me if I am wrong, assuming that the Vin = 0V (grounded), then the voltage divider should give a reading of 0.3V ( R2/(R1 + R2)*3.3V (pull-up voltage) ).

Now if I apply 1V, do I get 1.3V out? So when I apply 3.3V

I effectively loose the .3V?

1. Yes.

2. No. 3.3volt in will give you 3.3volt on the A/D. If... the zener/TVS would be ideal.
It is NOT. A zener/TVS diode should NOT be used in an A/D circuit.

3. Yes. 0-3.3volt is 0.3-3.3volt on the A/D.

Tell us what you want to do/measure, and with what Arduino.
A single resistor e.g. 10k and a larger value cap (e.g. 100n) could be enough.
If bandwith/settling time is not an issue, than the resistor could be 100k.
Leo..

Hello Leo,

I wasn't the one who created the hardware, this was done by the hardware engineer, I am the firmware engineer trying to understand how I can go about scaling the input to the ADC correctly without losing any resolution.

From my understanding the zener/TVS diode was added for input protection, as users will be connecting various sensors to our product with different voltages, i.e. various load cells. I need to be able to scale the results properly.

It is my understanding if I remove the strong pull-up resistor, this should resolve the problem (losing information from sensor), don't need to any scaling and won't lose any resolution.

The TVS diode (super zener) will give a false idea of protection.
The A/D could be powered off . Then a maximum of 0.5volt (or <=1mA) is allowed on the A/D input.

You could remove R19 to get the full resolution.
Well, almost.
The TVS diode will compress the top part.
You might have to feed in 3.5volt or more to get an A/D value of 1023 from your 10-bit A/D.

If you consider 1mA fault current into the internal clamping diodes a safe value, then R50 = 10k and no TVS diode protects you to at least 10volts.
Leo…

You are by your own admission a software engineer not a hardware one, so I would advise you to not remove a thing. How would you feel like if a hardware engineer started removing lines of your code. He knows something that you don't, respect this and go and talk to him. He knows what he was designing for.

skandebaba:
The strong pull-up resistor is used to help reduce noise as there are long cables potentially before feeding into the ADC.

Sounds odd logic to me. The 1nF capacitor in combination with the 1.5k is reducing the high frequency noise
(cable pickup). The zener will not protect the Arduino input from under or even overvoltage well. Two
shottky diodes to the rails are the normal way to do this.

Is the input an electret microphone module? That would require a pull-up, but normally more like 1 or 2k.

Grumpy_Mike:
You are by your own admission a software engineer not a hardware one, so I would advise you to not remove a thing. How would you feel like if a hardware engineer started removing lines of your code. He knows something that you don't, respect this and go and talk to him. He knows what he was designing for.

Hey Grumpy Mike,

I did do analogue and digital electronics papers at university while completing my B.E. (Hons) in electronics and computer systems, it has been a while since I have used any of this knowledge, and don't have anyone at work I can discuss electronics with, so need to resort to forums. Working with embedded systems I think it is fair enough to say that a firmware/embedded software engineer needs to understand hardware and software and not purely software. I did email the hardware engineer to find out why he designed the circuit the way he did, and he was the one that said the pull-up can be removed for the analogue input to be accurate, or I need to use some scaling equation (don't think this is a good idea).

It is my understanding that the circuit was designed the way it is because the pin can be programmed to be used as either a digital input/output or as an analogue input.

MarkT:
Is the input an electret microphone module? That would require a pull-up, but normally more like 1 or 2k.

Hey MarkT,

The analogue input can be connected to anything, it will most likely have a load cell connected to it.

Thanks for everyone's feedback so far It is much appreciated