ROBOTC VEX Light Sensor Car

by RosyS7 in Circuits > Robots

3094 Views, 3 Favorites, 0 Comments

ROBOTC VEX Light Sensor Car

IMG_20180502_112020_864[1].jpg
20180515_111104[1].jpg
20180515_111233[1].jpg
20180515_111146[1].jpg
20180515_111117[1].jpg
20180515_100716[1].jpg
20180515_100729[1].jpg
20180515_100617[1].jpg
20180515_100623[1].jpg
20180515_100659[1].jpg

This car uses only parts from the ROBOTC VEX collection. It is fairly simple and is a good project for beginners learning the ROBOTC Program that can be later developed into something bigger. The project will need the following:

ROBOTC for VEX Robotics programming on computer.

VEX Cortex

Any kind of wheels (We used (2) 2.75 in. wheels and (2) 4 in. wheels)

(2) 2 wire motors (We used 393 Motors)

1 battery

1 Battery Strap

A small test-bed

(2) 3 in. drive shafts

(2) Shaft Collars

(2) Motor Controllers (VEX)

1 Light Sensor (VEX)

Screws 3/4 in.

Nuts 8-32

For this instructable the car should not take much longer than a couple of hours. We made it simple so that it can be modified later as you get more familiar with the VEX components and the ROBOTC Programming.

The materials all used must be from VEX Products and can be bought in packs, or like in our case, be found in school.

Downloading and Setting Up VEX Robotics

download (2).jpg
20180515_112416[1].jpg
20180515_112432[1].jpg

1. First download the program into a compatible computer. Make sure it is downloaded as VEX IQ.

2. Open the program and set up the program with these details.

File-

Open a new file a select PLTW template

Robot-

Go to VEX Cortex Communication Mode. Select VEXnet or USB.

Go to Platform Type. Select VEX 2.0 Cortex and Natural Language PLTW

Window- Go to Menu Level. Select the Expert Option

Go to Motors and Sensors Set Up. Select the motors tab and set the left and right motors to the ports as shown in the picture. Select the VEX 2.0 Analog Sensors 1-8 tab and set the light sensor to the port as shown in the picture.

Apply this and exit out of the box.

Building the Car

20180515_111202[1].jpg
20180515_111336[1].jpg

1. Grab all essential materials.

2. Take the test-bed of the car and put the drive shafts into the last holes of the side.

3. Attach the wheels and put drive shafts into the ends.

Adding VEX Components

20180515_111435[1].jpg
20180515_111502[1].jpg
20180515_111705[1].jpg
20180515_111941[1].jpg
20180515_112002[1].jpg
20180515_112237[1].jpg

1. Choose a place for the cortex platform to fit (preferably in the middle)

2. Screw this into place, using shafts and shaft collars, and make sure it is secure so it will not fall around.

3. Put the battery collar next to the cortex.

4. Plug in the battery and secure it.

5. Grab the light sensor and attach it to the other side of the cortex. Secure it into place with the screws.

6. Attach the motors onto the wheel and its shaft. Make sure it is snug but not too tight so they can move around.

7. Connect the motors to the motor controllers.

8. Connect the motor wires and light sensor wire to the corresponding ports as shown in the photo.

Making the Code

20180515_112805[1].jpg

1. Type in the following code as shown in the photo attached.

2. Download and Compile the Program onto the Robot

Note: The battery must be plugged in and charged. The cortex should also be connected to the computer when downloaded using the USB cable.

Testing Out the Car

IMG_20180502_111942_565[1].jpg

When the program is downloaded and started the motors should move if the light sensor value is greater than 50. If you move into a different room that changes this value it will either keep moving or stop. When the car is in the dark it should turn off.

With the small project you can now develop it into something better. You might have some problems trouble shooting the code or if certain materials aren't working. The downfall of this car is that is must be plugged into a computer as it moves around. It can be modified using other products/components of the VEX collection. We hoped you enjoyed this car and now understand how coding works at least a little.