Team 8: Electronics & Software

The electronics for the stamping mechanism are set up so that both stamping and movement of the conveyor belt can be controlled through a single motor. This system consists of a 9V battery, a 100 RPM gearbox motor, an L298N motor driver, an Arduino Uno, and a potentiometer. The potentiometer controls both the turning on and off of the system as well as the direction that the belt ends up moving in. Originally, the potentiometer also would have changed the speed of the belt as well, but due to the slow speed of the motor, this was deemed unnecessary. All components not connected by pin joints were soldered to ensure longevity and contact between wires and components (i.e. the battery wires, potentiometer, and motor). 

The setup can be seen in the figure below. Firstly, the positive and negative terminals of the motor were attached to the OUT1 and OUT2 terminals of the motor driver. The 9V battery was connected to the 12V terminal of the motor driver and the 5V terminals of both the motor driver and Arduino were connected to supply power to all of the components. The ENA, IN1, and IN2 terminals of the driver were connected to the ~9, ~10, and ~11 pins of the Arduino, allowing for control of the direction and speed of the motor. The other terminals (ENB, IN3, IN4, OUT3, OUT4) were left unused as only one motor was needed to run the entire mechanism. The potentiometer was provided an input voltage through the Vin terminal of the Arduino and the output was run to the A0 pin of the Arduino. Finally, all of the ground terminals were connected by black wire as seen below.



The initial design of the electronic system can be seen in the figure below.



The code provided to the Arduino, which can be seen in the Appendix, took an input voltage from the potentiometer and outputs a specific direction and on/off signal to the motor. The voltage from the potentiometer was converted into a PWM signal that was read using the analogRead function, giving a range from 0 to 1023. This range was then split into three subranges which had an associated potentiometer position and function that was applied using if/else statements. The lowest range was set to be [0,399] or when the potentiometer was positioned to the left. The speed was set to the max speed of 255 and IN1 was set to HIGH while IN2 was set to LOW, allowing the motor to turn counterclockwise. This was reversed in the highest range, which was [801,1023] or when the potentiometer was turned to the right. The speed was still set to 255 but the IN terminals were reversed to reverse the direction of the motor. Finally, when the potentiometer was centered, it would be in the middle range of [400,800], where the speed was set to 0 and both IN terminals were set to LOW to prevent the motor from turning at all. In the original design, the speed was mapped to the PWM values of each range, but it was found that the final speed of the motor was too low to warrant any slower speeds, which pushed us to remove that feature.