1135 voltage sensor

Comments & issues
cizzi
Phidgeteer!
Posts: 54
Joined: Mon Apr 16, 2007 10:33 am
Contact:

Re: 1135 voltage sensor

Postby cizzi » Wed Jun 17, 2020 7:09 am

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: 3197
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: 1135 voltage sensor

Postby Patrick » Wed Jun 17, 2020 10:23 am

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
Phidgeteer!
Posts: 54
Joined: Mon Apr 16, 2007 10:33 am
Contact:

Re: 1135 voltage sensor

Postby cizzi » Wed Jun 17, 2020 12:40 pm

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: 3197
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: 1135 voltage sensor

Postby Patrick » Thu Jun 18, 2020 2:08 pm

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
Phidgeteer!
Posts: 54
Joined: Mon Apr 16, 2007 10:33 am
Contact:

Re: 1135 voltage sensor

Postby cizzi » Thu Jun 18, 2020 5:05 pm

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


Return to “General”

Who is online

Users browsing this forum: No registered users and 4 guests