
Abstract
As part of the California High-Speed Rail Delivery Service, our group was tasked with designing an automated freight delivery system using the existing California High-Speed Rail System located in California's Central Valley.
In this project, we explored the use of mechanical and electronic systems including the integration and programming of Arduino components. We discuss our delivery vehicle design, Arduino programming, testing and results, and final design improvements and thoughts.

The Problem
In August 2008, California Assembly Bill 3034 was approved by State Legislation. The ambitious project was to create a high speed rail system which would link California’s Major City Centers including Sacramento, the San Francisco Bay Area, the Central Valley, the Inland Empire, the Los Angeles Basin, Orange County, and San Diego. 11 years later, the project has been severely curtailed and the distance of the rail system may only be from Bakersfield to Merced.
Our Team would like to make use of the existing High-Speed Rail lines for an automated delivery service. Our vehicle employs a “hopper” to dispense its “cargo” to ramps built on our vehicle that deliver the “cargo” to the target location. This hopper is initiated by a sensor built on to an adjustable arm at the front of our vehicle. We spaced the sensor arm and ball delivery ramps apart to compensate for the constant motion our vehicle will be in along with the delay for the cargo to travel from the hopper to the bottom of the ramps.

Design and Parts
Our design consists of a 3 wheeled chassis, driven by 2 motors. The motors are driven in tandem by the L298N motor driver. These are powered by a battery pack containing 4 AA batteries. We have an arduino that is scripted to keep the motors running on battery power, as well as drive the servo connected to our hopper assembly. This servo is scripted to activate once the TCS3200 color sensor is triggered.

The Code
Five versions of the Arduino code were written during the design process. The first version “Frank-N-Steign” turned on the servo and powered the motors with a L298N motor driver controller module. This version of the code had them continuously running at the same time and was the foundation of our vehicle.
The next version, “Frank-N-Steign_bride,” turned the motors and servo on and off on a set interval. Our idea was to have the vehicle move and stop at each station. This version was particularly hard because we found that the motors the servo reserves were pins 9 and 10 on the Arduino and therefore, we were not able to use these to control motors. Our next challenge was to have the vehicle sense a target and then stop to drop off the payload.
The third version, “Frank-N-Steign_Son” involved adding the light sensor and figuring out how to make it work properly and return values while also running the code for the engines and the servo. This is when we found out that we needed to assign the values returned to integers. The next step was to make it all run together.
The fourth version was “Frank-N-Steign_Son2.” the last major code change where we added the if else statements. If the photo sensor was outputting RBG values greater than # then do this. Otherwise it would run the motor and keep sensing. This was the final piece of code that was needed.
The last code “Frank-N-Dog,” was the final code that was written for this monster. It was calibrated to sense the black target and drop a ball on a consistent basis. It was the final version ready for production.

Testing
We began testing with our vehicle setup to stop once the sensor detected the target delivery zone. We discovered that we could set the vehicle to slow down rather than stop in the delivery zone to speed up the overall process. Along with a re-calibration of our color sensor, we were able to more accurately locate each station and drop off a ball onto the ramp. This change in the Arduino code can be seen in version “dog.”
Another issue discovered during testing was that the vehicle would not drive straight due to the left wheel being misaligned. In order to keep the car straight we designed bumpers which attached to the front of the vehicle. These bumpers made contact with the walls of the track to keep the vehicle from veering off and over the side.
Conclusion
The California High-Speed Rail Delivery Service project proved to be quite difficult. We were challenged with not only creating a motorized vehicle that could ride along a track, but also with figuring out how to deliver a package to each station. This entailed learning how to make the vehicle sense each station and drop a ball inside. Our team was required to figure out how to design this vehicle while programing an Arduino Uno Microcontroller and the required sensors. We decided to use a mechanical delivery system, controlled by a servo, which would activate when a color sensor sensed one of the ramps. After assembly and testing of our delivery system, our next challenge was to keep the vehicle driving straight on the track. As opposed to adding extra wheels to keep it straight, we added a bumper system to push the vehicle against the walls of the track and keep it centered.