This paper presents research work related to the development of Wireless Sensor Networks (WSN) gathering environmental data from the surface of the Moon. Data aggregation algorithms are applied to reduce the amount of the multi-sensor data collected by the WSN, which are to be sent to a Moon orbiter and later to Earth. A particular issue that is of utmost importance to space applications is energy efficiency and a main goal of the research is to optimise the algorithm design so that the WSN energy consumption is reduced. An extensive simulation experiment is carried out, which confirms that the use of the proposed algorithms enhances significantly the network performance in terms of energy consumption compared to routing the raw data. In addition, the proposed data aggregation algorithms are implemented successfully on a System-on-a-chip (SoC) embedded platform using a Xilinx Zynq FPGA device. The data aggregation has two important effects: the WSN life time is extended due to the saved energy and the original data accuracy is preserved. This research could be beneficial for a number of future security related applications, such as monitoring of phenomena that may affect Earth's planetary security/safety as well as monitoring the implementation of Moon treaties preventing establishment of military bases on the lunar surface.