Formula changes for Phidgets (1127, 1133, and others)

Comments & issues
Post Reply
djsumdog
Fresh meat
Posts: 1
Joined: Wed Sep 13, 2017 7:39 pm
Contact:

Formula changes for Phidgets (1127, 1133, and others)

Post by djsumdog »

A few months ago I started incorporating Phidges into LtSense, a Python app for polling data from environmental sensors. I looked through the data sheets at the time and pulled the following formulas for the sensor types I ordered:

Code: Select all

            '1127': {'type': 'Light',
                     'units': 'lux',
                     'data': lambda x: x},
            # Sound Sensor
            '1133': {'type': 'Sound',
                     'units': 'dB',
                     'data': lambda x: 16.801 * math.log(x) + 9.872},
            # Absolute Air Pressure Sensor (20-400 kPa)
            '1140': {'type': 'Air Pressure',
                     'units': 'kPa',
                     'data': lambda x: (x / 2.421) + 3.478}
I was showing this to a friend of mine and where I got the formulas and I noticed the ones on the product pages had changed. I first I thought I had just typed these in wrong, but all three of them were wrong. When I started searching for the original formulas, I found pages like the following under legacy support:

https://www.phidgets.com/docs21/1133_Us ... e#Formulas

So I just want to confirm, were the formulas on all the original data sheets incorrect and the ones currently in the product descriptions the right ones? They look to be for the same products (same model and revision numbers). If the formulas were incorrect, how did this happen? Where was the quality control?
User avatar
mparadis
Site Admin
Posts: 648
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Formula changes for Phidgets (1127, 1133, and others)

Post by mparadis »

In the new version of our software libraries (Phidget22), we got rid of the "SensorValue" abstraction as we found it to be confusing to some customers. Sensorvalue is a number that ranges from 0 to 1000, which is directly proportional to the sensor's return voltage from 0 to 5 volts. Basically SensorValue = voltage*200.

All of the new equations in Phidget22 are functionally identical, but use voltage instead of SensorValue. If you're still using Phidget21, your Phidgets and sensors will be reporting their values in SensorValue (0-1000) so you should use the old equations. If you're using Phidget22, they'll report in voltage (0-5V).

It's also worth mentioning that if you're using Phidget22, you can set the SensorType property in order to automatically calculate the proper units for any sensor we sell at Phidgets. You can get the SensorUnit property once you've set the sensor type to find out what unit the data is in. You would use the SensorChange event rather than the VoltageChange event in this case.
Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests