ME 210: Mechatronics
S.K.K.P

Full Circuit diagram
IR Line Sensors
The IR tape sensor was one of the most time-intensive circuit components to build.
Initially, the system never registered a signal under any conditions. We made significant alterations to the circuit to address this problem, including changing component location to reduce any potential coupling to other systems, adding a unity gain buffer to stabilize the input voltage, and switching from a sinking to a sourcing configuration. Ultimately, the issue was diagnosed to be a combination of a smaller output current than specified on the datasheet and faulty tape sensors.
Once we switched tape sensors and significantly increased the gain resistance, the sensor worked without issues.

ADD PHOTO

An example of why we switched to the Pololu QTR-8A.
Note the extremely wide turns when line following, and the reorientation causing a failure to detect the intersection

Initially, we used the tape sensors (top image, bottom right corner) in a configuration of three widely spaced sensors to detect T intersections and for line following. However, we found that it could not follow the line closely enough to detect and line up with intersections consistently.
So, we switched to using three sensors on a Pololu QTR-8A (bottom image, each sensor a black square) for line following and two tape sensors placed at the edges of the robot to detect T intersections.
Power Supply
Our power supply came from two 7-volt batteries connected in series and a fuse box to prevent shorts from damaging the circuitry. We initially used an L7812 and a LM7805c to decrease the voltage from the batteries to 5 and 12 volts. The 12-volt supply was used to power the motors and the Arduino, while all other components were powered with the 5v supply. However, the 12-volt regulator began overheating after increasing motor torque, so we switched to a variable buck converter adjusted to 12-volt. To supply a more consistently regulated voltage, we also used the Arduino 5-volt supply.


FIX KICAD

Motor Driver
The motors were driven with an L298 h-bridge module -- specifically, by applying power to the input pins to control direction, and pulse width modulated signals to the enable pins to maintain speed.
Ultrasonic Sensor
The ultrasonic sensor was used to orient the robot in the correct direction to leave the start zone. It was designed to replace the design we used throughout testing, where a manual button was pressed on the robot to signal that it was in the correct orientation.
Since it was added after the rest of the circuit was completed, we added a second Arduino to control the sensor. A second sensing Arduino was an idea we'd previously had, but we avoided implementing it by limiting the pins read from the sensor board.
While we researched I2C and tested using a low-pass filter and PWM to send an analog input, we ultimately used the simpler solution of directly writing a digital output from one Arduino and reading it on the other—a direct replacement for a hardware button.


Servo Motors



Since the Contact Hitter ("Flag Arm") and Ball Release ("Flywheel") both were low weight, 180 degree DF9GMS micro servos driven by an Arduino digital output pin provided sufficient torque. The Arduino provided a pulse-width modulated control signal where the duty cycle determined the relative angle of rotation of the servo motor, allowing the Ball Release to precisely rotate to stop with each ball above the release.
A demonstration of the Contact Hitter's celebratory action (left) and the Ball Dispenser (right)
Limit Switch
The limit switch was, in theory, a simple device that would be wired to either connect an Arduino digital input pin to either 5 volts or ground. In practice, the frequent reassembly of the robot our rapid prototyping required, along with continuous collisions with the wall, led to frequent rewiring and loose connections.




