[TriEmbed] Measure voltage

Trampas Stern trampas at gmail.com
Thu Aug 17 08:40:15 CDT 2023


So how much resolution on the ADC do you need, and how are you going to
test the results?  For example if you are measuring between 0-13V with a
12bit ADC (I will assume 12 effective bits) then you have ~3.174mV
resolution on the measurement with a simple voltage divider.

Now you can scale the voltage as you mentioned by using some op-amps and/or
negative reference for the voltage divider.  However this adds more
hardware to the design as such if the simple divider and bit depth of the
ADC is good enough, it is good enough.

To use an opamp you basically setup a voltage subtractor (differential
amplifier) where the negative reference is 9V.  So basically you make the
circuit implement the mathematical operation of X=Vin-9V, see:
https://www.electronics-tutorials.ws/opamp/opamp_5.html

For the 9V reference you can use a zener, voltage reference or linear
regulator.  Not that here again your accuracy of measurement will be based
on the accuracy of the voltage reference and components used in the
differential amplifier.  For example if the voltage reference is +/-1%,
then you could have a +/-9mV error on the voltage measurement due to
accuracy for the voltage reference.   So here again if you had a 12
effective bit ADC you might be more accurate with a simple voltage divider
and measure 0-13V, than doing the differential amplifier and measuring
9-13V.

Also note that your accuracy of the ADC is based on the accuracy of the ADC
voltage reference as well, so make sure you account for this as well.

Remember that accuracy, precision, and resolution are not the same things,
for example:
[image: image.png]

Many people get accuracy and precision confused and assume that precision
defines accuracy, for example which of these is more accurate?
[image: image.png]
  Basically you do not know which is more accurate unless you can measure
the target value with more accuracy and precision then your samples, for
example:
[image: image.png]
So for example if you are trying to measure to 1mV resolution and your
multimeter you are using as a golden reference is 10mV resolution you can
not calibrate the system and know you can measure to 1mV.  To this end I
have found in my professional life, rather than asking about product
requirements, it is often better to ask "How are you going to measure if
this product meets your requirements?"  That is if someone has their test
and validation plans defined, then requirements are known.  Where if they
have requirements with no test plan, then often they have not figured out
how to measure when they are done. For engineers if you have no measure for
doneness, then they will never be done with a project.

Trampas

On Wed, Aug 16, 2023 at 4:29 PM The MacDougals via TriEmbed <
triembed at triembed.org> wrote:

> I know how to set up a voltage divider with a couple of resistors to
> measure
>
> battery voltage of ~12v on an analog pin that accepts 3.3v.
>
>
>
> But, I really am interested in a small segment of the range, say 9v to 13v.
>
> How would I “zoom” in on that range?  I want to subtract/bias the vbat
>
> by the 9v minimum.  So, 9v -> 0 and 13v -> 3.3.
>
>
>
> ---> Paul
>
>
>
>
>
>
> _______________________________________________
> Triangle, NC Embedded Interest Group mailing list
>
> To post message: TriEmbed at triembed.org
> List info: http://mail.triembed.org/mailman/listinfo/triembed_triembed.org
> TriEmbed web site: https://TriEmbed.org
> To unsubscribe, click link and send a blank message: mailto:
> unsubscribe-TriEmbed at bitser.net?subject=unsubscribe
> Searchable email archive available at
> https://www.mail-archive.com/triembed@triembed.org/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.triembed.org/pipermail/triembed_triembed.org/attachments/20230817/61196739/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 242040 bytes
Desc: not available
URL: <http://mail.triembed.org/pipermail/triembed_triembed.org/attachments/20230817/61196739/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 25165 bytes
Desc: not available
URL: <http://mail.triembed.org/pipermail/triembed_triembed.org/attachments/20230817/61196739/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 42711 bytes
Desc: not available
URL: <http://mail.triembed.org/pipermail/triembed_triembed.org/attachments/20230817/61196739/attachment-0002.png>


More information about the TriEmbed mailing list