[TriEmbed] Measure voltage

John Vaughters jvaughters04 at yahoo.com
Thu Aug 17 16:11:12 CDT 2023


Stern,

I just checked autofill for Stern to Steve, and I admit I have no excuse. `,~)

Sorry I missed that.

John Vaughters






On Thursday, August 17, 2023 at 05:09:36 PM EDT, John Vaughters <jvaughters04 at yahoo.com> wrote: 






Steve,

Excellent discussion on accuracy and precision, I enjoyed reading the clarifications and examples you gave. I never really broke it down like that before, but probably followed your methods/ideas in practice. 

If I missed anything in the discussion, then forgive the repeat info, but I would probably put a 3.3v zener on the measuring pin for protection of that pin in the case of accidental overvoltage. Not sure if the chip has protection or not, but just a thought.

Thanks,

John Vaughters





On Thursday, August 17, 2023 at 09:44:02 AM EDT, Trampas Stern via TriEmbed <triembed at triembed.org> wrote: 





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: 


Many people get accuracy and precision confused and assume that precision defines accuracy, for example which of these is more accurate? 

  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: 

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/
> 
> 

_______________________________________________
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/





More information about the TriEmbed mailing list