How I made an obstacle avoiding car

 

How I made an obstacle avoiding car

Introduction

I don’t know whether you were taking notes last century, but we started on not how to fly, and ended up with moon landing, nukes, net, and reliable automobiles. Therefore, I assume that mankind didn’t perform that bad last century, however, what defines mankind is not – what happened in the past but what will happen in the future. With this hope in my heart, I looked forward to the future (through the lens of the internet, of course) and realized how bright it will be if we may reduce the pathetic numbers of humans experiencing preventable death. So, with this pursuit (and my interest in coding and technology), I ended up building a robot car, which I call ‘The Obstacle Avoiding’, to make road accidents a thing of the past. So, here’s my journey:

 

Motivation



(An unfortunate event)

There’s a chance, if you may be reading this, that a car never strikes through your human body or your automobile, making every bone in the body tremble. That’s great and that’s to be expected. However, I am afraid that everyone doesn’t share the same fate and my heart goes with them, but at the same time, emotions won’t solve anything, actions will. So, I decided to serve in the service of my fellow brothers and sisters, enabling them not to share the same fate as the unfortunate ones. So, this was basically the motivation behind this obstacle avoiding car.

 


 

(Obstacle Avoiding Car)

So, what does this car thing do?

So, in non-technical terms, this car can stop on its own if it senses anything (any obstacles) resides in front of it, hence it won’t be striking through humans or any other valuable asset. Not only is this concept practical, but it is already present at a small commercial level in the west. Though not claiming that my prototype was perfect (as it was not based on AI but Arduino), I am optimistic that there’s a huge scope of improvement.

So, we should move to some technical side now, shall we?

Like every other sophisticated looking system, this model of mine is the result of several parts coming together. Here’s the list if you are interested:


“So, what’s the concept and how does this thing work?” I am glad you asked.

Three major parts (of above list) which have the most of the responsibilities here:

1.)    Ultrasonic sensor

2.)    Arduino UNO

3.)    Motor driver shield

So, to begin with, let’s talk about Ultrasonic sensors a bit. Shall we?

Ultrasonic Sensor (HC-SR04)

                                                  


Ultrasonic sensor is the eye of this model. The basic principle behind the working of an ultrasonic sensor is to transmit ultrasonic waves and receive the ultrasonic beams if it hits any object (object means a body in the coding world). Then time is figured out and distance are calculated using this underrated but legendary formula (which has to be coded in Arduino), i.e.,

Speed= Distance/Time

Distance= Speed x Time

Where Speed = speed of the ultrasonic waves, i.e., equal to the speed of sound, hence, I am considering

it ‘p’ here and it is equal to 330 m/s in air (if you have a lucky day)

 

Time = time taken by those beams between transmission and receiving and then dividing it by 2 and hence I am considering it ‘t’.

Distance= distance between the object and the car itself, I am taking it ‘s’.

Hence, we got this formula here:

s = p x t    -----------   (i)

Arduino (Arduino UNO)


Furthermore, Arduino is the brain of this model which is programmed to command all the parts of the vehicles and executes the above formula (i). Yeah, you have to learn Arduino programming, but it is just like writing English with some predefined syntax. So, you have to define all the functions, such as: at what distance the car should stop after sensing an obstacle in its or at what degree it should command a servo motor to rotate the ultrasound sensor.

A drawback:

Like most of the things in the universe, speed of sound is also not constant and varies according to the medium it propagates. While writing code in Arduino, I took care of this thing, and added an external layer through which speed doesn’t increase above a threshold which makes it stop at, somewhat, the right time.


(Setting the speed limit for motor)

 

Motor Driver Shield


And lastly, the motor driver shield is the neuron as well as immune system of the program. Motor driver shield is the part which relays the Arduino commands to the different DC motors (mentioned in the list), moreover, there is back EMF, i.e., generated by motors and can harm the Arduino. So, it also helps to safeguard Arduino.

Nevertheless, Here’s the circuit which I used for this model:


Working

When I switch on the key, ultrasonic sensor senses all the nearby obstacles and passes these findings to Arduino (which does all the calculation), which decides the best thing to do in the scenario, furthermore, Arduino makes a necessary decision and passes it to motor driver which ultimately relays the decision to the four dc motors. Simultaneously, the servo motor rotates the ultrasonic sensor to sense everything near to its proximity and this process repeats several times to make my model move.


(Working)

Note: I would like to advise you that you should consult your concerned school teachers because designing circuits and finding any fault (if something goes wrong) is not an easy task. In my case, school management supported me for which I am very thankful as I won’t be able to make it all alone.

So, can we really stop road accidents with something like this?

Look, there is a very good story about Descartes. He was one of the fathers of the Modern Science and Philosophy, and one night, he had a weird dream, in which an angel came to him and told this, “The conquest of nature is to achieve through number and measure” This line is surely not the most, but one of the most powerful ideas we ever have. Scientific Objectivity. Nature can always be understood using mathematics, then controlled using technology, and as long as we remember that we are not special and the universe has a character, there may be no limit to what one day we may be capable of. Curiosity is absurdly powerful. It is the reason we have survived for so long. It is the reason that an average high schooler student knows more about the world than the best scholar of history ever could not a few hundred years ago. It is the reason that a lot of us are living a better life than every emperor in history. And just look at what we’ve done already. For me, reducing road accidents to zero is not a problem, but just a milestone. I believe, no, I know that we are going to add the term ‘Road accident’ into the history books just like we have done to every problem we come across so far.

 

Comments

Popular Posts