Design and Implementation of Portable Smart Wireless Pedestrian Crossing Control System

Walking is a daily activity that requires an appropriate crosswalk as a key part of the provision of safe transportation infrastructure. In this paper, we design and develop a portable smart wireless control system for pedestrian crossing areas to manage the traffic automatically and allow the pedestrian, like school children, to cross the road safely and effortlessly. The system incorporates the concept of smart sensing to detect the presence of pedestrians and in turn, automatically controls the crosswalk traffic lights. The system composes of two Arduino microcontrollers, two infrared PIR motion sensors, and a bidirectional wireless communication link based on Bluetooth for mitigating wiring installation and transmitting the signal among traffic light units on both roadsides. The system is fabricated and implemented as a portable LED-based traffic light testbed. The developed system is tested and validated in a real environment with a 6 m road width on the university campus. According to the obtained results, the system worked effectively and fulfilled the design criteria where the communication between both sides lights is successfully functioning and the PIR sensors can accurately detect the existence of pedestrians. The developed system is cost-effective, energy-efficient, easy to install, and maintenance-free.


I. INTRODUCTION
Walking is considered as the most basic and simple mode of transportation. Precisely, any person not riding a vehicle is known as a pedestrian. As compared to other road users, pedestrians, who are also defined as vulnerable road users, are not related to any vehicle mode [1]. They are unprotected (more exposed) during interaction with road traffic system, especially when involved in road accidents unlike other road users inside vehicles with protection ''shell'', as well as motorcyclists and cyclists with compulsory/recommended crash helmets. Crosswalk allows pedestrians to crossroads at a specific location with a reasonable safety level. At the road crossing area, pedestrians are typically assisted in road crossing by using a manually pedestrian crossing control system, which may comprise lighted signs (''WALK'', ''DON'T WALK''), integrated to the existing traffic lights [2].
Every year roughly 1.35 million people die and up to 50 million more people suffer non-fatal injuries as a result The associate editor coordinating the review of this manuscript and approving it for publication was Mauro Fadda . of a road traffic crash according to the World Health Organization [3]. The school children ( Fig. 1) and elderly people are considered to be at a higher risk regarding pedestrian crashes. Studies show that the majority (40.3%) of pedestrian casualties (including fatal) were children. From this, at least 40% were either killed or severely injured during collisions, with the highest proportion being children aged 6-10. There is evidence that children are only completely capable to select required information to perform the task of crossing the road from the age of 11. Furthermore, it has been reported that the skills which are essential for crossing roads safely such as observation, perception of unsafe locations and information processing, are still inadequately developed for young children [4], [5].
A study of pedestrian fatalities on age group also indicates that elderly pedestrians between 66 and 70 years old contributed the highest number of fatalities than any other age group. These effects are probably due to functional limitations, such as slower reaction time and motor skill dysfunction, experienced by elderly pedestrians [6], [7]. In fact, fatalities of the pedestrian are more frequent than other VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ road fatalities. In today's world with everybody is moving so fast and having little time for others, people's safety becomes the main concern. Busy urban area streets and roadways can frequently be unsafe spots for drivers and pedestrians alike. It might be hard to consolidate pedestrian activity with the stream of automobiles. Cities authorities must make a point to implement road arrangements to move traffic in a smooth flow and secure pedestrians [8]. It is particularly imperative to ensure that pedestrians are given safe areas to cross busy streets as crosswalks, walkways that traverse over occupied roads, and different strategies.
As the world keeps growing with advanced technology and more people are required for it, the main roads in the city or any pedestrian's walk spaces become hustle and bustle nowadays. Therefore, any street crossing area may be less safe and effective for pedestrians when using them. One of the major factors is the button functions as a human detector, alerting the system to the presence of a pedestrian and requesting a ''WALKING'' signal as soon as possible. In some cases, the pedestrian may have to push the button to cross, otherwise, the system does not know there is a pedestrian waiting and will proceed through its cycles without ever displaying a ''WALKING'' signal and pushing the button simply reduces wait time. According to [9], only 60% of pedestrians would initiate the step to locate and push the activation feature before crossing the road. Therefore, 40% of pedestrians were left at greater risk, in not having the system in operation for their intended crossing. It is necessary to raise the potential for a higher degree of safety, without the effort or interaction of the pedestrian attempting to cross.
Control of pedestrian crossing represents a key challenge for planning urban areas, managing traffic, and designing roads, given the need to manage pedestrians crossing and other users of the transportation system safely and interactively [10], [11]. Pedestrian crossing control systems were developed with the intention of pedestrians' safety and traffic management [12]. Many types of control systems for crosswalk management have been proposed in the literature and few were implemented in practical deployments. This was done by developing decision-making tools for identifying the needs for traffic control, thus enabling pedestrians to safely cross the roadway. Other systems focused more on manage crosswalk locations manually using pushbuttons, identifying vehicular exposure, communication between vehicle drivers and pedestrians and pedestrian demand [13]- [15]. Safety of pedestrians in streets crossing areas can be enhanced via several methods including pedestrian recognition using computer-aided systems, crosswalk design and lighting, and pedestrian visibility increment [16]. Although existing systems contribute to enhancing pedestrian safety and traffic management; the utilization of the new communication technologies and automation [17], [18] is still missing to build a wireless system for control pedestrian traffic [19]. Therefore, our study is developed to overcome some issues inherent to the conventional systems by deploying motion sensors to detect the presence of pedestrians with no-need for the embedded manual push buttons.
This paper specifically presents the design, implementation, and validation of a portable smart wireless pedestrian crossing control system. It facilitates the detection of pedestrians using PIR motion sensors and automates the switching of traffic light according to sensor outputs. An Arduino Uno with an integrated Bluetooth module is exploited as a microcontroller with wireless communication support. The Relay board is used to control traffic light when needed. The proposed system was implemented in a real deployment with the aim of pedestrian safety assurance, crosswalk traffic automation, and portability. The core contribution of this paper is the development of a portable, cost-effective, easy to install and maintain automatic wireless pedestrian crossing control system to continuously monitor the presence of pedestrians and automatically control traffic lights to allow people crossing the road safely and efficiently. The key contributions of this study are listed as follows: i) Design and implementation of an energy-efficient LED-based pedestrian crossing control system with wireless support and portable nature. ii) A novel concept for detecting pedestrian at crossing area and organizing the traffic is proposed. iii) An algorithm implemented in Arduino IDE is developed to perform relays control based on PIR sensors' status. iv) Validation of the developed system to ensure its effectiveness and functionalities at the university campus. The remaining part of this paper is structured as follows: Section II introduces the related work. Section III presents the system design and fabrication. Section IV describes system implementation and operational procedure. Section V discusses system functionality testing results. Section IV highlights the conclusion and directions for further improvements.

