/Laser-turret

This was done for the IoT course in my 3rd year of university

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

AT things individual project

Mos Daniele 935

Name: Face Tracking Laser Turret

Description:

The main idea of the project is to use OpenCV in Python to detect faces from the video stream (in our case the video stream will come from web cam or smartphone) and it will approximate a point at the center of the face. Face detection will be done using a pre-trained model that performs really well and works with the OpenCV library.

Using Arduino as our microcontroller we will use it together with 2 servos (for axes x and y). The laser on top will hold a laser module. The 2 servo motors will be connected to the Arduino UNO board through a breadboard.

We will be using the coordinates of the detected face that we got using OpenCV library will be translated in coordinates for the Arduino board. We than make use of the 2 servos and direct them in order to point the laser module at the face where we detected and calculated the target point.

Setup and Build:

  • Need to glue down the X axis servo and on top of it, glue the second stepper (Y axis) horisontly. Also glue the laser module at the end of the Y axis stepper. Make sure the X axis one is glued to something stable so it won't rumble around.
  • After we assemble the circuits and write the arduino program and transfer it to the arduino board, we need to power up the circuit.
  • Make sure that the Arduino is running correctly and keep in mid the serial port selected in the Arduino IDE, it should be the same as in the “face_detection.py” file

schematic image

schematic image

Hardware requirements:

Running:

  • Inject the Arduino program into the board, by hitting Verify button and then the Upload one. Make sure it has been uploaded successfully.

schematic image

  • After we follow the step above, we can start the python “main.py” program, which will present us with the video stream from the webcam, with the detection drawn on top.
  • In order to exit the program we press the “Esc” button and the video stream will stop.

Schematic:

schematic image