How does a dive computer calculate depth? Depth is linked to pressure and water density. All depth gauges measure pressure. But is density also considered? And how? Specifically, I'd like to know:


*

*Is temperature measured?

*Is salinity measured?

*How are unpredictable changes in temperature/salinity (thermoclines/haloclines) taken into account?

 A: All commercial depth gauges only take into account pressure. They assume a fixed sea-water density, and ignore temperature or salinity variations, because they don't change the result in any significant way for a diver.
The main ones work in one of two ways. From scubadiverinfo.com:

Mechanical ones generally use what is called a Bourdon tube--a circular or spiral oil-filled tube that is close on one end and has a diaphragm on the other. Pressure pushes against the diaphragm, which pushes against the oil, which straightens the tube. The degree of straightening is then mechanically translated into a readout.
Digital SPGs use a transducer that converts pressure into voltage. The voltage is then converted into a digital signal that drives a digital readout.
Mechanical depth gauges have a secondary hand/pointer that moves along with the depth indicator as you go deeper. When you start ascent, the secondary pointer remains at maximum depth so that you have a record of it.

While temperature is important for your comfort and safety - it makes no significant change to the depth reading so is not part of the pressure sensing mechnaism or circuitry.
A: Dive computers give you a depth reading assuming standard salt water density. A dive computer that gives you the "actual" depth might be even [slightly] misleading to a SCUBA diver.
The reason for dive computers is it to be aware of the pressures that your body is experiencing. The dive tables are however given in depth, since it's safe to say that most people find easy to grasp/talk about depths rather than psi's or bars. So dive computers are set to the same water density as the dive tables are given. A dive computer that calculates the "exact" depth might be even not useful. As an extreme example, say you decide to dive in the Dead Sea. Using normal dive computers would give you "depth" readings that you are familiar with, such as you know you want to stay around "20"-"30" feet to make your dive last about 30 mins (you probably with experience have a good idea of how much air time you have per the depth). However, if you somehow had a depth gauge that gave you the actual depth, you would be diving to a depth which is of higher pressure than your usual "30ft" dive. So, for you to have any use of the depths provided by your accurate depth gauge, you would have to do some math to adjust your dive tables and so on (what diver wants to do that?) In the end, SCUBA should be fun (and SAFE!), not complicated and worrying if you adjusted properly your dive tables for your current water temperature/salinity/etc. On that note, some dive computers do have a fresh-water setting. Doing so, will give you more "accurate" depth. Dive computers are smart so they use the dive tables given a pressure and not "depth" per se, so in theory the dive computer should give you the same recommended dive time / decompression time at the same water pressure regardless of what "depth" it's displaying on the screen. But this means that your normal depths in your printed out salt-water dive table is no longer accurate to the readings in the depth gauge.
Dive computers brands are known to be either conservative or less conservative with your dive/decompression times, with some models adjusting how conservative you want to be. Here is a link of a manufacturer: http://www.divecochran.com/techpubs/Docs/EnvironmentalCompensation.pdf
On the note of diving in the Dead Sea, the opposite would be diving at altitude (some lakes). This involves actually different dive tables. If you're curious: http://en.wikipedia.org/wiki/Altitude_diving
A: I don't think they take most of that into account:
http://en.wikipedia.org/wiki/Depth_gauge
But temperature is measured by variation in the probe surface's conductivity and pressure can be (though I honestly don't know if this is how it is done) measured using a piezoelectic. Electric conductivity of the water can be used heuristically to gauge the salinity for a sub or something.
A: I think they only measure pressure difference with respect to the atmosphere $\Delta p$ and then calculate the depth $h$, as
$$\Delta p=h\rho$$
where $\rho$ is the specific weight of the water. To know exactly the depth, you would need to know $\rho$ at each point that is above the depth gauge; so I imagine that the figure they use for $\rho$ is kind of an average of typical seas and depths.
