Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

micontroller ADC to voltage conversion

Status
Not open for further replies.

joskem

Junior Member level 3
Joined
Feb 28, 2010
Messages
30
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,497
Hello,

I have a temperature sensor connected to a 12-bit microcontroller, with the reference voltage being set to 2.5V (sref:REFERENCE_VREFplus_AVss, ref2_5v: REFVOLT_LEVEL_2_5).

When the sensor and microcontroller are fed through a battery board (3.7V battery with 3V regulator), then the ADC output is around 1630. When I remove the battery board and connect the sensor and microcontroller to my laptop through a USB cable, then the ADC output is around 2800.

Why does this happen, and how can I convert the ADC readings into voltage in each case?

Thanks a lot!
 

You can convert the reading to a voltage

(Ref_volt / AD_Resolution) * AD_result.

In the case of 12-bit resolution and 2.5 ref.

(2.5 / 4096) * 1630 = 0.9948;

The ref voltage must be changing when you switch power supplies.
 

So it seems that I cannot be sure about the actual value of my Vref+ and Vref- voltages?
What can I do to find their actual values? I am not very familiar with microcontrollers..
 

to ensure that your reference does not change with power supply you can use a reference such as a Texas LM4040C30IDCKR precision 3V V-Ref
**broken link removed**
 

Since it is hard enough to change the electronics circuit, is there a way to find out the actual Vref+ and Vref- voltages in my case? i.e.
- voltage reference set to 2.5 V (sref:REFERENCE_VREFplus_AVss, ref2_5v: REFVOLT_LEVEL_2_5),
- power supply of 3V (in the case of the battery board), and
- knowing the the power supply affects the voltage reference
 

use a good digital voltmeter to measure the reference voltage and modify your calculations accordingly
The measured voltage could be stored as an offset in EEPROM
however, you need to do this every time you change the power source
 

This is a good idea! Where exactly can I measure the Vref and Vref- voltages?
 

do you use Vref+ and Vref- pins on the processor? if so on those pins
 

It looks like you are using the internal Vref.

Check the device specs for the ADC.. WHat is the Sample HOld value 4 cycles? 8 cycles?

INPUT_CHANNEL_A0, REFERENCE_VREFplus_AVss, SAMPLE_HOLD_8_CYCLES,
 
Last edited:

No, I am using just a TI MSP430F149 microcontroller. According to the datasheet, the MSP430 uses a 12-bit ADC module and contains two selectable voltage references (1.5V and 2.5V). Should I take anything else into account given that the supply voltage is 3V?
 

No, I am using just a TI MSP430F149 microcontroller. According to the datasheet, the MSP430 uses a 12-bit ADC module and contains two selectable voltage references (1.5V and 2.5V). Should I take anything else into account given that the supply voltage is 3V?

it may be worth looking thru the Texas MSP430 application notes
https://www.ti.com/mcu/docs/mcuprod...2&rootFamilyId=4&familyId=342&docCategoryId=1

e.g. Thermocouple interface using the ADC
https://www.ti.com/mcu/docs/litabsm...reNumber=slaa501&docCategoryId=1&familyId=342

it may give you some useful help
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top