Carro de vigilância controlado via DTMF

Surveillance car controlled via DTMF

I made this project to build a surveillance car that can be controlled via the Internet or any private network. My goal was to easily and inexpensively make something that could be used for security purposes.
My car uses a DTMF module that receives input from the cell phone connected to the car. This cell phone is not only used to generate DTMF tones, but also for surveillance, providing live images from its camera, over the network using AirDroid.
Conventionally, any project that uses DTMF requires calling from another cell phone to the one attached to the project, which is not cost-effective , but in the case of my project I used an android application DTMF Tone Generator that generates DTMF tone. Now to get this to work I shared my phone screen over the network using VNC server which was quite cost effective .
To make this idea more effective, I mounted the phone on a servo motor. This gave my camera a degree of freedom, meaning I could move it left and right without moving the bot.
One more security issue involved with DTMF What I took care of was that anyone could control the bot by calling the cell phone connected to the bot. A simple solution to this problem was to apply a PIN using DTMF tones. I demonstrated this concept in the video and through the internal workings that you can see in the source code.

Benefits:

1. Much cheaper than Bluetooth and Wi-Fi modules, with almost identical operation.
2. Can be controlled via the Internet using VPN.

Public utility services:

1. You can efficiently track activities in your home when there are no occupants.
2. It can be used for surveillance purposes in dangerous areas where there is any type of threat to human life.

Protótipo de robô Arduino controlado por DTMF

Figure 1: Arduino robot prototype controlled by DTMF

Imagem mostrando o corpo mecânico do robô Arduino controlado por DTMF

Figure 2: Image showing the mechanical body of the Arduino robot controlled by DTMF

Imagem mostrando o robô Arduino controlado por DTMF em ação

Figure 3: Image showing the DTMF-controlled Arduino robot in action

Requirements:

1. DTMF decoder module
2. 3.5mm audio cable (to connect the cell phone to the DTMF module)
3. Arduino Uno
4. Lounger
5. Servo motor (7 kg/cm)
6. Android Phone (in my case Galaxy Ace Duos)
7. Laptop (can be desktop or any Android device that supports multi-window)
8. Wheeled Geared DC Motors
9. L298 Motor Driver Module

10. AirDroid Android Apps, DTMF Tone Generator, VNC Server

11. Applications on Laptop and Browser VNC Client

An extension of this project

I connected the Wi-Fi to the phone mounted in the vehicle, thus creating a local network. Now I was able to control my vehicle without the need for an external router or internet. Although I was unable to get the live stream as Airdroid needs internet connection to boot.

Description:

Explanation of circuit components and hardware:

I used DTMF decoder module using MT8870DE and connected it to Arduino as shown in the circuit diagram. I pulled pin 13 permanently to supply +5v to the module. As can be seen, D1-D4 are connected to pin 12-pin9 respectively, here D1 represents the least significant bit and D4 represents the most significant bit. Pin8 of the Arduino is connected to the STD pin of the DTMF module; becomes high whenever a new signal (valid tone) is given to the module.
The tones were generated via cell phone and fed as input to the DTMF decoder module using a 3.5mm audio jack.
For motor driver I used L298D module. Here M11, M12 and M21, M22 are connections for the LEFT and RIGHT motor respectively. When the car is viewed from back to front, M11=M21=HIGH and M12=M22=LOW the car will move forward. With this information you can easily use my source code directly by changing your connection respectively.
PWM1 and PWM2 are the pins that can be used to control the left and right motor speed. I set both to HIGH to reach maximum speed. EN1 and EN2 enable the left and right motor when set high, so I shorted them to +5V power from the Arduino.
Vcc for DC motors was connected to a +12v source.
The phone was mounted on a servo motor. The servo data pin was connected to pin 5 and +5v was taken from the +5v source and not from the Arduino, as the current drawn by the servo motor I used exceeded the maximum current that could have been drawn from the Arduino.

Explanation and operation of the peripheral applications used:

