Project tutorial
Android Motion Detector Camera with Arduino/MCU

Android Motion Detector Camera with Arduino/MCU © CC BY-NC

Do you want to tighten your security? Want to know who is entering your room and capture their picture with an old smartphone and Arduino?

  • 15,688 views
  • 17 comments
  • 31 respects

Components and supplies

About this project

Hello everyone. In our smartphone, there are different types of sensor. These are used in different types of applications. But sometimes we need to add extra sensors in our smartphone; for this we have to use Arduino/Micro controller. From the title I hope you are sure that I am going to describe about motion sensor. Yeah, it is possible to make a Motion Detector Camera with a smartphone and Arduino.

Let's get started

Firstly, cut the left and right audio out wires of your earphone. You will see a red (microphone) and black (ground) wire. Attach the jumper wire to these wires.

Wiring

Make the Arduino circuit by following the steps below:

  • Arduino pin 2 <----> white LED
  • Arduino pin 6 <---->Tring ( Sonar sensor)
  • Arduino pin 7 <----> Echo (Sonar sensor)

Give 5v to the sonar sensor.

Earphone:

  • Red wire <----> One leg of LDR
  • Black wire <----> Other leg of LDR

(LDR must be faced on the White LED. You can also isolate LDR and LED by using black scotch tape.)

Power up the Arduino and connect the earphone jack to your smartphone. Then open the camera app in your smartphone. Now put an object in front of the sonar sensor, you will see that your phone will start taking pictures. Then make a nice casing for it. :)

Congratulations! Finally you made your own motion detecting camera.

How It Works

Of course, you are thinking about how it works. I hope that you know how a sonar sensor works. If you don't, you can watch this video. Every earphone has a volume button which works on a smartphone as a shutter button when the camera app is opened. The earphone's volume buttons are connected with the mic and gnd within a fixed value of resistor. And LDR changes its resistance which depends on the presence of light. For this, we have connected a high bright LED in front of the LDR. When Arduino turns on the LED, the resistance of LDR decreases.

Then LDR works as a volume button, it triggers the shutter button and captures a picture. The combination of LED and LDR is also known as optocoupler.

Best way to make a gaming steering wheel using an Arduino Uno:

Unojoy - Game controller

Code

Android motion detector camera with ArduinoC/C++
Arduino code , Extension is .ino
#define pingTrig 6 
#define pingEcho 7 

int cameratrigger = 2 ;
int led = 3 ;
void setup()
{Serial.begin(9600);
  pinMode(pingTrig, OUTPUT);
  pinMode(pingEcho, INPUT);
delay(200);
  pinMode(led, OUTPUT);
pinMode(cameratrigger, OUTPUT);
  

}

void loop()
{
  long duration, inches, cm;
  
  digitalWrite(pingTrig, LOW);
  delayMicroseconds(2);
  digitalWrite(pingTrig, HIGH);
  delayMicroseconds(10);
  digitalWrite(pingTrig, LOW);
  
  duration = pulseIn(pingEcho, HIGH);
  
  cm = duration / 29 / 2;
  
  Serial.print("-->");Serial.println(cm);
  if(cm < 30 ){
digitalWrite(cameratrigger,HIGH);
digitalWrite(led,HIGH);    
    delay(200);
    digitalWrite(cameratrigger,LOW);
digitalWrite(led,LOW);    
delay(200);}} 

Schematics

Wiring
Motion sense camera bb emnmbllwmu

Comments

Similar projects you might like

RGB Camera Backlight Control With Android Mobile

Project tutorial by DIY Partners

  • 1,967 views
  • 1 comment
  • 8 respects

Controlling an RGB LED with Color Detector Camera

Project tutorial by Zowail

  • 1,330 views
  • 0 comments
  • 1 respect

Security System Using Arduino Bluetooth Camera

Project tutorial by amrmostaafaa

  • 6,849 views
  • 4 comments
  • 26 respects

Motion Following Motorized Camera Base

Project tutorial by Lindsay Fox

  • 113,603 views
  • 68 comments
  • 286 respects

My Motion Activated Security Cam project

Project tutorial by Christiaan Neil Burger

  • 9,230 views
  • 9 comments
  • 12 respects
Add projectSign up / Login