Autonomous power control (APC) and energy management system (EMS) for space microgrids (MGs) on the Moon require well-designed operating references to ensure their safe operation considering the long-term goals of the mission. Oxygen and water, as two vital elements for human survival on the Moon, can be produced from the lunar regolith using the In-Situ Resource Utilization (ISRU) and water treatment subsystems. Since ISRU is one of the highest power-demanding units in a lunar base, this paper proposes a methodology for modeling the power demand profile for ISRU, considering oxygen and water management systems, which was not addressed in the literature. The paper presents the power consumption model of the ISRU, considering the Sun's illumination profile at a candidate site near the Shackleton crater at the lunar south pole. Furthermore, a methodology is proposed to create oxygen and water consumption and wastewater generation profiles in the crew habitat. The paper proposes models and algorithms to maintain the oxygen level and pressure in the crew habitat, transfer oxygen from ISRU to the associated oxygen tank, filter wastewater in the wastewater subsystem, transfer water produced from ISRU and freshwater from the wastewater subsystem to the associated water tank, considering oxygen and water consumption, and wastewater generation profiles of the crew habitat. Finally, an optimization framework is proposed to determine the power demand profile of ISRU by maintaining the oxygen in ISRU, the crew habitat, and water tanks at desired levels. It is observed that the ISRU power demand profile depends on the desired levels of oxygen and water in their associated tanks and their consumption/production rates. In addition, the interaction of different Manuscript