So this was a random thought I had that I thought would be fun to mess around with using an Arduino and some sensors, but after the difficulty I've had I'm just curious to see if it can be done at all.
So I thought it would be interesting to take some samples measuring the density of the atmosphere. While looking at different formulas for calculating air density at different temperatures, pressures, humidity, and even formulas for different concentration of gases, I decided it would be more interesting to do it while ignoring the actual makeup of the gas.
In other words, I can take measurements of the gas, but I can't calculate the density using any constants specific to one type of gas. So the primary measurements I'm taking are Temperature, Pressure, and Speed of Sound, however so far I cannot find any way to calculate, or even approximate the density from these values.
Currently I'm trying to see if I can approximate it based on molecular collisions, but can't really seem to get it to go anywhere. The only thing I can think of that would work in practice would be to isolate a section of the atmosphere in a closed container with a plunger, and measure its pressure and temperature at different volumes but 1) I really don't want to have to build this device with moving parts unless absolutely necessary and 2) It just seems to me that we should be able to do it using the formulas, and its bugging me that I can't find it.
I would appreciate any insight you guys can give. Thanks.
Ok so here is my train of thought I've been working on.
I've been trying to come up with a solution by treating the molecules of the gas acting as a spring.
So let's imagine two gas molecules in space. Each molecule has a kinetic theory, which by the kinetic theory of gases is each to
Ke = (3/2)BoltmannsConstantAbsoluteTemperature. 
This energy takes the form of Brownian Motion, which the molecules uses to clear out an empty space for itself. We can calculate the average space per molecules by inverting the Lochsmidt Formula, so
Space per Molecule = BoltzmannConstant * Temperature / Pressure 
Once we know the space, we can calculate the average distance from the center of one molecule to the center of a number, by treating the space as a cube, and finding the lenght of a side
SideLength = cbrt(Space per Molecule) 
So back to our model. While the molecule is moving, we can pretend that it is just sitting in the center of that empty space. So let's say another molecules (A) comes in whos average velocity of the speed of sound. A's total kinetic energy will be its Thermal Energy (see Formula 1) plus the kinetic energy of it moving at the speed of sound. Whether by collision or by electromagnetic interation, it will exert a force on another molecule (B), causing B to speed up, and A to slow down. B's original kinetic energy will simply be its Thermal Energy. Now however, Molecule B will be acting as a spring for A, absorbing the kinetic energy of it moving at the speed of sound.
Finally as A reaches the original point of B, B's kinetic energy will be its Thermal Energy, the energy of it moving at the speed of sound.
Now using the kinematic equations we can find several parts of the puzzle
First off, the speed of sound is the average velocity of the molecules
V_a = (V_0 + V_f) / 2 
Now V_0 = 0 and V_a = speed of sound, so the final velocity is
V_f = 2 * V_a 
Now that we know the final velocity, we can calculate the acceleration of molecule
V_f^2 = V_0^2 + 2 * A * D 
Again, V_f comes from formula 5.
V_0 = 0 D = distance between the atoms.
Simplifying and solving for A we get
A = V_f^2 / (2 * D) 
Now here's where things get interesting.
A (acceleration) is in the same unit as a Spring Constant.
So by treating A as a Spring Constant, we can plug it into the formula for the potential energy of a spring.
PE = (1/2) * K * X^2 
PE = potential energy K = Spring Constant X = Displacement
So in our case we get
PE = (1/2) * A * D^2 
A = Acceleration from formula 7 D = Distance between atoms.
By setting Potential energy equal to the kinetic energy of a moving object,
(1/2) * A * D^2 = (1/2) * M * V^2 A * D^2 = M * V^2 (A * D^2) / V^2 = M 
which should give us the average mass of a molecule in the gas.
But it doesn't work.
Let's plug in our values for Air. We'll compare it to the values found on http://www.engineeringtoolbox.com/speed-sound-d_82.html
So the speed of sound in air at 0 degrees Celeius (273 Kelvin) and 1 bar of pressure (100000 Pascals) is equal to 331.2 m/s
So from Formula 2 the average space per molecules is
1.38064852e-23 * 273 / 100000 = 3.769e-26
From Formula 3, the average distance between molecules is
(3.769e-26) ^ (1/3) = 3.353e-9
Our final velocity is (Formula 5) is
2 * 331.2 = 662.4
Acceleration (Formula 6) is
(662.4^2) / (2 * 3.353e-9) = 6.543e13
And our mass per molecule (Formula 10) is
(6.543e13 * (3.353e-9)^2) / 662.4^2 = 1.676e-9
which is nowhere even close to the average mass of a molecule in the air.
I feel like I'm on the right track, but now sure what else to do. Any help would be appreciated.