II. RELATED WORKS
With the emergence of the Smart City paradigm, the portable smart wireless pedestrian crossing area system is expected to be an exceptional trend in the future. In this section, previous work related to the pedestrian crossing area system is considered. To our knowledge, a large number of studies rely on the smart city, accordingly, and with the increasing pedestrian crossing area system everywhere, studies on the smart pedestrian crossing area system have been reviewed for several authors in this paper. Most of the existing research efforts have mainly focused on the analysis and prevention of road accidents at president crossing areas. While some researchers studied pedestrian behaviors in an urban environment which may affect their road safety, other studies focused more on drivers' behaviors and the speed of their vehicles in crosswalk areas. Many studies proposed various solutions for improving the existing traffic light systems to be smarter and more efficient. Therefore, the sake of brevity, the findings, and recommendations of this study contribute to a broader understanding of the evolving user attitudes towards privacy in smart cities, the following are some relevant works in the field of pedestrian crossing area system, such as: Ref.
[20] described a new passive method based on the Wi-Fi network for estimating the number of pedestrians in the traffic scenario in urban areas posed via the signal intersections, by distinguishing between the pedestrians that waiting at the pedestrian crossing and the pedestrians that walking as well as estimating the precise location where the static pedestrians are waiting for crossing. Through doing so, the pedestrian operator can be included in the systems of intelligent control management to optimize traffic in realtime. The performance analysis study conducted shows that the proposed approach is able to investigate a great level of accuracy by providing easy implementation.
In [21], authors presented a methodology for evaluating many safety indicators in the environments of pedestrian crossing through the use engineering and radiological information extracted from the 3D point clouds that have been collected via the Mobile Mapping System (MMS). The methodology of this work consists of four main processing units, such as analysis of the accessibility to the crossing area, the presence the traffic signs, the traffic lights, and the visibility close to the pedestrian crossing between the driver and the pedestrians. The analysis output is exported to the Geographic Information System (GIS) where they are conceived as well as can be further addressed in the city administration context. However, each unit produces many parameters that can be exported to GIS for visualization, where the weighting of these parameters has been according to traffic authority standards that will allow the determination of a safety index for every pedestrians' crossing, in addition to highlighting the areas that required the maintenance or any improvement in the engineering conditions for the transit area. This methodology has been tested on nearly 30 infantry crossings in two different cities and crowded urban environments. The results explain that MMS are a valid way of assessing the safety of a particular urban environment, concerning its engineering conditions. An analysis of the characteristics of illegal crossings, which includes the behaviors of unlawful crossing at intersections with signals, which were classified into two types, such as; crossing outside of a crosswalk and crossing at a red light, as well as their effect on the choice of behavior, was presented in [22]. In this work, the collection of two sets of data have been used to understand the behaviors, where the first set have been obtained from the monitoring list on the video, and the second set from an online questionnaire. Finally, analyzed the incidental characteristics at the pointing intersection of the illegal crossings as well as develop two models of Bayesian-based behavior to investigate the characteristics and their effects on the two type's behaviors of the unlawful crossing. The results revealed that the unlawful crossings occur at different types of signal junctions, with a greater probability of crossing outside the pedestrian path compared to the crossing at a red light.
Authors in [23] introduced the importance of achieving a general pedestrian lighting system (PLS) for pedestrian crossing and its optimum dimensions. The proposed system included the energy-saving lights LEDS and directs the luminous flux towards the pedestrian crossing area in the direction of the driver's drive to alert him of the presence of a dangerous area and adapts the movement speed to avoid any risk. A study in [24] suggested designing and implementing of a multi-signal Smart Traffic Signal Control (STSC) system for the applications of Smart City to improve public transportation efficiency and reduce traffic congestion depending on the controller of the roadside unit (RSU), which is the essence of the proposed system. The designed STSC system follows the traffic control protocol V3.0 in the urban areas, which compliant with the traditional traffic lights controller and can be deployed quickly and cost-effectively. However, the proposed system has been convenient with the existing traffic light control unit so that it can be deployed quickly and cost-effectively. Besides, the new traffic light scheme has been specifically designed for the emergency vehicle signal preemption (EVSP) scenario, as it can inform all drivers near the intersection with regard to the direction the emergency vehicle is approaching (EV), enhance safety, and facilitate traffic flow.
Ref. [25] illustrated the detailed work of identifying pedestrians in real-time on terminal devices through used a microcomputer to automate the operation of the traffic lights as well as improve the traffic system. However, this work was dedicated to a brief analysis of the current pedestrian detection systems, with the further development of its own system depending on these studied as well as implemented additional on the Raspberry Pi computer. After that, a natural experiment has been conducted in order to detect the pedestrians in the form of an image with the subsequent determination to their site at the pedestrian crossing. Several common pedestrian detection systems have been analyzed according to the speed, possibility of applicability to the microcomputers, and selection accuracy. The developer system automates the work of the traffic light by entering additional functions, such as; moving pedestrians along the road, tracking the pedestrian mode, and ensure the safety of the road users, allowing an improvement in the level of the whole urban environment.
In [26], the detailed information on presents a fuzzy logic-based solution capable of managing the stages of traffic VOLUME 8, 2020 lights dynamically at signaled pedestrian crossings was highlighted. The proposed method progresses the possibility of changing the stages of the traffic light, take into consideration the time of day and the number of pedestrians on the verge of crossing the road. Indeed, green time can be increased compared to that defined stationary time to allow the best disposal than the accumulation of pedestrians. However, this work presented a comprehensive simulation assessment, conducted by Vissim, concerning vehicle distribution and the flow of pedestrians, the number of stops, traffic queues at traffic lights, and several parameters to assess the safety of pedestrians.
Automatic detection of pedestrian crossing by using images from the system of vehicle-based mobile mapping was proposed in [27]. The proposed system works to detect the pedestrian crossing in various positions and lighting conditions. However, the pedestrian crossing workbook has been trained at a low recall rate, then analysis of contouring information, and the vision of unilateralism. Lastly, the proposed pedestrian crossing detection and analysis system will be achieved with a high drag, accuracy, and robustness. It can automatically identify defiled and weakened crossings at the same time, making it easier to control and maintenance of traffic facilities, to reduce potential traffic safety problems as well as secure property and lives. The discussions above are few, but not the least, which includes the smart wireless pedestrian crossing area system applications that help to improve the quality and living safety. This paper describes a platform for the development of such an app as well as discusses the experiment with the results.

