Sie sind auf Seite 1von 6

Skype-controlled robot using smartphone and

DTMF tones
http://www.instructables.com/id/Skype-controlled-robot-using-smartphone-and-DTMF-t/
A new trend in robotics is smartphones that hae a lot o! sensors" camera" #$S. %ne o!
problems" howeer" is how to inter!ace phone with custom electronics. &t can be done oer
'luetooth" but audio inter!acing using dual tone modulation !re(uency DTMF is simpler. That
is enough to control a simple robot described here.
&t is a simple moing plat!orm containing mobile phone that is remote-controlled oer &nternet
ia Skype using DTMF tones. )ireless connection is done by )*A+ that is !ree o! charge or
mobile phone network that can be done oer large distance.
,ere is a ideo where Skype ideo call is started !rom a $- to i$hone. A dial pad is opened in
Skype to generate DTMF tones. .ideo at
http://www.youtube.com/watch/01-m2.3r45*&

Dual !re(uency DTMF method is (uite reliable and there e6ists a speciali7ed decoder chip.
DTMF chip is read out by Arduino board that controls seros.
A ery similar robot controlled oer mobile phone" but with motors instead !or seros" is ery
well described in &nstructable:
http://www.instructables.com/id/-ellphone-%perated-8obot-9/step:/S-;MAT&--%F-
-;**$,%+;-%$;8AT;D-*A+D8%.;8/
,ere are some robotics sites using smartphones:
http://www.cellbots.com/
http://code.google.com/p/cellbots/
https://github.com/mleone/broadcast
http://www.ra7orconcepts.net/dtm!.html
Construction
Mechanical construction is nothing particular and can be !ound by searching google !or
simple robots:
http://www.instructables.com/id/,ow-to-Make-an-Arduino--ontrolled-Sero-8obot-S;8/
Seros are like used in radio-controlled models but are modi!ied !or continuous rotation:
http://www.instructables.com/id/Modi!y-A-Sero-For--ontinuous-8otation/

& will concentrate on electronics here.

)hen a button is pressed in Skype" a dual-tone audio signal is generated that is sent by a
wireless connection to a phone that plays it. DTMF decoder chip MT<<=> input is connected
to headphone output o! i$hone" or some other smart?phone@. &n principle a microphone could
be used to skip the audio cable.
;ach number is coded by two !re(uencies. DTMF chip decodes !re(uencies and sets lines A9-
AB according to the table in manu!acturer datasheet. Decoding is easy as the code is actually
the binary representation o! the number. *;Ds can be connected to the DTMF chip pins !or
isual checking.
StD goes ,igh when alid digit is detected. &t is used !or checking that a command has been
sent and is connected to Arduino pin <.
*ines A9" A1" A: are connected directly to Arduino digital input pins C" 9>" 99. This is
Arduino port ' that can be read out by a single command D$&+'E" see programm code in
appendi6. Arduino boards hae ery good documentation !rom deeloper and in !orums. The
pin numbers o! Arduino are not the pin numbers o! Atmega chip. Arduino programming
so!tware usees Arduino pin numbers and not the chip pin numbers.
Arduino board reads a byte !orm $ort ' input lines and i! a correct combination e6ists" then
e6ecutes a subroutine !or sero moe. For Arduino e6ists a ready-made sero control library.
)heel seros are modi!ied !or continuous rotation. Arduino code also allows to steer robot
oer a -%M-port inter!ace by sending numbers !rom $- keyboard.
'elow is a Skype dial pad and buttons that are used to steer the robot.
Dialpad is under /call/ show/dialpad. %n smaartphones e6ist DTMF tone apps.
.

Power

'atteries attached with help o! magnet. 'e
care!ull with charging *i$o. &! oltage
increases aboe B.1 ./ cell then cell might
ignite. 2se only special chargers like !or
radio controlled models. & hae 1 series
*i$o pack. For charging & connect cells in
parallel and charge by putting inside
mobile phone a dummy with contacts.
PC webcam drive around
For autonomous operation battery is the
biggest problem. For around a clock
operation connect with 2S' cable to $-.
2se webcam and 2S' hub. +ow you can
skype to it any time.
Remarks ater testing
The Skype robot proFect was (uite !un
and it would be nice to hae it online all
the time. For that one would need to sole
power supply problem. May be a solar
panel" and put it in low consumption
sleep mode when nobody controls it.
Android smartphones at the moment o! writing did not hae ideo in Skype. +eed isual
contact or an app Droidcam to see ideo in )*A+.
For a Skype call !rom an i$hones no dial tone pad was aailable at the moment o! writing.
DTMF commands are ca 1>> ms long" so do not e6pect to be able to control the robot rapidly.
&! wished one could make all commands endless in time and introduce a stop button as nr 4.
// ROBOT controlled via INTERNET Skype > DTMF decoder > Arduino > servos
#include <Servo.h>
Servo myservol, myservor, myservoc;
int c; //command
int pos = 117; // position of camera tilt servo
void setup(
!
""#$ = $%%%%%%%%; // sets &rduino pins '(1) as inputs
myservol.attach(7; myservor.attach(*; myservoc.attach(+;
myservol.,rite(-%; myservor.,rite(-%; myservoc.,rite(pos; //stop motion and put camera loo.in/
hori0ontally

Serial.1e/in(-*%%;
,hile(Serial.availa1le( Serial.read(;

turnri/ht(; delay(2%%; turnleft(; delay(2%%; stopp(; // ma.e some movements on po,er up
Serial.println (3commands via serail 4(left, *(ri/ht, 2(for,, '(1ac., 1(cam up, 7(cam do,n. 5r "678
tones via audio3;
9
void for,ard( ! myservol.,rite(1%; myservor.,rite(17%; delay(1%%%; 9
void 1ac.,ard( ! myservol.,rite(17%; myservor.,rite(1%; delay(1%%%; 9
void turnri/ht(! myservol.,rite(1%; myservor.,rite(1%; delay(1%%; 9
void turnleft( ! myservol.,rite(17%; myservor.,rite(17%; delay(1%%; 9
void camup( ! pos=pos:); Serial.println(pos,";<; if (pos>1'%!pos=1'%;9 myservoc.,rite(pos;
delay()%%;9
void camdo,n( ! pos=pos(); Serial.println(pos,";<; if (pos< -%!pos= -%;9 myservoc.,rite(pos;
delay()%%;9
void stopp( ! myservol.,rite(-%; myservor.,rite(-%; 9
void loop(
!
if (Serial.availa1le(
! c = Serial.read(; Serial.println(c;
if (c==+% ! for,ard(; 9
if (c==+* ! 1ac.,ard(; 9
if (c==+2 ! turnleft(; 9
if (c==+4 ! turnri/ht(;9
if (c==++ ! camup(; 9
if (c==4- ! camdo,n(;9
stopp(;
9
c==>?$;
if(c==' !1ac.,ard(;9
if(c==1% !for,ard(;9
if(c==12 !turnleft(;9
if(c==14!turnri/ht(;9
if(c==1+ !camup(;9
if(c==-!camdo,n(;9
stopp(;
9
Single-tone control
!nsuccessul pro"ect#
8obot control using single tone was tried prior to DTMF" howeer" it was not ery reliable
and so!tware !re(uency measurement took a lot o! time. Some notations in the program code
still contain traces o! this initial attempt.
First ersion was to use single !re(uency tones =>>" <>>" C>>" 9>>>" 99>>" 91>> ,7.
The tones were recorded by Cooledit as wae !iles 9 s long.
Skype can transmit tones well in this range. Arduino had a program that counts !re(uency.
http://tushev.org/articles/electronics/43-measuring-frequency-with-arduino

long getFrequency(int pin)
!define "#$%&'" 4()*
long freq + (,
for(unsigned int -+(, -."#$%&'", -//) freq/+ 0(((((/pulse1n(pin2 31432
50((((),
return freq / "#$%&'",
A webpage was made with buttons playing tones. Audio input and output on $- were linked with
cable.
.html6 .7ody6 .span id+dummyspan6./span6
.form6
.input type+87utton8 value+8Forward8 on9lic:+8;3<$&"ound(=>((.wav=)86
.input type+87utton8 value+8?ac:ward8 on9lic:+8;3<$&"ound(=@((.wav=)86
.input type+87utton8 value+8&eft8 on9lic:+8;3<$&"ound(=)((.wav=)86
.input type+87utton8 value+8Aight8 on9lic:+8;3<$&"ound(=B(((.wav=)86
./form6
.script6
function ;3<$&"ound(surl)
document.get'lement?y1d(8dummyspan8).inner3<$&+
8.em7ed src+=8/surl/8= hidden+true autostart+true loop+false68,
C
./script6 ./7ody6 ./html6