Firstly, I connected my laptop and my cell phone to the same network.
I used DTMF Tone Generator to generate DTMF tones. This application was running on my cell phone.
Now, to share the screen and get control of my cell phone from my laptop, I created a VNC server by running the VNC server app on my phone in the background and using the VNC client on my laptop. Now I was able to view my cell phone screen and simulate touches on my laptop.
At this point, I was able to generate DTMF tones from my cell phone using my laptop, so I was able to control my car using the laptop.
To get the live feed from my phone's camera I used the AirDroid app which was running in the background along with the VNC server and using a browser (preferably Chrome) on my laptop I was able to use my phone's camera.
The source code is well documented, so all necessary explanations are provided as comments.

Possible modifications:

1. Instead of being on the same network, you can control it via the internet from anywhere in the world using VPN.
2. You can use any tablet or phone that supports multiple windows instead of a laptop, as the only applications needed on my laptop were the VNC client and a web browser. Both are available for Android, iOS, Windows and Linux.
3. You can control the speed of the vehicle by connecting PWM1 and PWM2 to the pwm pins of Arduino and making necessary changes in the source code.
4. If only maximum speed is required, L293D can be used instead of L298, which can in turn save some money.

Project source code

 /*

 m11 and m12 are for Left Motor and m21 and m22 are for Right Motor when viewing your car from the back.

 To have forward motion set m11=m21=HIGH and m12=m22=LOW.


 a,s,d,f defines four digits of Security PIN.

 One can change it by changing their values ​​in "Loop for Security PIN" section

 Default PIN -> 1234

 */


 #include

 Servo myservo;

 int servant=5;

 int angle=180; // 180 is the initial angle and mobile phone should be placed with camera facing front

 int d1=12;
 
