Pressure sensor programme using XGZP6847A001MPGPN sensor

Thread Starter

lucky930

Joined Jan 7, 2024
21
Hello Programmers,

I'm quiet frustrated now as I'm unable to figure out how I use the XGZP6847A001MPGPN pressure sensor of range -750mmHg to 7500 mmHg using ATMEGA8 chip and ADC 1 channel (10bit adc).

I've the setup already and able to get the readings from pressure sensor to display. But dont know how can I limit the pressure within specified range suppose 0mmhg to -130mmhg.

Please help me with the formula in C embededd to use.
 
Last edited:

Jerry-Hat-Trick

Joined Aug 31, 2022
823
Without checking the details of the pressure sensor you are using I’ll assume that-750mmHg reads zero and 7500mmHg reads 1024. If you are only looking for measurements between zero and minus 130mmHg surely you are using the wrong sensor? 130/(7500+750)x1024 = 16 giving you just 4 bits of resolution over that range?

Ignoring that, for the full range of 8250mmHg you have 1024 possible values so multiply the ADC value by 8250/1024 and subtract 750 to get to mmHg
 
Last edited:

Thread Starter

lucky930

Joined Jan 7, 2024
21
Without checking the details of the pressure sensor you are using I’ll assume that-750mmHg reads zero and 7500mmHg reads 1024. If you are only looking for measurements between zero and minus 130mmHg surely you are using the wrong sensor? 130/(7500+750)x1024 = 16 giving you just 4 bits of resolution over that range?

Ignoring that, for the full range of 8250mmHg you have 1024 possible values so multiply the ADC value by 8250/1024 and subtract 750 to get to mmHg
https://www.google.com/url?sa=t&sou...UQFnoECBcQAQ&usg=AOvVaw1nWSait44pwdgBWnbFlmWZ

Here is the pdf link.

Can you check an help.
 

Jerry-Hat-Trick

Joined Aug 31, 2022
823
Thanks, but that tells me nothing really new. It looks like you are using the last part number in the list on page 5 with range -100 to 1000 kPa which is the same as -750 to 7500 mmHg as you stated. If you want to read from 0 to -130 mmHg which is the same as 0 to -17.33 kPa you should use sensor XGZP6847A020KPGN33 which has a range from -20 to 0 kPa which is -150 to 0 mmHg. In this case the arithmetic would be times 150/1024 minus 150 mmHg
 

Thread Starter

lucky930

Joined Jan 7, 2024
21
Thanks, but that tells me nothing really new. It looks like you are using the last part number in the list on page 5 with range -100 to 1000 kPa which is the same as -750 to 7500 mmHg as you stated. If you want to read from 0 to -130 mmHg which is the same as 0 to -17.33 kPa you should use sensor XGZP6847A020KPGN33 which has a range from -20 to 0 kPa which is -150 to 0 mmHg. In this case the arithmetic would be times 150/1024 minus 150 mmHg
Well actuall thing is using 100kpa sensor which ranges from -100kpa to 100kpa, I can get it to work within range of 0 to -125mmHg. but not the sensor with -750 to 7500 mmhg range sensor.
 
Top