Well, for a hobbyist it's not something that can be easily calculated. For us there are probably two ways to figure out how large your ballast tank needs to be:
1) find someone who has already built the same sub and use their size, or
2) trim your boat for the desired submerged trim. (*) Then add foam until you get to the desired surfaced water line. The volume of foam will be equal to the volume of water that your ballast tank needs to displace.
* you do not need to actually have built your dive module. Assuming that the dive module is at or below the surfaced waterline, it not being there will not affect this process.