Read of postive and negative values on same ADC pin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-09 8:36 PM
I have an ADC voltage ranging from +10V to -10V.
How can i read both the positive and negative value ranging from +10V to -10V on the same ADC pin.
Thanks & Regards,
Prakash
Solved! Go to Solution.
- Labels:
-
STM32F4 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-10 2:35 AM
The calculation can be done with Ohms Law and Kirchoffs Rules, the basic of any EE course.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-10 12:48 AM
Welcome @prakash1, to the community!
MCUs can only measure voltages at their ADC pins that lie between the REF- and REF+ potentials. These potentials are always positive in relation to GND, which means that you can only measure positive voltages.
If you want to measure higher or even negative voltages, as in your case, you must first translate them into the detectable range, for which you can use opamps, voltage dividers or other suitable circuits.
Hope that helps?
Regards
/Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-10 1:25 AM - edited ‎2024-01-10 1:31 AM
If you use "standard" VDD = 3,3V and (3v3 = VDDA=vref+ ) , ADC can convert 0...3,3V ;
most simple solution is using a divider at input, + offset , like this:
But dont forget : do always "reference zero calibration" , because 0,0V input is about half of full scale at adc input.
So to get some +/- result, you have to do: (adc_value) - (adc_value at 0 V input) = (+/- result)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-10 2:01 AM
Hi Ascha,
Thank you for your response.
Is there any calculation or formula for the solution that you have suggested for future reference.
Thanks & Regards,
Prakash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-01-10 2:35 AM
The calculation can be done with Ohms Law and Kirchoffs Rules, the basic of any EE course.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-07-30 7:21 PM
Hello @prakash1
I hope you have solved this problem, can you share your voltage shifter circuit diagram with me? I have the same voltage range and I want to shift it in the range of 0-3V
