• AVR Freaks

Hot!Reading Analog Value

Page: < 123 Showing page 3 of 3
Author
NKurzman
A Guy on the Net
  • Total Posts : 17715
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: offline
Re: Reading Analog Value 2019/05/01 22:48:50 (permalink)
+1 (1)
You can measure higher than the reference if a resistor divider is added.
If you are using a Precision reference. Then it’s typically must be lower than Vcc. The details are in the data sheet
#41
john_ive
Super Member
  • Total Posts : 204
  • Reward points : 0
  • Joined: 2017/05/22 22:22:08
  • Location: 0
  • Status: offline
Re: Reading Analog Value 2019/05/02 05:09:42 (permalink)
0
qhb
What is the maximum PEAK voltage you need to measure?
You cannot measure higher than your reference voltage, so if Vref=3.3V, you cannot measure more than 3.3V.


Measuring voltage will be 0VDC to +3VDC only
#42
1and0
Access is Denied
  • Total Posts : 9615
  • Reward points : 0
  • Joined: 2007/05/06 12:03:20
  • Location: Harry's Gray Matter
  • Status: online
Re: Reading Analog Value 2019/05/02 05:36:35 (permalink)
+1 (1)
john_ive
Measuring voltage will be 0VDC to +3VDC only

Then use Vss for Vref- and +3V or +3.3V for Vref+ for better resolution.
 
FYI: The resolution for a 10-bit ADC is    (Vref+ - Vref-) / 1024
post edited by 1and0 - 2019/05/02 05:39:22
#43
john_ive
Super Member
  • Total Posts : 204
  • Reward points : 0
  • Joined: 2017/05/22 22:22:08
  • Location: 0
  • Status: offline
Re: Reading Analog Value 2019/06/28 00:41:11 (permalink)
-1 (1)
I'm going to interface an sensor with PIC's Analog pin.The sensor will produce output voltage of -4.5VDC to +4.5VDC.
 
Is it possible to read the negative voltage in PIC controller..?
#44
pcbbc
Super Member
  • Total Posts : 1250
  • Reward points : 0
  • Joined: 2014/03/27 07:04:41
  • Location: 0
  • Status: offline
Re: Reading Analog Value 2019/06/28 01:07:19 (permalink)
+1 (1)
No, not unless the PIC is referenced to the negative supply rail, in which case you aren’t really reading a negative voltage. And you will need a voltage divider anyway, because then your maximum voltage will then be 9v.
#45
PStechPaul
Super Member
  • Total Posts : 2375
  • Reward points : 0
  • Joined: 2006/06/27 16:11:32
  • Location: Cockeysville, MD, USA
  • Status: offline
Re: Reading Analog Value 2019/06/28 15:08:47 (permalink)
0
If you have Vdd= 5 VDC and use that as ADC reference, you can use a 5k series resistor and 5k pull-up to 5V. Then for the +/- 4.5 V sensor signal, the PIC will see:
 
+4.5 V => +4.75 V
0 V => 2.50 V
-4.5 V => 0.25 V
 
You will need to scale the corresponding ADC readings to whatever you need. If the reference voltage is less than the maximum sensor voltage, you will need another resistor to keep the signal within the ADC range.
post edited by PStechPaul - 2019/06/28 15:10:56

 
#46
john_ive
Super Member
  • Total Posts : 204
  • Reward points : 0
  • Joined: 2017/05/22 22:22:08
  • Location: 0
  • Status: offline
Re: Reading Analog Value 2019/07/04 23:50:16 (permalink)
0

input_voltage = (iv_temp1 * 5050uL) >> 10;

 
The input voltage is divided and displayed in LCD display.For normal voltage it working fine.
But the output voltage of the pressure sensor will be 0.012VDC (while checking with multi meter).
I tried to interface the sensor's output to ADC of PIC controller.
 
But I can't read the values in LCD.So multiplied the input_voltage with 100,but in that case also I can't get any value in LCD.
 
