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.

MCU measuring voltage and resistance on the same inputs

Status
Not open for further replies.

zolispa

Newbie level 1
Joined
Oct 12, 2012
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,297
Software guy trying to play with HW...

I have a pair of inputs, on which I would like to measure a differential voltage with a microcontroller.
If there is no voltage present, I would like to measure any resistance between the two inputs.

Parameters:
- Input voltage can be 0-100V DC, any polarity
- Supply voltage is a single 3.3V
- Battery operated, hence no ground reference to any of the inputs
- Microcontroller (ATSAM3) has a 12-bit differential/single-ended ADC, and works fine with high source impedances
- Voltage measurement should have an accuracy of 1V, resistance about 1K, max 100hz sampling rate

I was doing an attempt with this:
Code:
------------|     R1
GPIO 1      |----<100k>-----------  Input A     --|          --|
            |              |                      |            |
            |            <680k> R4                |            \
            |     R2       |                    -----          /
AD+ / GPIO2 |---<100k>-----+                     ---  ?V or    \ ?R
            |              |                    -----          /
            |            <20k>  R5               ---           \
            |     R3       |                      |            |
AD- / GPIO3 |---<100k>-----+------  Input B     --|          --|
------------|

Theory:
- The 100k series resistors should protect against up to 200V inputs and ESD
- The R4-R5 voltage divider scales the input voltage to the ADCs range
- During voltage measurement GPIO1 is set as an input with pull-up/downs disabled, differential voltage is measured on AD+ and AD-
- If there is no voltage present, GPIO1 and GPIO2 are set as an output (3.3V and 0V), and the AD- pin measures in single-ended mode,
the voltage that is created by the voltage divider formed by R1 + ?R and R5 + R2 (with R4 being accounted for)

Practice:
- If R1 is not connected, differential voltage measurement is just fine
- If R1 is connected, voltage measurement doesn't work (reads full 0 or max values)

I guess this has to do with internal clamping diodes, and injection currents, but at say, 10V, these should be negligable (50uA). What is the problem ?

Also, the divider for the voltage measurements limits the resolution of the resistance measurements, so I would be happy for even completely alternative approaches on this.

Thanks!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top