CHAPTER 7 ■ IOT PATTERNS: ON-DEMAND CLIENTS
Software Required
In order to develop the smarter parking system, you need the following software:
- Arduino IDE 1.6.4 or later
- PHP server (installed or hosted)
- MySQL server (installed or hosted)
- Text editor
- X c o d e
Circuit
In this section, you are going to build the circuit required for the smarter parking system.
This circuit uses an ultrasonic proximity sensor to detect objects. The sensor sends an
ultrasonic burst, which reflects from objects in front of it. The circuit reads the echo that is
used to calculate the distance to nearest object.
Make sure Arduino is not connected to a power source, such
as to a computer via a USB or a battery.
Attach a WiFi shield to the top of the Arduino. All the pins
should align.
Use jumper cables to connect the power (5V) and ground
(GND) ports on Arduino to the power (+) and ground (-) ports
on the breadboard.
Now that your breadboard has a power source, use jumper
cables to connect the power (+) and ground (-) ports of your
breadboard to the power and ground ports of the proximity
sensor.
To trigger an ultrasonic burst, connect a jumper cable from
the TRIG pin of the sensor to the digital port 2 of Arduino.
Your code will set the value of this port to LOW, HIGH, and
LOW in order to trigger the burst.
To read the echo, connect a jumper cable from the ECHO pin of
the sensor to the digital port 3 of Arduino. Your code will read
values from this port to calculate distance of the object.