In this paper, wireless sensor networks are integrated with the cloud environment to aid in the storage and easier processing of data. The concept of gateways is introduced for linking wireless sensor networks and cloud. The sensor gateway collects information from the sensor nodes, compresses it and transmits it to the cloud gateway which in-turn decompresses it and stores in the cloud server. The gateway monitors all the sensors in its cluster and gets data from them. The paper uses neural networks for filtering at the sensor gateway to find anomalies in the values sensed. The proposed architecture reduces the power consumption as the major portion of data processing is done at the gateways and also since the data is periodically updated in the cloud, the storage requirements of the gateway and the sensors is minimal.