1135 voltage sensor

Comments & issues
cizzi
Phidgetsian
Posts: 9
Joined: Mon Apr 16, 2007 10:33 am
Contact:

Re: 1135 voltage sensor

Post 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
User avatar
Patrick
Lead Developer
Posts: 634
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: 1135 voltage sensor

Post 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
cizzi
Phidgetsian
Posts: 9
Joined: Mon Apr 16, 2007 10:33 am
Contact:

Re: 1135 voltage sensor

Post 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?
User avatar
Patrick
Lead Developer
Posts: 634
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: 1135 voltage sensor

Post 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
cizzi
Phidgetsian
Posts: 9
Joined: Mon Apr 16, 2007 10:33 am
Contact:

Re: 1135 voltage sensor

Post by cizzi »

I did that and it seemed to help. Thank you!
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 0 guests