We can use machines to recycle urine and water vapor in the air to produce drinkable water, but it will eventually become more desirable and economical to recycle our human wastes naturally rather than only by machines, and to do so naturally in conjunction with food production. Machines would be used only to sterilize and purify water that has already been cycled thru the artificial biosphere. Plants emit oxygen as a waste. That completes the animal-plant cycle. In this cyclic manner, animals and plants are mutually dependent upon each other.
Plants produce both food and oxygen for animals.
In turn, animals produce carbon dioxide for plants. In addition, animals produce excrement wastes which enrich the soil. Dead plants also enrich the soil and are not wasted. This natural cycle can be moved to space, in whole or in part. Early experiments in the 1950's and 1960's focussed on recycling air using algae, not food crops.