To build a smart parking system, it's necessary to have some sensors that can be applied to such a system. Let's see them in detail.
Sensor devices for smart parking
Presence sensor
To detect when a car is in a parking lot, there are some sensors available; in this case, we will use a presence sensor like this:
![](https://static.packt-cdn.com/products/9781783283873/graphics/assets/b806c020-ef2f-413a-860a-20bdfd3d46d2.png)
In some parking lots, there is a gate that goes up when the driver arrives in front of it and they press the button and receive their ticket; in others, they have an identity card. Here is a common parking lot:
![](https://static.packt-cdn.com/products/9781783283873/graphics/assets/30b710f1-bb03-4bf2-9f6c-7d6ef87603b1.png)
This is a prototype of the entrance to the parking lot:
![](https://static.packt-cdn.com/products/9781783283873/graphics/assets/c7d7baa9-ba07-414e-887a-4ba436c62d57.png)
Now we will make a sketch that we can use with Arduino; it detects when the car gets close to the sensor. We use the digitalread() instruction...