III. SYSTEM DESIGN AND FABRICATION A. SYSTEM MODEL
The main idea of this paper is to implement the portable smart street cross walking system to help the pedestrian (like school children) safely crossing the street. Our testbed consists of two identical units; each will be placed on one roadside. The adopted methodology for this research is twofold; (i) control system modeling and implementation (electrical), (ii) system fabrication (manufacturing). In the first phase, the electrical part, the development of software and hardware was carried out. It started with material selection where sensors, actuators, and controllers were selected. It followed by electrical circuit design and wiring installation. Then the software and algorithm development using the Arduino IDE was conducted. The wireless communication module also integrated with the Arduino microcontroller. After that, the testing phase of the selected components and the partially-installed system was carried out. The manufacturing part focused on the design and fabrication of the body frame of the traffic lights and followed by the implementation of the control circuit in the developed system. Finally, the testing and validation of the entire system were carried out. Fig. 2 shows the general model of the proposed system; the approach here is to install Passive Infrared (PIR) motion sensor in order to determine the presence of a pedestrian in either the curbside area or the crosswalk. The aim is to automate the system and activate the signal to make it hands-free and does not require a pedestrian action to like the existing systems with push a button. The general operation mechanism of the system starts with pedestrian detection by the motion sensor in the crosswalk, the microcontroller will then turn on Greenlight for pedestrian and Red light to the motorized vehicles. Bluetooth module acts as the medium of networking between both microcontrollers and traffic lights that placed on both roadsides wirelessly. This will actuate the traffic lights of vehicles and pedestrians on both roadside and will act as an automatic ''push button'' crosswalk, thus eases the movement of pedestrians on the crosswalk especially for children and elderly groups.

