Now-a-days, there is exponential growth in the field of Wireless Sensor Networks. A connected car is an ssential element of the Internet of Vehicles(IoV) vision that is a highly attractive application of the Internet of Things (IoT).The underlying technologies include Internet of Everything (IoE), artificial intelligence,machine learning, neural networks, sensor technologies, and cloud/edgecomputing. The connectivity between vehicles is through inter communicationbetween sensors and smart devices inside the vehicles, as well as smart systems inthe environment as part of the Intelligent Transportation Systems (ITS).In WSN’s security is a major concern, since most of communication happen through a wireless media hence probability of attacks increases drastically. Intrusion detection as well as prevention measures should be taken for secure communication, hence observations of intrusion detection and prevention techniques have taken immense precedence in the research field.With the help of intrusion detection and prevention systems, we can categorize the activities of user in two categories namely normal activities and suspicious activities.There is a need to design effective intrusion detection and prevention system by exploring deep learning for wireless sensor networks. This research aims to deal with proposing algorithms and techniques for intrusion prevention system using deep packet inspection based on deep learning. In this, we have proposed a deep learning model using a convolutional Neural Network classifier. The proposed model consists of two stages like intrusion detection and intrusion prevention. The proposed model learn useful feature representations from a large amount of labeled data and then classifies them. In this work, a Convolutional Neural Network is used to prevent intrusion for wireless sensor networks. To evaluate and test the effectiveness of the proposed system, a WSN-DS dataset is used, and experiments are conducted on the dataset. The experimental results show that proposed system achieves 97% accuracy and performs substantially better than the existing system. The proposed work can be used as a future benchmark for deep learning and intrusion prevention research communitiesin the smart cities now a days.