In typical Wireless Sensor Networks (WSNs), all sensor data is routed to a more powerful computing entity. In the case of environmental monitoring, this enables data prediction and event detection. When the size of the network increases, processing all the input data outside the network will create a bottleneck at the gateway device. This creates delays and increases the energy consumption of the network. To solve this issue, we propose using Hebbian learning to pre-process the data in the wireless network. This method allows to reduce the dimension of the sensor data, without loosing spatial and temporal correlation. Furthermore, bottlenecks are avoided. By using a recurrent neural network to predict sensor data, we show that pre-processing the data in the network with Hebbian units reduces the computation time and increases the energy efficiency of the network without compromising learning.