B. SYSTEM COMPONENTS
The developed system consists of two identical units and each unit composes of five main components, namely an Arduino Uno microcontroller, a PIR sensor, a Bluetooth module, a relay board, and a vehicle/pedestrian traffic lights. A mechanical manual switch is also added to the power source circuit for easier testing/handling. The components' details are described as follows.

1) ARDUINO MICROCONTROLLER
This system needs to have a core controller that can be programmed to control the input and output from the sensors as well as actuate the equipment. A microcontroller is a small computer on a single integrated circuit containing a processor core, memory and programmable input and output peripherals. Microcontrollers are usually designed for embedded applications, where they are different with microprocessors, which are generally used in personal computers or other general purposes applications that consists of various discrete chips. A microcontroller is more economical compared to control even more devices and processes digitally. This is because microcontroller is small in size and cost lower compared to a design that uses a separate microprocessor, memory and input/output devices. In our system, two Arduino Uno AtMega 32 microcontrollers [28] are exploited on both roadsides (one each) to perform the control task by gathering information from PIR sensors and send outputs to the relay boards to control the traffic lights for vehicles and pedestrian. The software development and the proposed algorithm are implemented using the Arduino IDE and uploaded to the Arduino. Arduino is an open-source platform used for constructing and programming of electronics. It can receive and send information to most devices, and even though the internet to command the specific electronic device. It uses hardware called Arduino Uno circuit board and the software used is AVR studio and Proteus. Nowadays, Arduino is common use because it makes things more accessible due to the simplified version of C++ and the already made Arduino microcontroller (ATmega328 microcontroller). It is a circuit board with chip that can be programmed to do number of tasks, it sends information from the computer program to the Arduino microcontroller and finally to the specific circuit or machine with multiple circuits in order to execute the particular command. Arduino can help to read information from input devices such as sensors, antenna, trimmer (potentiometer) and can also send information to output devices such as a light emitting diode, LED, LCD screen as well as DC motors. Also it is prefered due to its user friendly or easy to use setting. The testing of sensors and actuators as individual components was performed using the Arduino serial monitor before the combination of the completed circuit.

2) PASSIVE INFRARED SENSOR
''Passive'' in this case implies that the PIR sensor does not send any signals but only reads in infrared light or heat signals. Two PIR HR-S501 motion sensors are used to detect the existent of the pedestrian at the curbside of the crosswalk. The selection of PIR owing to their features such as small size, low power, inexpensive, easy to use and do not wear out. Therefore, they are usually found in appliances and gadgets in homes or businesses. IRs are made of a pyroelectric sensor, which can detect levels of infrared radiation. Typically it calibrates for a short period of time to create a map of the infrared energy in front of it, and once the calibration is done, it triggers a signal when the amount of infrared changes suddenly. Everything emits some low-level radiation, and the hotter something is, the more radiation is emitted. The sensor basically operates based on infrared radiation, which is emitted from the human body. Infrared light is electromagnetic radiation with a wavelength between 0.7 and 300 micrometers. People are the source of infrared radiation. It was found that the normal human body temperature radiates IR at wavelengths of 10 micrometers to 12 micrometers. PIR sensor is made up of crystalline material that generates a surface electric charge when exposed to heat in the form of IR. This change in radiation striking the crystalline surface gives to change in charge. PIR sensitivity range is up to 20 feet (6 meters) 110 • × 70 • detection range. The IR sensor is typically covered by a dome-shaped lens that helps to condense and focus light so that it is much easier for the sensor to detect infrared variations. The output signals from PIR will be used by the Arduino to switch ON/OFF the traffic lights.

