SMART VEHICLE BRAKING SYSTEM PROJECT REPORT Project submitted in partial fulfilment of the requirements of the degree BACHELOR OF TECHNOLOGY IN ELECTRONICS AND COMMUNICATION ENGINEERING Submitted by B.V.Bhavana(O162081) Under the supervision of Mr. Prabhu Kiran (Asst. Professor) Dept. of Electronics and Communication Engineering RAJIV GANDHI UNIVERSITY OF KNOWLEDGE TECHNOLOGIES,ONGOLE CAMPUS, April,2022 i RAJIV GANDHI UNIVERSITY OF KNOWLEDGE TECHNOLOGIES DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING CERTIFICATE This is to certify that the project report entitled “SMART VEHICLE BRAKING SYSTEM” submitted by , Roll No: Bhavana B.V, Roll No: O162081 to the Department of Computer Science and Engineering, Rajiv Gandhi University of Knowledge Technologies , RGUKT Ongole Campus, during the academic year 2021-2022 is a partial fulfillment for the award of Under graduate degree of Bachelor of Technology in Electronics and Communication Engineering, is a bonafide record carried out by her under my supervision. The project has fulfilled all the requirements as per as regulations of this institute and in my opinion reached the standard for submission. Mr. K V Sri Harsha Mr. Prabhu Kiran Head of the Department Assistant Professor Dept. of ECE Dept. of ECE RGUKT Ongole, RGUKT Ongole, Ongole – 523001. Ongole – 523001. Date: Place: Ongole ii APPROVAL SHEET This project report entitled “Smart Vehicle Braking System” by ___________________________ is approved for the degree of ___________________________. Examiners ___________________________ ___________________________ ___________________________ Supervisor(s) ___________________________ ___________________________ ___________________________ Chairman ___________________________ Place: Date: iii DECLARATION I declare that this written submission represents my ideas in my own words and where others' ideas or words have been included, I have adequately cited and referenced the original sources. I also declare that I have adhered to all principles of academic honesty and integrity and have not misrepresented or fabricated or falsified any idea/data/fact/source in my submission. I understand that any violation of the above will be cause for disciplinary action by the Institute and can also evoke penal action from the sources which have thus not been properly cited or from whom proper permission has not been taken when needed. Signature ___________________________ Name of the Student ___________________________ Roll No. ___________________________ iv Abstract Driving is a common activity for most of the people. The number of vehicles is increasing day by day. Now a days, the technology has got vast changes which leads increase in speed. The speed plays a vital role to maintain time for longer distances. But, this speed also getting a major problem for causes of road accidents.The common braking is not sufficient for avoidance of accidents when driver is not active. Further improvement has to done in braking system in order to brake a vehicle when driver is not able to brake i.e., it may needs automatic braking system. This automatic braking system allows the vehicle to brake without support of the driver. This project is designed with ultrasonic sensor,Arduino UNO R3 board with PIC microcontroller, DC gear motor and Buzzer. The Ultrasonic Sensor generates a signal with particular frequency.It is transmitted through ultrasonic transmitter. The ultrasonic receiver is used to receive the reflected wave present in front of the vehicle, then the reflected waves is given to the ultrasonic wave generator unit in which the incoming wave is amplified and compared with reference signals to maintain a constant ratio and this signal is given to microcontroller and through which the working of DC gear motor takes place, which results in application of brakes. v INDEX Table of Contents Page number Abstract 3 1. Introduction 5-6 2.Review of Literature 8 3.Materials and methodology 9-34 3.1 Approach and Block Diagram 10-11 3.2 Arduino UNO 11-14 3.3 Ultrasonic Sensor 15-18 3.4 Buzzer 19-21 3.5 DC Gear Motor 22-26 3.6 L293D Motor Driver IC 27-31 3.7 Circuit diagram & Connections 32-33 3.8 Code Implementation 34-35 3.9 Working 36 3.10 Advantages 37 4.Results and Discussions 38-42 4.1 Simulation Result 39-42 5.Summary and Conclusions 43-44 5.1 Conclusion 44 5.2 Future Scope 44 5.3 References 45 6.Appendix 46-48 6.1 Appendix-I 47 6.2 Appendix - II 48 vi LIST OF FIGURES Fig1.1. Smart Vehicle Braking System PageNo:7 Fig3.2. Block Diagram PageNo:10 Fig3.2.1 Arduino UNO PageNo:11 Fig3.2.2 Schematic Diagram PageNo:13 Fig3.3.1 Ultrasonic Sensor PageNo:15 Fig3.3.2 Detection of object through ultrasonic waves PageNo:16 Fig3.3.3 Calculation of Distance PageNo:17 Fig3.4.1 Buzzer PageNo:19 Fig3.4.2 Circuit Diagram of Buzzer PageNo:20 Fig3.5.1 DC Motor PageNo:22 Fig3.5.2 Specifications of DC Motor PageNo:22 Fig3.5.3 DC Gear Motor PageNo:23 Fig3.5.4 Movement of Wheel based on motor PageNo:26 Fig3.6.1 Pin Diagram PageNo:27 Fig3.6.2 Duty Cycle PageNo:28 Fig3.7.1 Circuit Diagram PageNo:29 Fig3.7.2 Hardware Connections PageNo:30 Fig4.1.1 Stimulation Circuit PageNo:36 Fig4.1.2 Output(Case-1) PageNo:37 Fig4.1.3 Output(Case-2) PageNo:38 Fig4.1.4 Output(Case-3) PageNo:39 vii CHAPTER 1 INTRODUCTION 1 1. Introduction: When compared with olden days life span of human is reduced. Death rate due to accident is drastically increased because vehicles usage is increasing by day byday. Due to brake failure so many accidents are occurring so when we control the brake by automatically we can reduce the effect of accident The main target of the ultrasonic braking system is that, vehicles should automatically brake when the sensors sense the obstacle. This is a technology for automobiles to sense an imminent forward collision with another vehicle or an obstacle, and to brake the vehicle accordingly, which is done by the braking circuit. This system includes two ultrasonic sensors viz. ultrasonic wave emitter and ultrasonic wave receiver. The ultrasonic wave emitter provided in front portion of an automatic braking system vehicle, producing and emitting ultrasonic waves in a predetermined distance in front of the vehicle. Ultrasonic wave receiver is also provided in front portion of the vehicle, receiving the reflected ultrasonic wave signal from the obstacle. The reflected wave (detection pulse) is measured to get the distance between vehicle and the obstacle. The DC gear motor is connected to the wheels of vehicle and power input is given to it from Arduino board. Then microcontroller is used to control the Dc motor based on detection pulse information and the motor in turn automatically controls the braking of the vehicle. Thus, this new system is designed to solve the problem where drivers may not be able to brake manually exactly at the required time, but the vehicle can stop automatically by sensing the obstacles to avoid an accident. 2 Fig 1.1 Smart vehicle braking system 3 CHAPTER – 2 REVIEW OF LITERATURE 4 REVIEW OF LITERATURE We have used the word Target detection in our project. Generally, we use such words in military applications. But here in our project, this word plays a crucial role. Target detection is the word which means identifying a target in regular use. Here, in our project the main concern is about avoiding the accidents by calculating the distance from nearest objects/vehicles. So, in order to detect an obstacle/object/vehicle we can use many sensors and components. But we used Ultrasonic Sensor which identifies any object by sending and receiving ultrasonic waves. Ultrasonic sensor generally consists of a transmitter and receiver .The transmitter part transmits ultrasonic sonic waves. Later,the receiver receives the ultrasonic signal.The sensor analyzes the received signal and by comparing the transmitted and received signal,it identifies whether it has touched any obstacle/vehicle/object in the mean while.If any thing is being identified,it calculates the distance from the sensor to where it is situated.In this way,it identifies the target and also calculates the distance between them and gives us the output on the arduino Screen. Another important term used is speed controlling. Based on the distance calculated above, the device needs to control its speed in order to obtain the proper output.We are using a motor driver to control the speed of the motor.Generally, a motor can turned on or off with the help of a relay.But,here as we have to obtain many things like reducing the speed,making the speed zero by automatically applying the breaks.The speed needs not be changed if the object/vehicle is situated far away.This motor driver based on the distance measured controls the speed of the motor. 5 CHAPTER 3 MATERIAS AND METHODOLOGY 6 3.1. Approach: First of all, We need to interface ultrasonic sensor and other components with the microcontroller(Arduino). So that the microcontroller can control the devices.Initially we have to set the instructions for the microcontroller regarding the readings of different sensor in order to control the DC gear motor . The Ultrasonic Sensor generates a signal with particular frequency.It is transmitted through ultrasonic transmitter. The ultrasonic receiver is used to receive the reflected wave present in front of the vehicle, then the reflected waves is given to the ultrasonic wave generator unit in which the incoming wave is amplified and compared with reference signals to maintain a constant ratio and this signal is given to microcontroller and through which the working of DC gear motor will takes place, which results in application of brakes and controlling of speed. Block Diagram : Fig 3.1.1 Block diagram 7 Hardware Components : Arduino UNO Ultrasonic Sensor Buzzer Dc motor L293D Motor Driver IC 3.2 Arduino UNO: Arduino is an open-source platform used for building electronics projects. Arduino consists of both a physical programmable circuit board (often referred to as a microcontroller) and a piece of software, or IDE (Integrated Development Environment) that runs on your computer, used to write and upload computer code to the physical board. The Arduino platform has become quite popular with people just starting out with electronics, and for good reason. Unlike most previous programmable circuit boards, the Arduino does not need a separate piece of hardware (called a programmer) in order to load new code onto the board – you can simply use a USB cable. Additionally, the Arduino IDE uses a simplified version of C++, making it easier to learn to program. Finally, Arduino provides a standard form factor that breaks out the functions of the micro-controller into a more accessible package. Fig 3.2.1 Arduino UNO 8 The Arduino Uno is a microcontroller board based on the ATmega328. It has 20 digital input/output pins (of which 6 can be used as PWM outputs and 6 can be used as analog inputs), a 16 MHz resonator, a USB connection, a power jack, an in-circuit system programming (ICSP) header, and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer (or appropriate wall power adapter) with a USB cable or power it with a AC-to-DC adapter or battery to get started. Arduino is a prototype platform (open-source) based on an easy-to-use hardware and software. It consists of a circuit board, which can be programed (referred to as a microcontroller) and a ready-made software called Arduino IDE (Integrated Development Environment), which is used to write and upload the computer code to the physical board. The key features are: Arduino boards are able to read analog or digital input signals from different sensors and turn it into an output such as activating a motor, turning LED on/off, connect to the cloud and many other actions. You can control your board functions by sending a set of instructions to the microcontroller on the board via Arduino IDE (referred to as uploading software). Unlike most previous programmable circuit boards, Arduino does not need an extra piece of hardware (called a programmer) in order to load a new code onto the board. You can simply use a USB cable. Additionally, the Arduino IDE uses a simplified version of C++, making it easier to learn to program. Finally, Arduino provides a standard form factor that breaks the functions of the micro-controller into a more accessible package. 9 Fig 3.2.2 Schematic Diagram Pin Description of Arduino UNO :The Uno is a microcontroller board based on the ATmega328P. It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header and a reset button. Each of the 14 digital pins can be used as an input or output, using pin Mode(), digital Write (), and digital Read () functions. They operate at 5 volts. Each pin can provide or receive 20 mA as recommended operating condition and has an internal pull-up resistor (disconnected by default) of 2050k ohm. A maximum of 40mA is the value that must not be exceeded on any I/O pin to avoid permanent damage to the microcontroller.In addition, some pins have specialized functions: 10 • Serial: 0(RX) and 1(TX). Used to receive (RX) and Transmit (TX) TTL serial data. • External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. • PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analog Write() function. • SPI: 10(SS), 11(MOSI), 12(MISO), 13(SCK). These pins support SPI communication using the SPI library. • • LED: 13. There is a built-in LED driven by digital pin 13. TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the wire library. The UNO has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of resolution. By default they measure from ground to 5 volts, through is it possible to change the upper end of their range using the AREF pin and the analog Reference () function. There are a couple of other pins on the board. • AREF Reference voltage for the analog inputs. Used with analog Reference. • Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset button to shields which block the one on the board. Arduino UNO board is used in the following applications ● Weighing Machines. ● Traffic Light Count Down Timer. ● Parking Lot Counter. ● Embedded systems. ● Home Automation. ● Industrial Automation. ● Medical Instrument. ● Emergency Light for Railways 11 3.3. UltraSonic Sensor: Ultrasonic ranging and detecting devices use high-frequency sound waves to detect the presence of an object and its range. The systems either measure the echo reflection of the sound from objects or detect the interruption of the sound beam as the objects pass between the transmitter and receiver. Fig 3.3.1 UltraSonic Sensor ULTRASONIC SENSOR An ultrasonic sensor typically utilizes a transducer that produces an electrical output in response to received ultrasonic energy. The normal frequency range for human hearing is roughly 20 to 20,000 hertz. Ultrasonic sound waves are soundwaves that are above the range of human hearing and thus, have a frequency above about 20,000 hertz. Any frequency above 20,000 hertz may be considered ultrasonic. Most industrial processes, including almost all source of friction, create some ultrasonic noise. The ultrasonic transducer produces ultrasonic signals. These signals are propagated through a sensing medium and the same transducer can be used to detect returning signals. Ultrasonic sensors typically have a piezoelectric ceramic transducer that converts an excitation electrical signal into ultrasonic energy bursts. The energy bursts 12 travel from the ultrasonic sensor, bounce off objects, and are returned toward the sensor as echoes. Transducers are devices that convert electrical energy to mechanical energy, or vice versa. The transducer converts received echoes into Analog electrical signals that are output from the transducer. Fig 3.3.2 Detection of object through ultrasonic waves Ultrasonic sensing and control: Ultrasonic signals are like audible sound waves, except the frequencies are much higher. Our ultrasonic transducers have piezoelectric crystals which resonate to a desired frequency and convert electric energy into acoustic energy and vice versa. The illustration shows how sound waves, transmitted in the shape of a cone, are reflected from a target back to the transducer. An output signal is produced to perform some kind of indicating or control function. A minimum distance from the sensor is required to provide a time delay so that the "echoes" can be interpreted. Variables which can affect the operation of ultrasonic sensing include, target surface angle, reflective surface roughness or changes in temperature or humidity. The targets can have any kind of reflective form - even round objects. Calculation of distance in Cm: Sound travels at approximately 340 meters per second. This corresponds to about 29.412µs (microseconds) per centimeter. To measure the distance the sound has travelled we use the formula: Distance = (Time x 13 SpeedOfSound) / 2. The "2" is in the formula because the sound has to travel back and forth. First the sound travels away from the sensor, and then it bounces off of a surface and returns back. The easy way to read the distance as centimeters is to use the formula: Centimeters = ((Microseconds / 2) / 29). For example, if it takes 100µs (microseconds) for the ultrasonic sound to bounce back, then the distance is ((100 / 2) / 29) centimeters or about 1.7 centimeters. Fig 3.3.3 Calculation of Distance Pin Description :It consists of 4 pins. • VCC - The Vcc pin powers the sensor, typically with +5V • GND - This pin is connected to the Ground of the system. • Echo - Echo pin is an Output pin. This pin goes high for a period of time which will be equal to the time taken for the US wave to return back to the sensor. • Trigger - Trigger pin is an Input pin. This pin has to be kept high for 10us to initialize measurement by sending us wave. 14 HC-SR04 Sensor Features:• Operating voltage: +5V • Theoretical Measuring Distance: 2cm to 450cm • Practical Measuring Distance: 2cm to 80cm • Accuracy: 3mm • Measuring angle covered: <15° • Operating Current: <15mA • Operating Frequency: 40Hz Advantages of Ultrasonic Sensors:• Not affected by color or transparency of Objects • Can be used in dark environments • Low-cost option • Not affected by dust and High-Moisture Environments • Ultrasonic sensors are easy to use and not dangerous to nearby peoples, objects or equipment • Ultrasonic Sensors easily interface with microcontrollers or any type of controller Applications of Ultrasonic Sensors: - ● Roll diameter, tension control, winding and unwind ● Liquid level control ● Through beam detection for high-speed counting ● Full detection ● Thread or wire break detection ● Stacking height control ● 45° Deflection; inkwell level detection; hard to get at places ● People detection for counting ● Contouring or profiling using ultrasonic systems 15 ● Irregular parts detection for hoppers and feeder bowls ● Presence detection ● Box sorting using multi-transducer ultrasonic monitoring system. ● Robotic sensing 3.4 Buzzer: An audio signaling device like a beeper or buzzer may be electromechanical or piezoelectric or mechanical type. The main function of this is to convert the signal from audio to sound. Generally, it is powered through DC voltage and used in timers, alarm devices, printers, alarms, computers, etc. Based on the various designs, it can generate different sounds like alarm, music, bell & siren Fig 3.4.1 Buzzer The pin configuration of the buzzer is shown below. It includes two pins namely positive and negative. The positive terminal of this is represented with the ‘+’ symbol or a longer terminal. This terminal is powered through 6Volts whereas the negative terminal is represented with the ‘-‘symbol or short terminal and it is connected to the GND terminal. A buzzer is an efficient component to include the features of sound in our system or project. It is an extremely small & solid two-pin device thus it can be simply utilized on breadboard or PCB. So in most applications, this component is widely used. 16 There are two kinds of buzzers commonly available like simple and readymade. Once a simple type is powerdriven then it will generate a beep sound continuously. A readymade type looks heavier & generates a Beep. Beep. Beep. This sound is because of the internal oscillating circuit within it. This buzzer uses a DC power supply that ranges from 4V – 9V. To operate this, a 9V battery is used but it is suggested to utilize a regulated +5V/+6V DC supply. Generally, it is connected through a switching circuit to switch ON/OFF the buzzer at the necessary time interval. Buzzer Circuit Diagram:- The circuit diagram of the water level indicator using the buzzer is shown below. This circuit is used to sense or detect the water level within the tank or washing machine or pool, etc. This circuit is very simple to design using few components such as a transistor, buzzer, 300K variable resistor, and power supply or 9V battery. Fig 3.4.2 Circuit diagram of buzzer Once the two probes of the circuit are placed in the tank, it detects the level of water. Once the water level exceeds the fixed level, then it generates a beep sound through a buzzer connected to the circuit. This circuit uses a BC547B NPN transistor owever we can also use any general-purpose transistor instead of using 2N3904/2N2222. This water level sensor circuit working is very simple and the transistor used within the circuit works as a switch. Once the two probes notice the water level within the tank, then the transistor turns ON & the voltage begins flowing throughout the transistor to trigger the buzzer 17 There are many ways to communicate between the user and a product. One of the best ways is audio communication using a buzzer IC. So during the design process, understanding some technologies with configurations is very helpful. So, this article discusses an overview of an audio signaling device like a beeper or a buzzer and its working with applications. Specifications:The specifications of the buzzer include the following. Color is black The frequency range is 3,300Hz Operating Temperature ranges from – 20° C to +60°C Operating voltage ranges from 3V to 24V DC The sound pressure level is 85dBA or 10cm The supply current is below 15mA Applications:The applications of the buzzer include the following. Communication Devices Electronics used in Automobiles Alarm Circuits Portable Devices Security Systems Timers Household Appliances Electronic Metronomes Sporting Events Annunciator Panels Game Shows 18 3.5 DC Gear Motor: DC geared motors are essentially a DC shunt motor which has been specially designed for low inertia, symmetrical rotation and smooth low-speed characteristics. Geared motor is a motor with a closed feedback system in which the position of the motor will be communicated back to the control circuit in the motors. Geared motors are formed from four different elements: a DC motor, a position-sensing device (a potentiometer), a gear reducing part and a control unit. All of these components work together to make the motor to accept control signals that represent the desired output of the motor shaft and power the DC motor until its shaft is turned to the right position. The shaft in geared motors doesn’t rotate as freely as those in regular DC motors; it is only able to rotate around 200 degrees in both directions. The position- sensing device in a geared motor determines the rotation of the shaft and thus the way he motor needs to turn in order to arrive at the desired position. The sliding mode control is robust to plant uncertainties and insensitive to external disturbances. It is commonly used to get good dynamic performance of controllable systems. Even then, the chattering phenomena due to the finite speed of the switching devices can affect the system behaviour significantly. Besides, the sliding control needs the knowledge of mathematical model of the system with bounded uncertainties. Reduced chattering may be achieved without sacrificing robust performance by combining the attractive Fig:- 3.5.1 DC Motor Specifications of DC gear Motor DC Gear Motor 19 Fig : 3.5.2 Specifications of DC Motor DC Motor: A direct current (DC) motor is a type of electric machine that converts electrical energy into mechanical energy. DC motors take electrical power through direct current, and convert this energy into mechanical rotation. ‘ DC motors use magnetic fields that occur from the electrical currents generated, which powers the movement of a rotor fixed within the output shaft. The output torque and speed depends upon both the electrical input and the design of the motor. DC motors utilise magnetic fields to process electrical energy into mechanical energy, and by using brushless motors, DC motor ceiling fans can be operated from standard household AC electricity. The only real downside to the DC motor fan is its cost, but the energy savings easily offset this. Although fans traditionally use AC motors, there are an increasing number of DC motor ceiling fans hitting the market. These fans are gaining in popularity as they are far more economical than their AC equivalent, thanks to the way in which they operate. 20 Fig 3.5.3 DC Gear Motor Application of DC Series motor DC series motor is suitable for both high and low power drives, for fixed and variable speed electric drives. This type of motor has simple construction. Also, it is easy for design and maintenance. Because of its high starting torque, this motor uses in the cheap toys and automotive applications such as, •Cranes •Air compressor •Lifts •Elevators •Winching system •Electric traction •Hair drier •Vacuum cleaner and in speed regulation application •power tools •Sewing machine •Electric footing Application of DC Shunt motor We all know that Dc shunt motor provides the constant speed. This type of motor mostly uses in the constant speed application from no load to full load. The applications are, •Wiper 21 •Automatic windscreen •Drills •Conveyors •Fans •Boring mills •Shapers •Blowers •Spinning and weighing machine •Centrifugal pumps Application of Permanent Magnet DC motor The permanent magnet DC motor is the special type of motor where we use a permanent magnet to create the required magnetic field. As this motor does not need to control the speed, it uses in the applications like, •Washer •Windshield wiper •Automobiles as a starter motor •Personal computer disc drives •Toys •Wheelchairs •Blowers in heater and air conditioners. Application of Compound DC motor As we discussed, there are two types of Compound DC motor. One is Differential and other is Cumulative compound motor. The differential compound motor has poor torque characteristics because the motor increases the speed with increase in load. so this motor is not suitable for any practical application. On the other hand, the cumulative compound motor has high starting torque characteristic. Also, it has good speed regulation at high speed so it uses in, •Presses •Electric shovels •Reciprocating machine •Conveyors •Stamping machine 22 •Elevators •Compressors •Rolling mills •Heavy planners Application of Brushless DC motor As the brushless motor does not have any brushes, it has high efficiency, high speed and electronic control. Mostly this motor uses in the, •Hand held power tools •Consumer electronics •Heating and ventilation •for small cooling fans •Transport •Vehicles ranging from aircrafts to automobiles •For gramophone record in direct drive turntables •In computer peripherals like disk drives, printers etc Fig 3.5.4 Movement of wheel based on motor 3.6 L293D Motor Driver IC : The L293D is a popular 16-Pin Motor Driver IC. As the name suggests it is mainly used to drive motors. A single L293D IC is capable of running two DC motors at the same time; also the direction of these two motors can be controlled independently. So if you have motors which has operating voltage less than 36V and operating 23 current less than 600mA, which are to be controlled by digital circuits like Op-Amp, 555 timers,digital gates or even Micron rollers like Arduino, PIC, ARM etc.. this IC will be the right choice for you. Fig : 3.6.1 Pin diagram Working of L293D : There are 4 input pins for l293d, pin 2,7 on the left and pin 15 ,10 on the right as shown on the pin diagram. Left input pins will regulate the rotation of motor connected across left side and right input for motor on the right hand side. The motors are rotated on the basis of the inputs provided across the input pins as LOGIC 0 or LOGIC 1. In simple you need to provide Logic 0 or 1 across the input pins for rotating the motor. PWM – For controlling speed : The speed of a DC motor can be controlled by varying its input voltage. A common technique for doing this is to use PWM (Pulse Width Modulation) PWM is a technique where average value of the input voltage is adjusted by sending a series of ON-OFF pulses. The average voltage is proportional to the width of the pulses known as Duty Cycle. 24 The higher the duty cycle, the greater the average voltage being applied to the dc motor(High Speed) and the lower the duty cycle, the less the average voltage being applied to the dc motor(Low Speed). Fig : 3.6.2 Duty Cycle Software used: Arduino IDE:The Arduino IDE is an open-source software, which is used to write and upload code to the Arduino boards. The IDE application is suitable for different operating systems such as Windows, Mac OS X, and Linux. It supports the programming languages C and C++. Here, IDE stands for Integrated Development Environment. 25 The program or code written in the Arduino IDE is often called as sketching. We need to connect the Genuino and Arduino board with the IDE to upload the sketch written in the Arduino IDE software. The sketch is saved with the extension '.ino.' The Arduino IDE will appear as: Arduino IDE Let's discuss each section of the Arduino IDE display in detail. Toolbar Button The icons displayed on the toolbar are New, Open, Save, Upload, and Verify. It is shown below: Arduino IDE Upload The Upload button compiles and runs our code written on the screen. It further uploads the code to the connected board. Before uploading the sketch, we need to make sure that the correct board and ports are selected. We also need a USB connection to connect the board and the computer. Once all the above measures are done, click on the Upload button present on the toolbar. The latest Arduino boards can be reset automatically before beginning with Upload. In the older boards, we need to press the Reset button present on it. As soon as the uploading is done successfully, we can notice the blink of the Tx and Rx LED. If the uploading is failed, it will display the message in the error window. We do not require any additional hardware to upload our sketch using the Arduino Bootloader. A Bootloader is defined as a small program, which is loaded in the microcontroller present on the board. The LED will blink on PIN 13. Open The Open button is used to open the already created file. The selected file will be opened in the current window. 26 Save The save button is used to save the current sketch or code. New It is used to create a new sketch or opens a new window. Verify The Verify button is used to check the compilation error of the sketch or the written code. Serial Monitor The serial monitor button is present on the right corner of the toolbar. It opens the serial monitor. It is shown below: Arduino IDE When we connect the serial monitor, the board will reset on the operating system Windows, Linux, and Mac OS X. If we want to process the control characters in our sketch, we need to use an external terminal program. The terminal program should be connected to the COM port, which will be assigned when we connect the board to the computer. Menu Bar File When we click on the File button on the Menu bar, a drop-down list will appear. It is shown below: Arduino IDE Let's discuss each option in detail. New The New button opens the new window. It does not remove the sketch which is already present. Open 27 It allows opening the sketch, which can be browsed from the folders and computer drivers. Open Recent The Open Recent button contains the list of the recent sketches. Sketchbook It stores the current sketches created in the Arduino IDE software. It opens the selected sketch or code in a new editor at an instance. Fig 3.6.3 Arduino IDE 28 3.7 Circuit Diagram: Fig 3.7.1 Circuit Diagram 29 Hardware Connections: 1.Connect Ground and VCC pins of ultrasonic sensor to the Ground and 5v pins of Arduino respectively. 2. Connect echo(input) pin of ultrasonic to the digital pin 7 of arduino. 3.Connect ground of buzzer to the ground of arduino. 4.Connect the buzzer positive terminal to the digital pin 13 of arduino. 5.Connect the enable pin of L293d driver to the digital pin 3 of Arduino. 6. Connect the motor driver input pins in1 and in2 to the Arduino digital pins 4 and 5 respectively. 7. Connect the supply voltage pin of motor driver to the 5v pin of arduino. 8.Connect the ground pins of motor driver to the ground pin of Arduino. 9..Connect the one output pin of motor driver Ic to the positive terminal of motor and the second negative terminal . Fig 3.7.2 Hardware Connections 30 pin to the 3.8 Code Implementation : Ardunio IDE code: //Initializing the datatypes of variables long distance=0; int echo = 7; int buzz = 13; int EnableA= 3; void setup() { //setting up the pin modes pinMode(9,OUTPUT); pinMode(buzz,OUTPUT); pinMode(EnableA,3); } void loop() { long duartion; pinMode(echo, OUTPUT); digitalWrite(echo, LOW); delayMicroseconds(2); digitalWrite(echo, HIGH); 31 delayMicroseconds(5); digitalWrite(echo, LOW); pinMode(echo,INPUT); duration=pulseIn(echo, HIGH); distance=(duration/29)/2 Serial.println(); Serial.println(distance); delay(100); if(distance<70) { analogWrite(EnableA,0); digitalWrite(4,LOW); digitalWrite(5,LOW); digitalWrite(13,HIGH); } else if(distance>70 && distance<100) { analogWrite(EnableA,64); digitalWrite(4,HIGH); digitalWrite(5,LOW); digitalWrite(13,LOW); } else if(distance>100 && distance<150){ analogWrite(EnableA,255); digitalWrite(4,HIGH); 32 digitalWrite(5,LOW); digitalWrite(13,LOW); } } 3.9 Working : The Ultrasonic Sensor generates a signal with particular frequency.It is transmitted through ultrasonic transmitter. The ultrasonic receiver is used to receive the reflected wave present in front of the vehicle, then the reflected waves is given to the ultrasonic wave generator unit in which the incoming wave is amplified and compared with reference signals to maintain a constant ratio and this signal is given to microcontroller and through which the working of DC gear motor will takes place, which results in application of brakes and controlling of speed.When the distance is less than 70cm .The motor speed will become zero(Brakes will be applied so that vehicle will be stopped).The buzzer will show indication by making some sound.When the distance is greater than 70cm and less than 150cm ,then the motor will run with slow speed(speed of the vehicle will be reduced as the distance decreases).When the distance is more than 100cm,then the motor will run with normal speed(The vehicle will maintain its constant speed when the distance between the other vehicles is more than minimum distance.) We have made this to reduce accident rates and to make driving safe.The complete project is based in the working of ultrasonic sensor.Ultra sonic sensor basically works on sensing of the objects through ultra sonic radiation.The main use of this sensor is to calculate the distance.UltraSonic transmitter transmits Ultraviolet radiation and it travells and again the ultrasonic sensor 33 3.10 Advantages : ● The technology minimises risk of your wheels getting locked up and preventing your vehicle from skidding,particularly in slippery conditions. ● It helps drivers to maintain control and steer the vehicle to avoid an accident. ● It can stop the vehicle at a shorter distance than the normal brakes,giving the driver better control in potentially dangerous scenarios,The system also helps avoid uneven tyre wear by preventing the wheels from locking up. ● Drivers whose cars are equipped with an automatic braking system don’t drive thier cars any differently than any other car.It is there,but it doesnt bother the driver, and if it comes down to it,it doesn’t even need driver’s input to react. ● Sadly,only about 40% of driverw react appropriatlely and hit the brakes in crashes. ● It is important to note that the driver “still has the abolity to either push the brake or swerve around. ● “We want to keep the decision to the driver.But only if the driver doesn’t react at all,the final action is autonomous braking”. ● When it comes to driver’s “sins”,such as distracted driving,inattentiveness,sleepiness,lack of full concentration or using a mobile phone while driving,and even poor driving conditions,visiblity and road surface problems, an automatic braking system can not only help reduce property damage in case of an accident,but more importalnly , save lives. ● The great safety net most of the drivers will probably never use still,it is a comfort for drivers for all drivers to know that even if they fail in protecting themselves,theor vehicle won’t. ● Automatic braking systems play a huge role in preventing those crashes.Their primarly use in precrash and collision avoidance systems, and adaptive cruise control. As we are having many advantages as mentioned above,we have done this project to reduce the accident rates and to save the lives of people.In the growing world,because of increase in population,the usage of vehicles has been increased rapildy.Almost,every home will have one or two vehicles.Due to which traffic is being increased .So,the drivers are loosing patience and are being careless. During night times,the one who drives may fall asleep or might be in a situation where he can’t control the vehicle.In all such cases,accidents occur and many people will loose their lives.So,in order to avoid these accidents and to protect the lives of people,we have implemented this project. 34 CHAPTER 4 RESULTS AND DISCUSSION 35 4.1 Simulation Results:- Fig 4.1.1 Simulation circuit We have simulated this circuit with the help of tinker cad. Tinkercad is a free-of-charge, online 3D modeling program that runs in a web browser.Since it became available in 2011 it has become a popular platform for creating models for 3D printing as well as an entry-level introduction to constructive solid geometry in schools 36 Tinkercad uses a simplified constructive solid geometry method of constructing models. A design is made up of primitive shapes that are either "solid" or "hole". Combining solids and holes together, new shapes can be created, which in turn can be assigned the property of solid or hole.In addition to the standard library of primitive shapes, a user can create custom shape generators using a built-in JavaScript editor. Shapes can be imported in three formats: STL and OBJ for 3D, and 2-dimensional SVG shapes for extruding into 3D shapes. Tinkercad exports models in STL or OBJ formats, ready for 3D printing. Tinkercad also includes a feature to export 3D models to Minecraft Java Edition, and also offers the ability to design structures using Lego bricks. When the distance is less than 70cm .The motor speed will become zero(Brakes will be applied so that vehicle will be stopped).The buzzer will show indication by making some sound. Fig 4.1.2 Output (Case -1) 37 When the distance is greater than 70cm and less than 150cm ,then the motor will run with slow speed(speed of the vehicle will be reduced as the distance decreases). Fig 4.1.3 Output(Case -2) When the distance is more than 100cm,then the motor will run with normal speed(The vehicle will maintain its constant speed when the distance between the other vehicles is more than minimum distance.). 38 Fig: 4.1.4 Output(Case 3) The above three mentioned are the three sample cases to explain the boundaries of the project. It clearly explains how the sensor detects the object,calculates the distance and based on that how will the motor react is the major consideration. So,based on the distance limits set by us ,the motor will act accordingly. Here,the safety distance has been set to 70 cm. So,if any object is identified with an distance of 70 cm,the device will apply the breaks automatically and the motor speed will be reduced to zero.It also alerts the people by using buzzer. If the object is in between 70-100 cm,it reduces the speed of the vehicle by using motor driver If the object is in a distance which is greater than 10 cm,there will be no change in the motor driver and circuit. 39 CHAPTER – 5 SUMMARY AND CONCLUSIONS 40 5.1 Conclusion : We have been working on the fabrication of automatic braking system model prototype and this project presents the implementation of an Smart Braking System for Forward Collision Avoidance, intended to use in vehicles where the drivers may not brake manually, but the speed of the vehicle can be reduced automatically due to the sensing of the obstacles. It reduces the accident levels and tends to save the lives of so many people. By doing this project practically we gained the knowledge about working of automatic braking system and with this future study and research, we hope to develop the system into an even more advanced speed control system for automobile safety, while realizing that this certainly requires tons of work and learning, like the programming and operation of microcontrollers and the automobile structure. Hence we believe that the incorporation of all components in Smart Braking System will maximize safety and also give such system a bigger market space and a competitive edge in the market. 5.2 Future Scope: The future scope is to design and develop a control system based on an automotive braking system is called “Smart vehicle Braking System”. The Automatic Braking System with ultrasonic sensor would alert the driver when the distance between vehicle and obstacle is in within the sensing range zone then the brakes are applied. This is the new function in this prototype design that could be possibly used for all the vehicles. By making it safer, this system will provide better guarantee for vehicle’s safety and avoid losses. Therefore, the safety system of vehicles will be developed and may have more market demands. It can be further used for large type of heavy vehicles like buses, trucks, cranes, tractors, etc. We can surely get the information about the obstacle detection sense zone according to vehicle condition. It is verily useful to public sector and users. It is also avoids the accidents in large or metropolitan cities. So we feel it is a better idea for automatically braking of vehicle with moderate cost. 41 5.3 References : [1]. https://ijisrt.com/wp-content/uploads/2017/05/Automatic-Braking-System-Using-Ultrasonic-Sensor.pdf [2]. https://www.arduino.cc/ [3]. Arduino : https://en.wikipedia.org/wiki/Arduino [4]. Ultrasonic Sensor: https://learn.adafruit.com/ultrasonic-sonar-distance-sensors/pinouts [5]. L293D Motor Driver : https://components101.com/ics/l293d-pinout-features-datasheet [6]. Geared DC motor: https://www.engineersgarage.com/insight-how-geared-dc-motor-works/ [7] Tinker Cad : https://en.wikipedia.org/wiki/Tinkercad https://www.tinkercad.com/ [8]Buzzer : https://www.elprocus.com/buzzer-working-applications/ 42 CHAPTER 6 APPENDIX 43 APPENDIX-I Abbreviations:IDE-Integrated Development Environment LED-Light Emitting Diode USB-Universal Service Bus AREF- Analog Reference Tx - Transmitter Rx - Receiver ICSP - In Circuit Serial Programming RST - Reset pin GND - Ground pin Hz - Hertz DC - Direct Current mm – Milli metre Gm-Grams RPM-Revolutions Per Minute Kg-Kilograms Cm- Centi metre V-Volts AC-Alternating Current IC- Intergrated Circuit mA- milli Amperes Op-Amp – Operational Amplifier PIC-Peripheral Interface Controller PWM- Pulse Width Modulation IDE – Integrated Development Environment 44 APPENDIX-II Micro Controller – An integrated circuit that contains a microprocessor along with memory and associated circuits and that controls some or all of the functions of an electronic device (such as a home appliance) or system. USB cable - The term USB stands for "Universal Serial Bus". USB cable assemblies are some of the most popular cable types available, used mostly to connect computers to peripheral devices such as cameras, camcorders, printers, scanners, and more. Devices manufactured to the current USB Revision 3.0 specification are backward compatible with version 1.1. Analog signal - Analog signals can be defined as continuous signals whose time-varying features (also known as their variables or their variable features) are representations of some other time-varying quantity. In other words, analog signals are analogous to some other time-varying signal. An example of an analog signal is an analog audio signal. Digital Signal - A digital signal is a signal that is being used to represent data as a sequence of discrete values;at any given time it can only take on one of a finite number of values. This contrasts with an analog signal, which represents continuous values; at any given time it represents a real number within a continuous range of values. Embedded Systems - An embedded system is a microprocessor-based computer hardware system with software that is designed to perform a dedicated function, either as an independent system or as a part of a large system. At the core is an integrated circuit designed to carry out computation for real-time operations. Potentiometer – A potentiometer is a three-terminal resistor with a sliding or rotating contact that forms an adjustable voltage divider. If only two terminals are used, one end and the wiper, it acts as a variable resistor or rheostat. The measuring instrument called a potentiometer is essentially a voltage divider used for measuring electric potential (voltage); the component is an implementation of the same principle, hence its name is Potentiometer. Centrifugal Pump - Centrifugal pumps are devices that are used to transport fluids by the conversion of rotational kinetic energy to the hydrodynamic energy of the fluid flow. The rotational energy typically comes from an electric motor or steam turbine (in case of turbine-driven feedwater pumps). Centrifugal pumps are used in more industrial applications than any other kind of pump. The most common centrifugal pump is the volute pump. Range Detection - Range, or distance, is determined by measuring the total time it takes for the radar signal to make the round trip to the target and back. 45 46