int d2=11;

 int d3=10;

 int d4=9;

 int st=8;

 int vccdtmf=13;

 int a=0,s=0,d=0,f=0,flag=0;

 int m11=19;

 int m12=18;

 int m21=17;

 int m22=16;

 int p1=15;

 int p2=14;

 void setup

 {

 myservo.attach(5); // Defines Pin 5 for Servo

 myservo.write(angle);

 pinMode(d1,INPUT);

 pinMode(d2,INPUT);

 pinMode(d3,INPUT);

 pinMode(d4,INPUT);

 pinMode(st,INPUT);

 pinMode(vccdtmf, OUTPUT);

 pinMode(m11,OUTPUT);

 pinMode(m12,OUTPUT);

 pinMode(m21,OUTPUT);

 pinMode(m22,OUTPUT);

 pinMode(p1,OUTPUT);

 pinMode(p2,OUTPUT);

 pinMode(servo,OUTPUT);

 }

 void loop

 {

 digitalWrite(vccdtmf,HIGH); // +5V for DTMF Module

 digitalWrite(p1,HIGH); //For Max.speed

 digitalWrite(p2,HIGH); //For Max.speed


 ////////////////////////////////////////////// Loop for Security PIN ///


 while(flag==0)

 {

 if(a!=1 && digitalRead(d1)==1 && digitalRead(d2)==0 && digitalRead(d3)==0
 && digitalRead(d4)==0 && digitalRead(st)==1)

 {

 a=1;

 }
 
if(a==1 && s!=2 && digitalRead(d1)==0 && digitalRead(d2)==1 && digitalRead(d3)==0 &&
 digitalRead(d4)==0 && digitalRead(st)==1)

 {

 s=2;

 }

 if(s==2 && d!=3 && digitalRead(d1)==1 && digitalRead(d2)==1 && digitalRead(d3)==0 &&
 digitalRead(d4)==0 && digitalRead(st)==1)

 {

 d=3;

 }

 if(d==3 && f!=4 && digitalRead(d1)==0 && digitalRead(d2)==0 && digitalRead(d3)==1 &&
 digitalRead(d4)==0 && digitalRead(st)==1)

 {

 f=4;

 }

 if(a==1 && s==2 && d==3 && f==4)

 {

 flag=1;

 }

 }


 ////////////////////////////////////////////////// ///////////////////////


 ///////////////////////////////////////// Movement of Car ////// /////////


 while(digitalRead(st)==0) // RESET the value when no valid tone is given

 {

 digitalWrite(m11,LOW);

 digitalWrite(m12,LOW);

 digitalWrite(m21,LOW);

 digitalWrite(m22,LOW);

 }

 
while(digitalRead(d1)==0 && digitalRead(d2)==1 && digitalRead(d3)==0 && digitalRead(d4)==0
 && digitalRead(st)==1) // Press 2 for Forward Direction

 {

 digitalWrite(m11,HIGH);

 digitalWrite(m12,LOW);

 digitalWrite(m21,HIGH);

 digitalWrite(m22,LOW);

 }

 while(digitalRead(d1)==1 && digitalRead(d2)==0 && digitalRead(d3)==0 && digitalRead(d4)==0
 && digitalRead(st)==1) // Press 1 for Right Forward Direction

 {

 digitalWrite(m11,HIGH);

 digitalWrite(m12,LOW);

 digitalWrite(m21,LOW);

 digitalWrite(m22,LOW);

 }


 while(digitalRead(d1)==1 && digitalRead(d2)==1 && digitalRead(d3)==0 && digitalRead(d4)==0
 && digitalRead(st)==1) // Press 3 for Left Forward Direction

 {

 digitalWrite(m11,LOW);

 digitalWrite(m12,LOW);

 digitalWrite(m21,HIGH);

 digitalWrite(m22,LOW);

 }


 while(digitalRead(d1)==1 && digitalRead(d2)==0 && digitalRead(d3)==1 && digitalRead(d4)==0  
&& digitalRead(st)==1) // Press 5 for Backward Direction

 {

 digitalWrite(m11,LOW);

 digitalWrite(m12,HIGH);

 digitalWrite(m21,LOW);

 digitalWrite(m22,HIGH);

 }


 while(digitalRead(d1)==0 && digitalRead(d2)==0 && digitalRead(d3)==1 && digitalRead(d4)==0
 && digitalRead(st)==1) // Press 4 for Right Backward Direction

 {

 digitalWrite(m11,LOW);

 digitalWrite(m12,HIGH);

 digitalWrite(m21,LOW);

 digitalWrite(m22,LOW);

 }


 while(digitalRead(d1)==0 && digitalRead(d2)==1 && digitalRead(d3)==1 &&
 digitalRead(d4)==0 && digitalRead(st)==1) // Press 5 for Left Backward Direction

 {

 digitalWrite(m11,LOW);

 digitalWrite(m12,LOW);

 digitalWrite(m21,LOW);

 digitalWrite(m22,HIGH);

 }


 ////////////////////////////////////////////////// ///////////////////////

 ////////////////////////////////////// Movement of Servo ///////// ///////

 
if(digitalRead(d1)==1 && digitalRead(d2)==1 && digitalRead(d3)==1 && digitalRead(d4)==0 &&
 digitalRead(st)==1) // Press 7 to turn servo in anti-clockwise direction

 {

 if(angle>0)

 {

 angle=angle-45;

 myservo.write(angle);

 delay(500);

 }

 }


 if(digitalRead(d1)==0 && digitalRead(d2)==0 && digitalRead(d3)==0 && digitalRead(d4)==1 &&
 digitalRead(st)==1) // Press 8 to turn servo in clockwise direction

 {

 if(angle<180)

 {

 angle=angle+45;

 myservo.write(angle);

 delay(500);

 }

 }


 ////////////////////////////////////////////////// ///////////////////////


 /////////////////////////////////// You Have to Enter Password again ////



 while(digitalRead(d1)==1 && digitalRead(d2)==0 && digitalRead(d3)==1 && digitalRead(d4)==1 &&
 digitalRead(st)==1) //Press A to reset the PIN

 {

 flag=1;

 }

 ////////////////////////////////////////////////// ///////////////////////

 }

 
/********************* END *********************/

Circuit diagrams

Image-Showing-DTMF-Controlled-Arduino-Robot-Action

Project video

An extension of this project

I connected the wifi of the phone mounted in the vehicle, thus creating a local network. Now I was able to control my vehicle without the need for an external router or internet. Although I was unable to get the live stream as Airdroid needs internet connection to boot.

Related Content

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.