3) BLUETOOTH MODULE
The system exploits a wireless communication technique based on Bluetooth as a communication interface instead of using wires as the communication medium, thus reducing construction cost, mitigating wiring installation besides decreasing maintenance cost. We applied a bidirectional communication link for transmitting the signal among traffic light units on both roadsides. Two Bluetooth modules HC-05 are used to perform bidirectional communication concepts in transmitting the signal from one traffic light to another across the road. HC-05 module is an easy to use Bluetooth SPP (Serial Port Protocol) module, designed for transparent wireless serial connection setup. Serial port Bluetooth module is fully qualified Bluetooth V2.0+EDR (Enhanced Data Rate) 3 Mbps Modulation with complete 2.4 GHz radio transceiver and baseband. It uses CSR Bluecore 04-External single chip Bluetooth system with CMOS technology and with AFH (Adaptive Frequency Hopping Feature). It has the footprint as small as 12.7 mm × 27 mm. It selected to simplify our overall design/development cycle. The HC-05 Bluetooth Module can be used in a Master or Slave configuration, making it an appropriate solution for short range wireless communications. The module can be implemented either with master or slave configuration and it is provided with red LED indicator to show connectivity status. Bluetooth master device has a function of remembering the last paired slave device. As a master device, it will VOLUME 8, 2020 search the last paired slave device until the connection is built. But if the WAKEUP bottom is pressed, HC-05 will lose the memory and research the new slave device.

4) RELAY BOARD
A 5 V DC, Opto-isolator, 6 channel relay boards are used in the system to perform the traffic lights (LEDs) switching on both roadsides either for vehicles or pedestrians. The relay will be energized/de-energized depending on the decision made by the Arduino microcontrollers and based on the received information from the PIR sensors.

5) LED TRAFFIC LIGHT (VEHICLES/PEDESTRIAN)
A 12 V DC, 10 mA Light Emitting Diodes (LED) are utilized to replace the AC lights in the conventional traffic lights to improve system efficiency and reduced energy consumption. LED has longer lifetime and emitting light more evenly, making them more visible in foggy conditions. Six lights are used for vehicle traffic lights while four lights for the pedestrian. The size of the light is 125 mm (Car), 75 mm (Pedestrian). These LED lights are powered using Lithium Polymer rechargeable batteries (12 V, 2200 mAh, 0.1 mA).