How to read this 0.012VDC value in controller..?
#47
ric
Super Member
  • Total Posts : 23566
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: Reading Analog Value 2019/07/05 00:19:11 (permalink)
0
You may need an opamp circuit to amplify the signal.
How have you wired up the sensor? It may require a "Wheatstone Bridge" type connection (https://en.wikipedia.org/wiki/Wheatstone_bridge )
Note that a 10-bit ADC can only measure in steps of Vref/1024, so for a 5V reference, that is 5/1024 = 5mV
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#48
john_ive
Super Member
  • Total Posts : 204
  • Reward points : 0
  • Joined: 2017/05/22 22:22:08
  • Location: 0
  • Status: offline
Re: Reading Analog Value 2019/07/06 06:42:58 (permalink)
0
While checking ADC output parallel with multimeter at some points the output from the multimeter and ADC output is same.
But in someother point the value from the multimeter and ADC output is different.
How to solve this variation in reading..?
 
 
#49
pcbbc
Super Member
  • Total Posts : 1250
  • Reward points : 0
  • Joined: 2014/03/27 07:04:41
  • Location: 0
  • Status: offline
Re: Reading Analog Value 2019/07/06 07:02:22 (permalink)
+2 (2)
john_iveHow to solve this variation in reading..?

Work out why it’s “different”. Illuminate the cause of the “difference”.
#50
ric
Super Member
  • Total Posts : 23566
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: Reading Analog Value 2019/07/06 12:51:03 (permalink)
+1 (1)
john_ive
While checking ADC output parallel with multimeter at some points the output from the multimeter and ADC output is same.
But in someother point the value from the multimeter and ADC output is different.
How to solve this variation in reading..?


If you're too lazy to provide any real information, I'm not going to waste any time trying to guess things you might have done wrong.
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#51
PStechPaul
Super Member
  • Total Posts : 2375
  • Reward points : 0
  • Joined: 2006/06/27 16:11:32
  • Location: Cockeysville, MD, USA
  • Status: offline
Re: Reading Analog Value 2019/07/06 15:53:35 (permalink)
0
An ADC does not have an output, at least not an analog output. Are you talking about a DAC or an ADC input?

 
#52
john_ive
Super Member
  • Total Posts : 204
  • Reward points : 0
  • Joined: 2017/05/22 22:22:08
  • Location: 0
  • Status: offline
Re: Reading Analog Value 2019/07/08 06:43:45 (permalink)
0

 input_voltage = (iv_temp1 * 5050uL) >> 10;

 
By keeping a certain(4.401VDC) voltage by POT and compared the value between multimeter and PIC controller output.
If any difference between the two voltage means I changed 5050 value to some other values and calibrated the value in pic controller...
 
At certain point the voltage between multimeter and PIC controller is same.
But if the voltage is changed in POT means,again variation is absorbed between voltmeter and PIC controller..
 
 
How to avoid this error values..?
#53
PStechPaul
Super Member
  • Total Posts : 2375
  • Reward points : 0
  • Joined: 2006/06/27 16:11:32
  • Location: Cockeysville, MD, USA
  • Status: offline
Re: Reading Analog Value 2019/07/08 11:42:58 (permalink)
0
What are the actual values? When you say "the same", what sort of precision (and accuracy) is that based on? A reading of 4.401 volts implies a precision, or resolution, of 1 mV and accuracy of 0.022% of reading. A 10 bit ADC has a resolution of 1/1024 = 0.1% and 12 bits would be 0.025%. And digital readings always have an uncertainty of +/- 1 digit.

 
#54
nigelwright7557
Super Member
  • Total Posts : 283
  • Reward points : 0
  • Joined: 2006/11/06 08:15:51
  • Location: 0
  • Status: online
Re: Reading Analog Value 2019/07/08 20:59:36 (permalink)
0
If its 5vac ac then you need something to reduce the ac voltage to 5v range but also shift it 2.5vdc level.
 
#55
Page: < 123 Showing page 3 of 3
Jump to:
© 2019 APG vNext Commercial Version 4.5