The Earth's atmosphere is a gas comprised of numerous molecules including nitrogen and oxygen. Atmospheric pressure is caused by the collision of countless microscopic gas molecules against any surface that comes into contact with the gas. Gas pressure is determined by the rate of collisions, which varies with the concentration of gas molecules and the temperature they are heated to: the higher the concentration or temperature is, the higher the pressure becomes. As a consequence of this relationship, you can calculate how many gas molecules are present in a sample if you know that sample's pressure, temperature and volume.
Taking Measurements of Your Sample
Place the thermometer and barometer within your gas sample in such a way that you can read their measurements. If you are measuring the air pressure and temperature of the room you're in, place the devices on a flat surface away from bright lights and other heat sources.
Take a reading of the pressure of the sample in atmospheres.
The air pressure at sea level is approximately one atmosphere (atm) but varies a bit based on humidity and temperature. Many barometers measure pressure in millimeters of mercury (mmHg or Torr), an alternate pressure unit. To convert from mmHg to atm, simply divide the measurement by 760. For instance, if your pressure measurement is 1,041 mmHg, this equates to 1,041 / 760 = 1.370 atm.
Gas canisters frequently gauge their internal pressure in pounds per square inch (psi). To convert psi to atmospheres, divide the psi reading by 14.7.
Take a reading of the temperature of the sample in Centigrade. Add 273.16 to this measurement. This represents the temperature of your sample in degrees Kelvin. Zero degrees Kelvin is absolute zero, the coldest possible temperature.
Approximate the volume of your sample in liters.
If the sample is a rectangular container or the room you're in, then the volume is the product of the width, length, and height of the rectangle in meters multiplied by 1,000. Thus, a room that is 5m x 10m x 3m is 5 x 10 x 3 x 1000 = 150,000 liters in volume.
If the sample is a canister of gas or other cylindrical shape, then the, then the volume is pi * (id/2)^2 * h * 1000, where pi=3.142, id is the inner diameter of the cylinder in meters (that is, the diameter of the cylinder excluding its walls), and h is the height in meters. Thus, the volume of a cylinder that is 0.2 m wide and 1 m tall is 3.142 * (0.20/2)^2 * 1 * 1000 = 31.42 liters in volume.
Plug the values for pressure, volume, and temperature into the formula for the ideal gas law. This formula is PV = nRT, where P = pressure in atmospheres, V = volume in liters, n = moles of gas, T = temperature in Kelvin and R = 0.08206 (the ideal gas constant). You now have all the values you need to solve for moles.
For example, if the sample has a volume of 100 liters, a pressure of 5 atmospheres, and a temperature of 300 Kelvin, the equation solves as: 5 * 100 = n * 0.08206 * 300. Thus, 500 = 24.62 * n so n = 20.31 moles of gas.
Wait several minutes after introducing instruments to your sample before taking measurements. This will give them time to equilibrate. If you're not sure what the inner diameter of a gas canister is, you can estimate it by measuring the outer diameter and subtracting 13 millimeters (0.013 meters).
Do not handle pressurized samples without proper training. Keep pressurized gas samples away from heat sources. Keep flammable gases such as oxygen and propane away from heat and flames. Secure gas canisters to keep them from falling over.