Method for measuring volume of gas
Unless you have a way to separate CO2 from the rest of the gases, you won't be able to measure it properly. Which isn't easy. You could put a substance that absorbs carbon dioxide inside the container for the beans. However, the substance needs to be able to indicate that it has reached capacity. And also, the volume of CO2 that it can absorb must be known. 

You could also set up a respirometer. You could make some assumptions about how the oxygen is consumed. Nevertheless, it should give you a good estimate. There are several videos and tutorials explaining them. And if you still have questions, you can ask Bio Stack Exchange.

The comment about the van-der-Waals equations: I think that you were probably thinking on using the ideal gas law to estimate the number of gas molecules in a container. 
$$pV=nRT$$

According to the equation above, you can measure the number of particles if you know the pressure and the volume. This is true for ideal gases. For a gas molecule to behave like an ideal gas particle, it would have to have no volume and have no interactions with other gas molecules. Real gases, however, do not behave like an ideal gas.  Therefore, a better model to describe real gases is needed. The van-der-Waals equation is one of these attempts.