**5.1 Gear motor**

A DC motor can be defined as the rotary electric motor that converts direct current electrical energy into mechanical energy. The forces produced by magnetic fields mainly define its types. In order to change the direction of current, all types of DC motors have some internal mechanism, either electromechanical or electronic periodically.

In robotics, DC motors are most commonly used as it is available in a large variety of shapes and size with permanent magnet iron core, permanent magnet

**Figure 7.** *Gear motor.* *Vehicle Collision Avoidance System Using Li-Fi DOI: http://dx.doi.org/10.5772/intechopen.98616*

ironless rotor, permanent magnet brushless, wound field series connected, shunt connected, compound connected, variable reluctance stepper, permanent magnet stepper, and hybrid stepper motors (**Figure 7**).

The characterization of DC motor is based on brush type and brushless. It refers to the design of commutation used in motor, which converts direct current from the batteries into alternating current which are required to generate the action of motor. The brush type DC motors performs mechanically with brushes with the commutator segments at the ends of the rotating rotor physically slides against the stationary brushes that are connected to the terminals of the motor. In brushless motors, DC is converted to AC electronically with the position of sensors and microcontroller in the rotor; hence it does not require brushes [8]. A conventional DC motor is formed by an arrangement of coils and magnets that creates motion from electrical power [9].

#### **5.2 Push button switches**

Push button switches are small and sealed and the circuit gets completed by pressing it. If it is ON, a small metal spring inside makes contact with the two wires, passing the electricity to flow through the circuit. If it is OFF, means the spring retracts and the circuit is open, thus not allowing the current to flow through it. These buttons are made of hard material such as plastic or metal.

A simple Push Button switch is a type in which the switch consists of electric mechanism or air switch mechanism to turn ON or OFF. Based on the model of switch, the operations can be given as momentary or latching action function. The button is usually made of a strong durable material such as metal or plastic [9]. A push to make switch allows electricity to flow between its two contacts when held in. When the button is released, the circuit is broken. This type of switch is also known as a Normally Open (NO) Switch.

#### **5.3 Ultrasonic sensors**

An ultrasonic sensor is an instrument that uses ultrasonic sound waves to measure the distance of an object. It uses a transducer to send and receive the ultrasonic pulses that relay back information about an object's proximity. The distinct echo patterns are produced by the high-frequency sound waves reflected from boundaries.

The HC-SR04 Ultrasonic (US) sensor is a 4 pin module (Vcc, Trigger, Echo and Ground) respectively. This system has two features in the front which forms the Ultrasonic transmitter and Receiver. The sensor works based on the simple formula i.e. Distance = Speed × Time. The Ultrasonic transmitter transmits an ultrasonic wave, this wave travels in air and when it gets objected by any material it gets reflected back toward the sensor this reflected wave is observed by the Ultrasonic receiver module. HC-SR04 distance sensor is commonly used with both microcontroller and microprocessor platforms like Arduino, ARM, PIC, Raspberry Pie etc. The following guide is universally since it has to be followed irrespective of the type of computational device used. Power the Sensor using a regulated +5 V through the Vcc ad Ground pins of the sensor. The current consumed by the sensor is less than 15 mA and hence can be directly.

It is powered by 5 V pins and the Trigger and the Echo pins are both I/O pins. It can be connected to I/O pins of the microcontroller and to measure the trigger pin has to be made high for 10uS before turning off. This function instantly triggers an ultrasonic wave at a frequency of 40 Hz from the transmitter. At the same time, the receiver had to wait for the signal to return [10]. The wave is returned after it

#### *IoT Applications Computing*

is reflected by any object; here the echo pin will be high for a particular amount of time, which is equal to the time taken for the signal to return back to the sensor. Hence, the amount of time during the high position of Echo is measured by the MCU/MPU. It gives the measured value for the time taken by the wave to return back. Using this values the distance is measured as explained above.

The ultrasonic Sensors are efficiently used in the non-contact detection of Level, Position, and Distance. These non-contact sensors are also called as proximity sensors. It is also independent to light, smoke, dust and color. The material absorbs the ultrasonic sound wave and does not reflect sound except wool.
