CE-351
Microcontrollers, 2022 Spring
Smart car set up and
driving
Name: Mychael Garcia
Email:
mhgarcia@fortlewis.edu
Materials:
Car design and features
In this project, we were given a small 4-wheel drive car with some sensors on
it. we wanted to test the functionality of the sensors, if they worked or didn’t,
then implement the use of them into two autonomous driving modes and one remote-controlled
one. Each would be accessed using a button on our IR remote.
Task 1:
For the first task, we needed to test the attached ultrasonic distance sensor.
This was simply done by verifying the measurements its reporting to the serial
monitor to the current value.
Task 2:
The second component we wanted to test was the servo motor controlling
the direction the ultrasonic sensor is facing. This was done by having it
rotate from 0 to 180 deg and back to 0 (left to right).
Task 3:
Next, we checked to see if the motors controlling each wheel worked. We did
this by giving a simple program to move the car forward at a constant speed
then return going backward.
Task 4:
We then wanted to test the last component on the robot car, the three IR
sensors on the underside of the chassis. This was done by checking to see what
value was being displayed correlating to the surface it was looking at. Black
would give us a value of 0 and a lighter surface would reflect better giving us
a 1.
Task 5,6,7:
The last task was to put all the components together and developed a code
that had 3 different driving options. The first was remote-controlled, using
the IR remote in a previous lab we used the arrow buttons to correspond to
directions we wanted the car to go. The second option was selected by pressing
the "2" button. This mode was set to the line tracking. A line of
black electrical tape was placed on the ground and using the IR sensors the car
was able to navigate where to go just by knowing and reacting to changes in IR
sensor values. The last mode was accessed by pushing the "3" button.
This was an obstacle avoidance test. If the car came close to a wall it would
halt and using the ultrasonic sensor it would look left and right and determine
the direction that had the farthest object, more open space. Whichever
direction it chose it would turn and go that way. The surface I was testing on
was very smooth and had some sand, so the tires did not grip that well, so it
tended to under rotate and still hit objects.
Conclusion:
Overall this was a very useful and
interesting project. Developing a small toy car that we could drive around was
fun and having it follow a line of black tape worked very well. This could be
used to deliver goods from one place to the next and so on.
----------------------------------------------------------------------------------------------------
END