Weekly Updates

Week 1 Update

This week I was working on changing and refining my idea for the project. Initially I was going to use only 1 Ultrasonic Distance Sensor to determine the distance of the incoming ball as well as only 1 servo motor that controls the one arm in order to block incoming objects from entering the goal. I decided to include one more Ultrasonic Distance sensor and servo motor so that the left and right side of the goal have their own control arm as well as Distance Sensor. There will now be two readings of distance, one for the right side of the goal and one for the left side. I also ordered the parts for the project which included the servo motor as well as two external LCD displays that can be used to display the distance of the object from both Ultrasonic Distance Sensors

Week 2 Update

This week I worked on setting up the two ultrasonic sensors and was able to display the two readings onto the LCD display that is on the board itself. The left three digits represent the reading from the ultrasonic distance sensor that is on the left and three digits on the right represent the reading from the ultrasonic distance sensor that is on the right. I changed the timer to Timer 5 that I would use in comparison to Lab 3 where we used Timer 4 because I needed pins PB6 and PB7 for the I2C protocol to communicate with the 16x2 external LCD display. The TRIGGER for both ultrasonic distance sensor used the same pin which was PE11 and the ECHO pins for both Ultrasonic Distance Sensors were PA0 and PA1 because their alternative functions supported TIM5_CH1 and TIM5_CH2. This week I also tried to configure the 16x2 LCD display however I am struggling to find the correct drivers that would allow me to use this display using the I2C protocol. This next week I need to figure out how to utilize this external display as well as get the servo motors connected and working upon command.

Week 3 Update

This week I figured out how to use the external LCD 16x2 Screen using I2C as well as using UART to control the Servo Motor. My 16x2 LCD Screen is used to tell the user when to block the ball. When an object is close enough it will display on the 16x2 External LCD Screen using the statement "Block Ball". When we see this statement we can use the command "B" or "b" on termite to trigger the servo motor to lower its control arm in order to block the object. When we type in the command onto to termite to close the control arm it shows "Gate Closed" while on the other hand we type in "O" or "o" into termite which stands for "open" we see the statement "Gate Opened" on the LCD screen. I decided to use two servo motors to control two different control arms initially but due to some issues with limited power, I decided to use 1 servo motor instead. I had created three separate projects first, first being the ultrasonic distance sensors, second being the servo motor control using UART, and lastly the 16x2 external LCD screen. I had gotten all three of these to work separately, but when I combined them I ran into issues where some components were sharing timers as well as some components were using different frequencies for the clock. I was able to solve these issues by changing the pin the servo motor was connected to in order to use a different timer which in this scenario was timer 8. The demo video will be on the home page at the bottom.