C. SYSTEM FABRICATION
Our system has been completely built from scratch. Therefore, the system design, fabrication, and implementation processes were conducted in a proper sequence to accomplish the final product. The traffic lights have given many benefits to all road users. Besides reducing the number of accidents, it made the traffic flow smoothly and possibly could save people time. Therefore, the compatibility of the developed system with the existing standards must be considered during the design and fabrication process. Several features should be fulfilled in our system such as friendly sight for both pedestrian and vehicle traffic lights because somehow for some reasons it is will be difficult to see when in dark and bright conditions. Besides, there are three main parts in this traffic light system: (i) housing/box, (ii) pole and base, and (iii) vehicle light or pedestrian light. The overall traffic light fabrication is a commonly available design that can be seen today with slight differences which can lead to the completion of the smart wireless system. We used Siemens NX10 software to design the proposed system. All the main parts above detailed with specific material used with optimum and reasonable measurements to make the system running smoothly.
The design as shown in Fig. 3 consists of the cars and pedestrian side lights boxes, support pole and well-built base. The height of the traffic light is 200 cm which suits the average height of any pedestrians and the inner fabrication created finely for electrical wiring. A most important part of this smart traffic light system is the housing where it becomes the shielded house for the electrical components, wiring, printed circuit board and PIR motion sensor itself inside those housing. Besides, corrosion-resistant aluminum material is chosen to imply in the housing. For the sake of portability, our system has a pole and base to support the traffic light to stand up, so this project uses the steel rod as the pole and thicker zinc sheet as a base. The galvanized steel rod is the most suitable for making good support as it has a corrosion-resistant advantage. The type of rod used is Type-305. It is positioned below the lights housing.
Basically, a traffic light, traffic signal, or stoplight is a system positioned at a road intersection, pedestrian crossing, or other location in order to indicate when it is safe to drive, ride, or walk using a universal color code. In Malaysia, the traffic lights for vehicles usually have three main lights, a red light that means ''STOP'', a green light that means ''GO'' and yellow that means ''STAND-BY''. However, for the pedestrians, there have only two lights, red light and a green light that mean ''WALK'' and ''STOP'' respectively. We have followed the same standards in our traffic lights system design. Zinc Sheet is used to create major parts of the light housings due to its advantages such as workability, low toxicity, and corrosion resistance. As shown in Fig. 4, somehow, car and pedestrian boxes consisted of different designs and shape for more geometry design creativity but they have some useful individual advantages. For example, the shape of the pedestrian box (two subfigures on right side) possesses a tapered shape from the below. The perk of the design is to create a square hole for the insertion of the PIR motion sensor permanently. Starting from sheets into redefined plates for fabrication. The raw zinc sheets which were about 8 feet x 8 feet machined and cut with provided non-conventional high technology cutting machine called Hydraulic Sheet Cutting Machine. In addition, the grinder was used to trim off the sheet to create a perfect rectangular sheet. The boxes are designed with filleted edges and no sharp edges to prevent any injury actions. The combination of two sheets by using riveting techniques is better than welding techniques. Both boxes were embedded with side open-close door which is essential for ease of wiring insertion processes. A door created simply with the same material sheet but 2 hinges were implemented for one door. With the same riveting technique to combine hinge into the sheet.
As the traffic light is made from a conducting material, zinc, a black carbon sticker was used and pasted inside the boxes to prevent any short circuit to happen which is quite dangerous for the electronic components. Pieces of zinc sheets were fabricated to obtain around the curvy hood for the cars' traffic light which acts as protection from sunlight, rains, bird's feces and more in the car as shown in Fig. 5 (a). Additionally, the hood makes the lights glow brighter for far distant pedestrians during night time. A Plate Rolling Machine was used to roll the sheets into curvy shapes. Not as special as car traffic light hood, pedestrian traffic light hood just use a U-shaped zinc sheet. For the base, we chose an octagon-shaped ( Fig. 5 (b)) base as the foundation which balancing the support and looks more elegant and mechanically stable. Also, a 5 mm zinc sheet thickness was selected to complete the base. For the last prototyping process to finalize the system fabrication, the black sprays were used to fashion the overall traffic light.

