# Smart Roads for Autonomous Accident Detection and Warnings
## 4 Hardware and Experimental Setup
### Wiring Diagram of an AALS System Node  
The pinout connections shown in Figure 8 are used in this research. The HC-12 module has four pins: the VCC pin is connected to +5 V, the GND pin grounds the module, the  
Figure 7: (**a**) Two-channel relay module with pinouts [66]; (**b**) golden yellow light bulb and siren.  
RX pin connects to pin 5, and the TX pin connects to pin 2 of the Arduino Uno board through a breadboard. LCD 16X2 with the I2C module also has four pins where the VCC pin is connected to +5 V, the GND pin grounds the module, the SDA pin connects to analog pin A4, and the SCL pin connects to analog pin A5 through the breadboard. The IR obstacle module has three pins: the VCC pin connects to +5 V, the GND pin grounds the module, and last output pin is connected to analog input pin A0 through the breadboard. The microphone sensor module has four pins, with the VCC pin connected to +5 V, the GND pin grounding the sensor, digital output not connected to any pin, and the analog output pin connected to A1 of the Arduino Uno board through the breadboard. The smoke sensor module has four pins: the VCC pin is connected to +5 V, the GND pin grounds the module, digital output is not used, and the analog output pin connects to analog input A2 of the Arduino Uno board through the breadboard. The siren and golden yellow light are connected to the Arduino Uno board through a relay module that isolates the output of the Arduino from the high-powered output devices. The two-channel relay module has four input pins: the first is VCC (+5 V) and the second is GND (0 V), with the third and fourth pins being connected to pin 12 for the siren and digital pin 13 for the light, respectively. The relay module controls output devices that operate at 5 V; however, it can control ON or OFF voltages from 5 to 30 V from a DC supply and form 110 to 220 V from an AC supply. It connects a 12 V battery to the siren and light.  
In the AALS system, two HC-12 modules are used: one for transmitting messages and the other for receiving messages. The pin connections are such that for the HC-12 transmitter, the Tx pin is not connected, while the Rx pin is not connected for the HC-12 receiver module. This setting is made for one-way communication. If we use only one HC-12 module, then it sends and receives messages on the same channel; hence, the repeated message of the other node is received back in a loop. If a message is received in a loop, it results in a microcontroller being busy, and communication takes place all the time, which is not acceptable. Two HC-12 modules are used to minimize the risk of loopback communications and to ensure only event-driven communications.  
Figure 8: Wiring diagram for the AALS system node.  
The number of sensors deployed on a node is determined by the coverage area and distance. Because the IR sensor has a range of five meters, a node will require 10 IR obstacle sensors. If we replace the IR obstacle sensor with a TF mini IR time-of-flight distance sensor, the number of sensors required drops to four. The smoke sensor can detect smoke at a radius of 7.5 to 10 m (a diameter of 15 to 20 m); hence, three to four smoke sensors are mounted on a node [67]. Microphone sensors have an eight-meter coverage range; hence, six to seven microphone sensors are installed on each node. However, some directional microphones perform at up to 40 m; thus, two directional microphones are used in the proposed system. For a 50-m distance, one siren and one golden yellow light are required.