Detection Unit

Purpose

The Detection Unit is a device that is placed at the entrance and exit to each of the parking lots that are to be monitored with the system. Each Detection Unit includes the following:

  • Power subsystem, which includes solar panels, battery and associated electronics
  • Microcontroller and sensor package, called Detection Unit Core
  • 3D printed enclosure

Hardware

Large pre-existing parking lots offer limited external power connections AC power, and the addition of such connections would be costly. Laying wires would present safety concerns for drivers and cumbersome gantry supports to allow overhead connections would be impractical. To minimize the burden of deployment of detection units in a large number of parking lots at TCNJ, we provide autonomous power to each detection unit, without requiring a connection to an AC power line. Stable, continuous power is required for proper operation of the detection unit subsystems and components.  A compact and standalone solar system was developed for use with each unit, allowing for greater freedom of placement and minimal external wiring as compared to alternative energy sources such as wind. Solar also provided scalable power as opposed to a much more restricted low power energy harvesting system. Charge storage in the event of poor solar insolation due to bad weather and for overnight detection unit power demands was accounted for with a LiPo battery charging circuit. LiPo batteries being available in significantly smaller packages than their Lithium-Ion battery counterparts allowed for the design of a smaller waterproof enclosure. To ensure battery longevity and safety, circuit elements to provide overcurrent and voltage regulation protection were included. Additionally, a DC/DC boost converter was necessary to account for the unique power demands and losses of the individual detection unit components.

Adafruit Feather 32u4

The Adafruit Feather 32u4 microcontroller is an Arduino based microcontroller. The sensor has an onboard LoRa radio. The microcontroller uses SPI to communicate with the LoRa radio. The 32u4 also features an I2C interface, many different pins for GPIO, Digital IO, Analog IO, an antenna pin, a power cable connector for connecting to a power source, and a micro-USB port for power and programming.

Custom Arduino Microcontroller

The idea to make a PCB of an Arduino Uno was proposed to save cost, have experience with PCB CAD, and conserve space in the enclosure. The program used to design the PCB is Eagle CAD due to its compatibility with printing companies and its popularity allowing the user to have access to many tutorials. In order to build the Arduino, it is necessary to know the components used in an Arduino that will be needed in the PCB and all the hardware that will be needing the Arduino.

Ultrasonic Sensor

The Maxbotix LV-MaxSonar-EZ1 Ultrasonic Range Finder is an ultrasonic sensor that uses Analog output to communicate with a host microcontroller. Ultrasonic sensors emit ultrasonic pulses that can bounce off objects and calculate the distance based on the amount of time sound takes to reach the sensor. The sensor has a theoretical detection range of 6.45 meters from is initial position. Each Detection Unit Core uses one of these sensors positioned towards the curb of a street. The Ultrasonic Range Finder is used to detect whether a vehicle is passing by the Detection Unit.

Time of Flight Infrared Sensor

The Adafruit VL53L0X Time of Flight Distance Sensor is a LIDAR sensor that uses I2C to communicate with a host microcontroller. LIDAR is a technology that uses laser light pulses to determine the distance between the sensor and the object in front of the sensor. The sensor has a theoretical detection range of up to one meter from is initial position. Each Detection Unit Core uses one of these sensors positioned upwards the gate above the Detection Unit. The Time of Flight Sensor is used to detect the position of the gate and verify that an authorized vehicle has passed through the entrance of a parking lot.

Enclosure

A major component of this project is the detection system that relays the information of the sensors to the base station and the power system that powers the detection system using a solar panel. In order to keep all the components of each system in place and intact, an enclosure for the detection unit was proposed. Along with verifying that the hardware of these systems would be secure from the environment, it acts as a mount for the sensors to detect the moving vehicles. The design of the enclosure was based on the needs previously mentioned above and due to trial error, there are five versions of the first prototype all designed using CAD in Autodesk Fusion 360.

Software

Each Detection Unit Core is programmed with the detection algorithm and calls a function to obtain the address used to transmit over the LoRa network. On boot, the detection unit will scan for a specific broadcast address that is associated with the group’s Base Station. Once the Base Station is notified about a detection unit, the Base station will share a network key that will serve as authentication credentials for a detection unit.

The preliminary detection algorithm and transmission software was to run similar to the flowchart seen in Figure 27. The program would start out with two variables set to zero, one for the amount of cars counted, and one for the amount of iterations passed without a car being detected. The actual logic for determining what is and is not a car has not been implemented and will be at a later date. If that logic determines that a car has passed the sensors, the variable for cars counted would increment by one and the iteration counter for iterations since the last car was detected would be reset to zero. If the logic determines that a car has not entered the lot, the iteration counter would increment. Once that iteration counter reached a certain threshold, it meant there has been a decent amount of time without a car passing through the sensors and it is probably a safe time to transmit to the Base Station. So if the variable that is storing the number of cars counted is greater than zero and the threshold for it being safe to transmit has passed, the Detection Unit would then transmit the value of the number of cars counted to the Base Station. The Base Station will know based on the serial number of the Detection Unit which parking lot the Detection Unit is assigned to and whether or not it was cars entering the lot or cars exiting the lot.