Page 2 of 2

Re: 1135 voltage sensor

Posted: Wed Jun 17, 2020 7:09 am
by cizzi
Hi! 9 years after my last post about this I pulled out my old 1135 analog voltage sensor and trying to get it to work. I used the nice example from phidget22 library and I get a voltage of:

Voltage: 3.389900

Using this program

#include <phidget22.h>
#include <stdio.h>

static void CCONV onVoltageChange(PhidgetVoltageInputHandle ch, void * ctx, double voltage) {
printf("Voltage: %lf\n", voltage);
}

int main() {
PhidgetVoltageInputHandle voltageInput7;

PhidgetVoltageInput_create(&voltageInput7);

Phidget_setDeviceSerialNumber((PhidgetHandle)voltageInput7, 155928);
Phidget_setChannel((PhidgetHandle)voltageInput7, 7);

PhidgetVoltageInput_setOnVoltageChangeHandler(voltageInput7, onVoltageChange, NULL);

Phidget_openWaitForAttachment((PhidgetHandle)voltageInput7, 5000);

//Wait until Enter has been pressed before exiting
getchar();

Phidget_close((PhidgetHandle)voltageInput7);

PhidgetVoltageInput_delete(&voltageInput7);
}


My voltmeter reads 12.8V on the battery at the same point of contact where the 1135 is connected to. What am I doing wrong?

Thanks

Re: 1135 voltage sensor

Posted: Wed Jun 17, 2020 10:23 am
by Patrick
You need to apply the formula to get the real voltage from the 1135 from the voltage it's passing to your analog input: https://www.phidgets.com/docs/1135_User_Guide#Formulas

-Patrick

Re: 1135 voltage sensor

Posted: Wed Jun 17, 2020 12:40 pm
by cizzi
Hi Patrick, glad to see you still work here after so long. So I entered my value in the equation you linked me and it gave me 12.9 something volts which is off byt ~.2 volts, that's a large margin of error when my end goal is to use this data to gauge the battery level. I used the program I pasted in the last email, does it require any modification? I know in 2011 you mentionned something about ratiometric mode?

Re: 1135 voltage sensor

Posted: Thu Jun 18, 2020 2:08 pm
by Patrick
I see that 1135 lists a max error of 0.5% and a max offset of 100mV, so 200mV is within the specified error.

You will definitely want to calibrate your particular 1135 - by measuring the 0v offset and plugging that into the formula in place of the 2.5, and by measuring a known voltage and calculating your own slope.

-Patrick

Re: 1135 voltage sensor

Posted: Thu Jun 18, 2020 5:05 pm
by cizzi
I did that and it seemed to help. Thank you!