Intelligent Smartphone based system for detecting speed bumps and reducing car speed

. Although speed bumps are used to force drivers reduce car speed for avoiding accidents, these bumps may cause car crash or accident when drivers do not notice them. Studies have proposed different methods to detect bumps and alert drivers. However, these methods have limitations and require modifications to enable accurate detection. Also these methods did not propose speed reduction approaches. Therefore, in this research, we propose a method that utilizes smartphone microelectronic mechanical technology for speed bump detection. The system uses the gravity sensor to detect the vertical vibration of cars passes over bumps and the GPS to determine the position of the bump. To give accurate detection results, data are collected from crowd, stored and processed on the cloud. The system also contains a speed reduction unit which is attached to the brake pedal and reduces the speed if a bump is detected. A small scale experiment showed that the system detected the position and the height of bumps with a very small error. The system also reduced the speed of cars at the moment they hit the bumps to a point that does not cause any harm to cars or passengers.


Introduction
Speed bumps or speed humps have become popular recently for forcing drivers reduce car speed to avoid accidents.In many countries particularly developing countries speed bumps are placed on roads randomly, and a traffic sign that shows there is a bump ahead may not exist [1], [2].Consequently, the driving pattern is disturbed and drivers hit the bumps at high speed causing accidents and damage to cars.This problem can be solved by firstly detecting speed bumps and warning drivers in advance so that they can reduce speed before hitting the bump.Secondly, if the driver did not notice the warn message or did not speed down, the car speed should be reduced automatically using an intelligent speeding down system.
Previous studies have provided fundamental methods for detecting speed bumps [3]- [6].These methods include RADAR sensors or LIDAR sensors which are used for the adaptive cruise control system [5].These sensors increase the cost of the car, and drivers who already own cars are not willing to pay for additional devices on board.Also, ultrasonic sensors can be used for detecting speed bumps but these sensors are not very reliable as their range is very limited and they may not provide sufficient time for the driver to brake.Further, video sensors can detect speed bumps based on the color as speed bumps are usually painted in white and yellow [7], [8].Video sensors require image processing techniques to analyze the color and determine the distance and height of the bump.However, video sensors are limited because bumps usually are not painted and video is not effective at night.Another method is the accelerometer sensors which continuously provide the x, y, and z coordinates of any point on the road [3], [4].The accelerometer sensors can overcome the limitations of previous methods as they exist in most smartphones owned by drivers which reduces the cost.Also, these sensors can detect bumps more accurately than the aforementioned methods.This method collects big data that need efficient storage and processing before giving any good result.Existing accelerometer based methods are also limited to warning or notifying drivers about the bumps and are not accompanied with mechanical speed control solutions.
In this research, we propose an intelligent system for speed bump detection and speed reduction.The system utilizes the smartphone gravity sensor for detecting bumps and the accelerometer sensor for identifying the position of the bump.We build an application for cruise control which can be installed on android based smartphones.Every car driver equipped with a smartphone is a source of bumps related data (positions) and these data are uploaded to cloud.A Data mining algorithm called K-mean clustering analyzes the data which are collected from the crowd and determine the positions and the height of the bumps on roads according to geographical locations.Once the driver connects to internet, the smartphone uploads raw data and downloads information about the bumps.The system also contains a speed reduction unit which receives a blue tooth signal from the smartphone if there is a bump ahead and reduces speed.This unit consists of a microcontroller controlling a DC motor which is connected to the brake pedal.If the driver does not reduce car speed, the motor will pull the pedal down gradually.The current car speed, distance to the bump and height of the bump are considered for identifying the rotation of motor and the amount of brake, i.e., the speed when the car hits the bump.This research is also important for establishing a unified database for speeds bumps in the country.

The proposed system 2.1 System architecture
The Architecture of the proposed system consists of three main units that are: The sensing unit, the cloud unit and the speed reduction unit.The architecture is shown in figure 1.

Figure 1.
The architecture of the proposed system which contains the cloud unit, the sensing unit and the speed reduction unit.

The smartphone unit
This unit is basically the smartphone internal software and hardware components.It is responsible for detecting road bumps using the smartphone gravity sensor.We adopted the approach proposed in [4] to detect bumps.Once a bump is detected, its position is recorded in a local database and the driver is notified.This unit also contains the navigation part to guide drivers along the roads.Further, Wi-Fi is used to upload raw data (bump position, height, and timestamp) from the local database to the cloud server, and download accurate data (bump position and height) from the cloud to the local database.Also, Bluetooth is used to connect the smartphone with the speed reduction unit.The local database is used to reduce the burden of calculations, otherwise, the smartphone needs to access the cloud server for every calculation.
We developed an application called "Matabat" that utilizes the above components.The application consists of a sensing module that continuously monitors road conditions via the gravity sensor, a positioning module to identify car location by the GPS, a communication module for the Wi-Fi and Bluetooth, a navigation module for assisting drivers during trips, and reduction module which takes the car position and speed from the positioning module and obtains next bump position from the local database then calculates the value of speeding down defined as reduction value (RV).This application is installed on drivers' smartphones which form crowd sourcing.Due to unavailability of 3G on some roads and its high cost, we allowed the upload and download to be through the Wi-Fi as a batch log file before or after trips.The application uses the Bluetooth to send a message which contains the RV to the speed reduction unit when there is a bump a head.

The cloud unit
This unit contains three layers that are: the communication API layer which is in charge of receiving the raw data from the smartphones and sending back accurate data; the database layer which stores the raw data, road maps (google map) and bumps data; and the data mining layer which process the raw data and produce the accurate bumps data.The last layer is referred to as bumps mining which will be explained later in this section.

