Motion Following Motorized Camera Base With Face Detection







A Brief Description

Required Equipments

How it works?

Block Diagram

Algorithm

Detailed Circuit Diagram

Problems Faced

Group Members Information

Course Teacher






A Brief Description


In this Project we have designed an embedded system which is used for tracking movement of people along with the feature of detecting faces.

Whenever a person is close to the camera or moving around the camera, the camera moves automatically to the position where people is and adjusts itself to focus on the face of the person on the screen.






Required Equipments







How it works?


In this project we used the Arduino Uno microcontroller for interfacing the various hardwares we needed to make the embedded system come to life. The PIR sensors came in handy to detect the motion of person. We had compartmentalized the whole system into 5 sectors and understandably, we put each PIR sensor to each of the compartments. Whenever it detects motion in any one of the compartments the camera rotates to that compartment and brings in view anyone who is present in that position. We implemented this by the aid of a continuous rotation servo which enabled us to have a 360 degree rotation range. We also had 5 LEDs interfaced to the Arduino Uno where each LED corresponds to each of the 5 compartments. The second task that was hand was the task of face detection and adjusting the camera to bring the face in the display. So, we used a flexible software sketchbook named Processing 3.2.3 and included the OPENCV library to enable the feature of detecting faces. We handled the face detecting ability and correspoding actions to be taken in the Processing IDE and then via the serial port we sent it to the Arduino. As per the Processing guided the Arduino, we took action in our Arduino code to tilt the Tilt Servo accordingly to adjust the camera to focus our face and bring it into clear view.






Block Diagram




                                                                       pin diagram

                                                                                                                                               fig.1 Block Diagram






Algorithm




       1.Start
              2.Setup
              3.Setup each PIR pin for input
              4.Setup both servo pin for output
              5.Setup Serial Port
              6.loop
              7.For each PIR
                            8.If PIR is High
                                   9.Move pan Servo to that PIR
              10.ENDFOR
              11.command=Serial.read()
              12.if(command=="top")
                            13.move tilt servo to top.
              12.if(command=="bottom")
                            13.move tilt servo to bottom.
              14.FaceDetect
              15.Faces=detect.faces()
              17.For each Faces:
                                   18.If Faces[i].y +Faces[i].height> toplimit
                                          19.send signal 'bottom' to Arduino
                                   20.IF Faces[i].y < bottomlimit
                                          19.send signal 'top' to Arduino
              21.ENDFOR
       22.End






Detailed Pin Diagram




                                                                      





                                                                       pin diagram

                                                                                                                           fig.3 Pin diagram of the circuit






Problems Faced


  1. Power management was an ever-present problem. Due to the high current requirements for the two Servos in our design we had to use a Lipo Battery to meet the current demands. We had to regularly charge the lipo battery to keep it above the 5.0 V threshold so that the buck module gets a perfect 5.0V for providing VCC for the Servo. Also, sometimes due to the 5V supplied to the PIR not working properly the PIRs acted in weirdly giving erratic readings. Connecting the VCC of PIRs to Arduino Vout = 5.0V and Arduino GND solved the problem.

  2. Handling the continuous servo was a bit of a challenge. As the continuous servo takes in values for speed and direction from the Arduino rather than specific angle values, setting the right speed along with the direction was very difficult to convert to code. So what we did is, we took specific delays for the time which the servo will run and after the delay time has been exceeded, the servo stops. Suppose the camera needs to be moved from compartment 1 to compartment 5. We calculated the speed, direction and time it needs to reach the specific compartment and put it into an array of size 5. So, now if we wanted to go from compartment 4 to compartment 5 the delay of the servo is assigned as the substraction of the delays of compartment 4 from compartment 5. Once again, moving from compartment 5 to 4 the value of delay becomes negative. So we handled this by making the delay positive and reversing the direction of the servo.

  3. The most disturbing of all of the problems were damaged wires. In the middle of our work, sometimes some of the components or hardware we used behaved erratically. Trying all the possible alternatives to correct the working failed at times. Usually what the problem turned out is some of the wires connecting the components were not working properly or was damaged that led to the problematic condition of the system.

  4. Creating the setup was a bit of a challenge especially to enable the feature of tilting of the camera base. However, due to having availiable plastic wood we could set up a basic tilting mechanism by placing the 180 degree servo inside the system.

  5. As we have used Lipo Battery as the primary power source of our system it required careful handling at all times. The polarity at which it was connected to circuit was checked each time. Conncecting to opposite polarities of Lipo generally has devastating effects over circuits. So extra caution was maintained while handling the lipo. In addition to that, we disconnected the Lipo whenever the circuit was not in use to save the power.






Group Members Information


Section A1: Group 3






Course Teachers


  1. Md. Aashikur Rahman Azim

  2. Tarikul Islam Papon

  3. MD Iftekharul Islam Sakib





Project Video

Back to top