Provided you know the weight of the phone, how would you weight any object using the phone?
Edit: Ok what if you had a device that would let you compare the weights?
Provided you know the weight of the phone, how would you weight any object using the phone?
Edit: Ok what if you had a device that would let you compare the weights?
How can you when the phone is not equipped with some sort of scale?? You need the necessary hardware for that. It's not possible with just the phone imo.
The only thing you can do is compare the weight of the object to the phone's. This way, you would have a vague idea of whether the object is lighter or heavier than XXX grams for instance.
However, I don't think you could do anything programmatically, provided that the phone has no scale.
How about using the accelerometer to measure the time taken to drop the iPhone from a known height. Then tape the object you need to weigh to the iPhone and drop from the same height. Using some pretty simple equations you can work out the difference in end velocity using the known gravitational acceleration, and hence the difference in weight. Subtract the weight of the iPhone and hey presto, you have probably the worlds least accurate weighing device (but without any additional hardware).
Edit
As pointed out by Seth The above will clearly not work as the objects will accelerate at the same speed and therefore have the same end velocity (other than any minimal impact of air resistance). In order to measure the weight the force that the object hits the ground needs to be calculated which can then be used to calculate the weight (using F = ma). One way of acheiving this (although not necessarly a realistic way) would be to have a uniformly compressible landing material where the distance it is compressed can be measured. The force that the iPhone alone will exert on the material is known as both m and a are known, and as such can be used to work out the force exerted by the combined iPhone and object.
As for the material that could be used to drop the iphone onto, any suggestions?
Write a program that measures the phones acceleration, using the accelerometer sensor.
Throw the phone at the stationary object with the unknown weight. Using the change in acceleration recorded on the phone and the distance that the unknown object moved, you should be able to compute the appropriate vectors to determine the object's weight.
More accurate results will be achieved by minimizing friction - I suggest sliding the phone across a smooth surface (say, a solid block of carbon dioxide ice).
Additionally, tests like these are best done with your friend's phone.
If you can compare weights, then accelerate the lighter object to a fraction of the speed of light until the weights compare equal. Since e = m * c^2, convert the energy of acceleration into mass, then add or subtract that mass to calculate your unknown weight.
Take a solid spring bar mounted to the ground. Attach the iPhone and the object to be measured to the bar. Measure the acceleration created by the spring flexing back and forth. Take the given flexion and acceleration and <insert math that I don't know here> in order to obtain the mass. Conversion from mass to weight is left as an exercise for the reader.
Place both objects motionless in outer space a known distance apart over a massless ruler. By mutual gravitational attraction, they will attract to the common center of gravity. Use the iPhone camera to record the starting point and meeting point over the ruler. From the c.g. point and the starting points calculate the relative masses. Bonus if you can also do this using the iPhone's clock instead of camera.
The spring idea (By Ignacio V-A) is nice and doesn't need any more PDE's other than knowing that the frequency will be ((k/m)^(1/2))/(2 pi).
(is there no LaTeX markup here?)
So if you know the weight of the phone, and you can measure the frequency using the internal accelerometer, measure the K of the spring once using the phone on its own and then put both phone and object on spring and measure the frequency. Solve for the mass of the two and subtract iphone mass to get mass of object!
Note that the nice thing about this method is that you do not need to know the spring constant in advance...you can measure it!