Purpose:
The team tested the functionality of the reflectance sensors and learned how they were useful for the project. The reflectance sensors allowed the AEV to move to a certain position on the test track instead of setting the motors run for a certain amount of time. This led to increased consistency.
Code:
motorSpeed (4,25);
goFor(2);
motorSpeed(4,20);
goToAbsolutePosition(20);
reverse(4);
motorSpeed(4,30);
goFor(1.5);
brake(4);
The wheels were manually moved and if the reflectance sensors recognized 20 marks, the motors would reverse. This test proved successful and ensured the functionality of our sensors.
The main function of a reflectance sensor is for the AEV to be able to gauge how far it has moved. This is done by attaching reflective tape to the wheel. While the vehicle is moving, the sensors will record how many rotations the wheels make. Reflectance sensors are vital to the AEV since the code is based on the position and movement of the vehicle. Without a reflectance sensor, functions such as ‘goToAbsolutePosition” and “goToRelativePosition” would not be able to be utilized when creating code for the AEV vehicle.
The picture above shows how the reflectance sensors are connected to the Arduino Nano
The picture above shows the reflectance sensors attached to the arm of the AEV