The speed reduction unit
This unit is composed of a microcontroller which receives the message containing the RV from the smartphone unit via the Bluetooth and controls the rotation of the DC motor.The DC motor is connected with the brake pedal.The DC motor rotates and pull down the brake pedal according to the RV.Indeed, this unit can be replaced by the internal mechanical braking system and car computer system which is fully controlled by the manufacturer.This unit was designed to evaluate the performance of the detection system.Fortunately, drivers did not mind to put this unit in their cars as it fits under the pedal, and it does not affect the normal usage of manual braking.As in [4], we use the gravity sensor to detect speed bumps.Firstly, the direction of gravity is identified and then the Vertical Components (VCs) are extracted from the sensor readings.Note that the sampling rate of the gravity sensor is 20Hz.The objective here is to determine the anomalies among VCs.To exclude onboard car vibrations, underdamped oscillation system is used to model the vibrations.The vibrations are represented as a long term standard deviation.When the vehicle passes over a bump, the VCs change dramatically and the standard deviation changes for a short time.We call the ratio between the long term standard deviation and short term standard deviation the Bump Index (BI),

Bumps detection
where σ is the long term standard deviation and σt is the short term standard deviation.The BI value expresses the height of the bump.The sensing module runs the BI calculations every second which means that the short term changes are considered every second.The amount of data obtained from the gravity sensor is very large and consumes much computational power and memory from the smartphone.To overcome this problem, we use the running average method and discard old data.To simplify the process, we keep the running average working on the last five minutes.The local database stores the BI value, the GPS coordinates at which the BI occurs and the timestamp.When the trip finishes and the smartphone connects to the internet, it uploads to the cloud the log file which contains the BIs during the entire trip.

Bumps mining
The position obtained from the GPS and stored in the database is not totally accurate so an data mining algorithm is used to reduce the error in the position.The algorithm is also necessary to ensure that the anomaly represented by the BI is a real bump.For this purpose, we use the K-means algorithm that is used for clustering.In our context, every car j submits a set of bumps positons P j = (P 1 , P 2 , …., P n ) where each P i is the GPS coordinates (x i , y i ).The coordinates are then classified to routes using Google map.If m cars pass through a road, the road will have m sets of bumps.The k-means clustering algorithm runs firstly on these points to find the mean value of the distance between points.The mean value should achieve the minimum mean square error.We consider the points within 10 meters are in one cluster that is because the GPS error is within 10 meters.The outcome of the algorithm is b 1 , b 2 , …, b c where c is the number of bumps in one road.These mined data are stored in bump data table in the database.
We run the algorithm secondly on the height of the bumps and find the mean value of height of point in one cluster.The result is the height of the bump found in the first round.The height is stored in the table.Each table contains the height, x and y coordinates of each bump in each road.When a car downloads the route information, it will have all bumps data in each road.

Speed reduction
The car continuously calculates its position P j and speed v using the GPS.The speed reduction module checks if there is a bump in the coming 100m every second.If a bump exists, the module calculates the distance d to the bump.According to the third equation of motions, the speeding down a can be found using the distance to the bump, the current (initial) speed v, and the final speed w as The final speed is categorized based on the height of the bump.For simplicity we assume the safe speed to pass over the bump is 30Km/hour.The reduction vale (RV) equals to the speeding value multiplied by a positive factor which depends on calculation error and mechanical calibrations for the DC motor.The DC motor should pull down the brake pedal faster when RV is bigger.

Experiment and results
Our experiment included three cars which drive in a route of 10Km length and contains 47 bumps in TulKarm city, Palestine.Each car was equipped with a smartphone mounted to the windshield.The cars went along the route 10 times.At the first time, the databases were empty so the cars did not download any data.At the end of the first route the cars uploaded batch log files to the cloud.Every time a file is uploaded, a new position of the bump is added to the database.The best case is when the new position equals the old position.Also, at every time, the server runs the k-means algorithm to identify the exact location of the bump.We compared the real bump position with the output of the algorithm and we found that the error is very small.We also compared the real height with the detected height and the difference is relatively small.Some values have high error due to the few number of cars since the data were not enough to produce good results.Table 1 shows a sample of the error for some bumps.The average position error for all bumps is 0.47m and average height error is .39m.The second experiment was to test if the car speed is reduced by the DC motor and what is the speed when the car goes over the bump.We set the targeted speed 30Km/H for all bumps.However, the resulted speed has a small error.Table 2 shows a sample of speeds for some bumps.The initial speed is when the bump was detected The difference between the bump speed and the targeted speed is very small and does not affect the car.However, the effect of the height on the bump was not studies in this experiment.

Conclusion
This research proposes a system for reducing car speed on bumps to avoid car crash or car accidents.The system utilizes microelectronic mechanical technology on smartphone such as the GPS and the gravity sensor for detecting the bumps and utilizes DC motor attached to brake pedal for reducing car speed.We conclude that using these kind of sensors requires large number of data to obtain good results.So we employed the concept of crowd source for the collection of data from as many cars as possible.We also conclude that such methods require cloud services to analyze such big data and produce the desired results.
We used a simple way to speed down the cars by pulling down the brake pedal using DC motor.Our future work will include controlling car speed using the internal computer.We believe that better results can be obtained in this way.Our future work will also include modifying the K-mean cluster algorithm so that it can give better results on big data.We will integrate this projects with other Intelligent Transportation Systems projects performed by our team [9]-[13].Our main goal is to establish an intelligent transportation system in Palestine.

Table 1 .
The error in the detected position and height of some speed bumps.

Table 2 .
The initial speed when the bump is detected and the final speed when the car hits the bump.