IV. SYSTEM IMPLEMENTATION
The developed integrate the concept of pedestrians detection and wireless communication in the automatic control of the traffic lights. The required information can be collected using PIR sensors and processed using Arduino microcontroller. The electrical installation of the selected components is required for the successful implementation of the developed system, thus it can operate smoothly and effectively. In this section, the control circuit setup inside the fabricated system is described. In the beginning, electrical circuit design was conducted using Fritzing software as depicted in the virtual connection diagram of Fig. 6. The figure shows the connections between various electronic components of the developed system. There are few steps required in order to make a complete portable smart street wireless crossing area system which involved machining process as well as the microcontroller circuit. The microcontroller circuit has been developed on a breadboard first to test its functionality, then the process of soldering is done. By having this small circuit, any error of system can be easily troubleshot and the connection can be changed without consuming so much time to rebuild the circuit. A good connection and insulation of wiring are required for continuous operation, thus a plastic sticker is used to improve insulation and avoid any electrical contact with the metal housing of traffic lights. The components of the control circuit are installed into the traffic lights housing of each unit after we have ensured that all components were checked individually, and the completed circuit was tested successfully on breadboards. After that, the components are transferred to the fabricated system enclosures. As we mentioned earlier, the implemented system includes two separated units (each on one side of the road crossing), thus all the aforementioned phases have been repeated twice. Fig. 7 displays the overall architecture for one roadside unit of the deployed testbed. The signal flow starts from the PIR sensor which detects any pedestrian and transmits the data to the Arduino microcontroller to be analyzed for taking the right action based on the implemented program. The system is programmed in such that, whenever the sensor detects a pedestrian at the crosswalk, the microcontroller sends a signal to the relay module to activate the traffic light. There are two sets of traffic lights in our system, one for vehicles and another for the pedestrian. Each road's side traffic light consists of three lights for cars and two lights are for pedestrian use. The Bluetooth role is to exchange the wireless signal between the microcontrollers of the traffic light system located on both sides of the crosswalk. This Bluetooth module ensures that both traffic light systems are working simultaneously and consistently according to PIR inputs from VOLUME 8, 2020 both sides of the crosswalk. Bluetooth Master-Slave setup configuration was conducted to ensure both Bluetooth modules can work as a master and slave at the same time. The outputs of the relays are connected to the LED traffic lights which are powered using a rechargeable DC battery.
For the sake of increasing the safety rate for pedestrians, the accuracy of the motion sensor is a major focus on this project. The sensor was placed on the height which higher than the average person (≤ 200 cm) for overall detection between the stated height. With these perks, children, pets, elders and so forth can cross the road safely. Besides, about the time interval, recently available street cross-walking supports minimum unstable timer on the signal lights which may harm the pedestrians and also vehicles. Numerous enhancements are created upon the progress of this project and one of the benefits is the considerable timer which for vehicle vision, when the motion sensor detects any pedestrian's movement, the system automatically channels an instruction to the signal light with balance timing of ''STANDBY'' light for the vehicle's stop preparation. As a smart street cross-walking system, as a pedestrian crossing the road, the signal light retains possession of ''WALKING'' light until no other pedestrians are crossing for the least time delays. The currently used system may be just applied a relay between both signal lights for communicating, despite that, this project used a Bluetooth module which can be programmed to increase the effectiveness of signal lights' communication. The electrical components including rechargeable battery are successfully installed inside the traffic light housing, as shown in Fig. 8.   9 describes the flow chart of the system operational procedure. The system starts by switching ON the green light for car and red light for pedestrian which is normal traffic condition giving cars to move (CAR phase activation). The vehicle's traffic lights will operate in the normal sequence based on the time intervals for each light (green, yellow, red). When both systems are switching On, the Bluetooth modules establish a wireless communication link between both system units to exchange information between the Arduinos. After that, the system will check for the pedestrian presence by PIR motion sensors on both sides of the road crossing area. If the sensor detects no pedestrian, the system will loop and continuously check for the pedestrian. If the PIR sensor detects any pedestrian, the yellow light will turn ON for 5 seconds followed by a red light for car and green light for pedestrian (WALK phase activation) for 30 seconds. After WALK phase timing ends, the green light for pedestrian starts blinking 5 times to warn the pedestrian and car before the traffic light end the WALK phase. The system will continuously (looping) detecting pedestrians and lengthen the time for another 30 seconds for the WALK phase. When the sensor detects no pedestrian, the traffic light will remain in CAR phase activation. The system is a closed-loop system; thus the condition will continuously run whenever the programmed condition meets. We have developed Algorithm 1 using the Arduino IDE to perform relays control based on PIR sensors' status. As stated in the algorithm, the main important issue will be the establishment of connection between Master and Slave Bluetooth devices on both road side. The developed algorithm is implemented using Arduino IDE in both microcontrollers. the algorithm exploited two main functions which are PedchangeLights function and CarchangeLights function to control traffic lights for both vehicles and pedestrian.
The first function has a timer to control two lights (red & green) where it switch ON the green light for 30 seconds when the condition is satisfied. On the other hand, the second function switches between three lights (red, yellow, green) according to a predefined timer. It will switch On the yellow light for 5 seconds and then the red light for 30 seconds to stop vehicles and allow pedestrian to cross the road, then if no more motion switch on the cars green light.  17: get PIR 1 , PIR 2 check the presence of pedestrian on both sides 18: exchange motion status between Arduinos via Bluetooth link 19: if mostion is detected then 20: call the PedchangeLights Function; 21: delay;

