im using voltage value of my sensor as input to microcontroller pic18f4520.max level-311V to min value-100V..voltage value varies according to the person.. im trying to convert the voltage value to percentage. this percentage is the oxygen level of the person. send me the coding
Your 100v has to be represented as 0v dc and your 311v should be represented as 5v dc. I asked is the sensor o/p linear? Scale down your voltage to 0vdc to 5v dc.
Let us say, you min value 50V is equal to 0v dc and max value is 350 = 5v dc. send me the raw adc value that your sensor gives for min and max values. I will write the code.