ECE434 Project - Water Gun Sentry Turret

From eLinux.org
Revision as of 21:03, 21 February 2023 by Harriss1 (talk | contribs) (Future Work)
Jump to: navigation, search

thumb‎ Embedded Linux Class by Mark A. Yoder


Team members: Sophia Harrison and David Purdy

Grading Template

I'm using the following template to grade. Each slot is 10 points. 0 = Missing, 5=OK, 10=Wow!

Add Extras

09 Executive Summary
09 Packaging
09 Installation Instructions 
09 User Instructions
09 Highlights
09 Theory of Operation
09 Work Breakdown
09 Future Work/Conclusions
09 Hackster.io
09 Demo/Poster
00 Not Late

Score:  100/100

Executive Summary

PICTURE HERE

Introduction:
For our project, we created a water gun sentry turret. This project consists of several components including the BeagleBone AI-64 (BBAI64), a stepper motor and driver, a servo motor, a water pump, and a relay to fire the water pump. In addition, this project runs a Machine Learning program on the BeagleBone AI-64 to detect if a face is in view of the connected webcam and if the face's mouth is open. When the camera detects an open mouth, the centroid of the mouth is calculated and the servo adjusts the water gun's angle in order to shoot water into the mouth. The water shot is pumped from a water reservoir using the water pump which activates soon after the mouth is detected to be open.

What Worked:
What we got to work for our project was majority of the components we set out to implement. We successfully connected and video streamed a webcam with the BBAi64 and we were able to implement the servo motor, relay, water pump, and wifi to connect wirelessly. Our stepper motor was implemented but the rotations it produced were very small.

What Didn't Work:
We ran into some difficulty when trying to use the BBAI64 as it worked much differently compared to the BeagleBone Black used throughout the class. We were not able to use a lot of python packages and using gpios was different and it took us a minute to figure out how to do so. Additionally, for our project the stepper motor would only rotate very slightly and thus wasn't able to rotate the platform as much as we would like. One possible source to this issue we suspected was insufficient power to our stepper motor and driver.

Conclusion:
In conclusion, we were able to create a water gun sentry turret which can detect when a person's mouth is open, aim the water nozzle, and gently shoot water into a persons mouth. While our stepper motor underperformed somewhat, the project still proved to be functional.

Packaging

For our packaging we needed to use something that would protect the circuitry from water, since the components needed to work close to a water pump and nozzle. We chose a plastic container that could fit all of the peripherals and the BeagleBone inside it and also protect from possible water exposure. To allow for the power cords to be plugged into a wall, we drilled a small hole into the container towards the bottom on its side. Additionally, we had a square structure mounted on top of the plastic enclosure that held the servo motor, water nozzle end, and the camera on top of it secured with duct tape.

Here you can see images of the container and its contents:

PICTURE HERE

Installation Instructions

For further instructions on how the code works and how to setup your environment, visit our github

Here are some instructions for how we set up the BeagleBone AI-64:

  • Install a graphical OS (makes it easier to debug later, We installed the Bullseye XFCE (with graphical desktop) for BeagleBone AI-64)
  • Once flashed on, to get the display port working you are going to want an ACTIVE micro display port adapter. Trust me there is a difference, the active ones have a thick block
  • Once you get this and boot you should see a desktop boot up on the display.
  • To get internet we setup the WIFI dongle and used this for downloading everything. We used instructions for setting up the WIFI drivers on the bone from the eLinux wiki page.

After setting up our BeagleBone AI64, we set up our various peripherals using the code found in the peripherals_test directory in our repository. Using those as a guide, you can set up the hardware and then run the main script and then the project should work!

Additional Hardware Needed:

User Instructions

Once everything is installed, to use the project all you have to do is ssh into the bone and run detect_open_mouth.py, the main python script. To stop the script you press q on your keyboard and that's it! These two steps allow you to start and run the project. See our gitrepo for the code and additional help.

Highlights

To see our project in action, check out our demo on YouTube!

Theory of Operation

Give a high level overview of the structure of your software. Are you using GStreamer? Show a diagram of the pipeline. Are you running multiple tasks? Show what they do and how they interact.

Work Breakdown

Here are the major tasks we completed for our project. We both sat down and worked on these together.

  • Setup BeagleBone AI-64
  • Get webcam to work and read its videostream using python
  • Get stepper motor to work with the BeagleBone and write python code to interface with it
  • Get servo to work, write python code to interface with it
  • Implement the relay, test with led first before adding water
  • Create housing for the project, drill holes into the enclosure
  • Setup remote ssh into bone so the script can be run remotely
  • Test system with water and tweak as needed

We were able to successfully complete all of these tasks.

Future Work

Some things we could do in the future with this project include making the main python script for the water gun run on the bone's startup, so that you do not have to ssh into it to get it started, making the project easier to use. Additionally, we would improve the wiring and circuitry for our stepper motor so that the platform can turn a wider range of angles so the field of view is not as limited.

Conclusions

Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.




thumb‎ Embedded Linux Class by Mark A. Yoder