V. RESULTS AND DISCUSSIONS
The final assembly for our portable traffic light system testbed is shown in Fig. 10. The entire testbed composes of two completed standalone traffic light units, each used for vehicles and pedestrians at the same time. Each unit will be placed on one side of the pedestrian crossing area. The automatic pedestrian detection and wireless-based control of traffic lights over the Bluetooth are well-functioned. The Bluetooth module uses the 2.4 GHz frequency band to communicate with the other side's unit which is within its communication range (maximum range is 10 m). The traffic light unit has its PIR sensor to detect the presence of the pedestrian at the curbside of the road, and to exchange the information with the other unit. One of issues that we faced is how to decrease the radius of range detection for the PIR sensor. This because it has a minimum range of 2.5 m up to 8 m of motion detection depending on the setting of its sensitivity, delay time and the ambient temperature. Thus, the PIR sensor will give false signal because it can detect the presence of pedestrian at far from the traffic light. A calibration test for the sensor has been conducted and the PIR sensitivity has been tested for normal operation (NO) and reduced sensitivity (RS) by controlling the sensitivity and the delay time. The impact of ambient temperature on the sensor detection range has been investigated. The sensor was tested under varying ambient temperature during daytime and night tight to understand the expected behavior of the sensor in our system since it is a core component. Fig. 11 shows the impact of surrounding temperature on the detection range of PIR in m. As the temperature increased the detection range decreased for both setting of sensitivity: normal operation and reduced sensitivity. The higher the ambient temperature is, the longer detection range can be achieved. With reducing the sensor sensitivity, we have manged to mitigate its detection range to 2.5 m at the high temperature weather. However, that range still long and may cause a wrong decision if the sensor detects a faraway pedestrians. To solve this problem and reduce the detection range to less than 2 m, a PVC pipe is used to narrow the angle of detection of the sensor and the PIR sensor is placed at 2.5 m height which is 45 degree of angle facing the ground. Minimizing the angle of detection has been done by putting the PIR sensor inside a hole. PIRs provide information about the existence of people in their detection ranges to the local and the remote microcontrollers. The testbed has been deployed on one of the zebra crossings at University Malaysia Pahang (UMP) campus with a 6 m width of the road to prove its functionality in the real environment. The selection of the testing location on campus because pedestrians in the campus area face challenges crossing the road to class every day due to high vehicular traffic influx to and from campus. Thus, our system will give priority to these pedestrians so that they cross the road safely. The experimental results proved that the system is quite viable. The system works fine according to the design criteria and the specification where the communication between both traffic lights is fast, synchronous and successfully function. Fig. 12 and 13 show the system testing at the UMP Campus crosswalk area. The testing is done at night to avoid busy cars passing the crosswalk. These figures show the system in both phases, CAR phase activation as in Fig. 12 and WALK phase activation as in Fig. 13. This system really helps to increase the safety of the pedestrian crossing the road and respond synchronously and fast for both sides. The LED-based lights are so bright and are able to alert the driver and the other road user that there is a pedestrian that wants to cross the road. The cross-time programmed in the Arduino which is 30 seconds is proven to be suitable and sufficient for pedestrians to cross the road. Besides, The PIR sensor works successfully as an automatic pedestrian detection sensor.
Power analysis is an important aspect of testbed design. It allows us to determine the power consumption of the system. The power consumed by LED-based traffic lights is calculated. Each traffic light has 5 groups of LED lights, each of them consumed 10 mA of current and operating voltage of 12 V, the calculation of power consumption of LED-based traffic light and each side has always two lights works, one for cars and one for pedestrians. The total power consumption of LED-based lights for each side at a time is 240 mW compared to 200 watts in the conventional traffic bulbs (2 × 100 watt each bulb). Thus, the proposed system is  significant energy saving with less than 10 Wh daily energy consumption comparing with the conventional traffic light that usually consumed daily up to 4.8 kWh. The developed system also cost-effective and the total cost for materials purchasing and installation is less than 250 USD for the entire system of two units. One key objective of making cost analysis is to arrive at accurate cost estimates and schedules and to avoid cost overruns and schedule slips. Cost analysis goes beyond preparing cost estimates and schedules by helping manage resources and supporting assessment and decision making. Cost analysis is method that can be applied to provide feasibility of this project design. The average cost in constructing this system ranging between RM 900 to RM 1000 which depends on the availability of materials, local or imported of the materials as well as the postage materials itself. The cost of electrical component covered 50% of the total cost estimated.

VI. CONCLUSION
We have developed a portable, smart, and wireless-enabled traffic light system for the crosswalk. It is an efficiently functioning testbed to improve pedestrian safety and convenience by automating traffic light control based on the detection of pedestrians. This system helps pedestrians to cross the road safely without extra efforts to activate the walk signal. Besides, the cost of system installation and construction, needs for maintenance and energy efficiency of the system were among our main considerations. The system's Bluetooth enables the bidirectional communication between the traffic lights of both sides of the crossing road area. The portability nature of the system makes it easy to move and deployed in temporary locations like in universities and schools to help students at in/out times. The system testbed is able to save energy and deduct electricity bills by exploiting LEDs with rechargeable batteries. There are several limitations to this research that have found. One of them is the PIR sensor which has a very wide detection range which is 120 degree and distance of a minimum 3 m. Because of that, the PIR sensor will give a false signal because it can detect the presence of pedestrians at far from the traffic light. To solve this problem, the PIR sensor put inside a hole to narrowing the angle to 45 degree instead and reduce the distance of sensor detection. We suppose that the technical contributions of this paper will be valuable assets for the related applied researches on improving transportation infrastructure that involving pedestrians, particularly in the Smart City environment. A potential extension of the current study is to implement a solar cell to enhance system dependency on the rechargeable battery. The solar panel can provide energy to the system directly during day time and charging the battery to be used in the night time. The utilization of IoT and 5G communication networks in the future.to monitor such crosswalk systems will be helpful.