Instructables
You ever dreamed to have an orbitcam or any other Pan/Tilt webcam control?

Here it is! With this Made from scratch Servo Pod, you can now control your webcam (or wifi antenna ?) by the palm of your hand or even remotly with a web server.

Step 1: Get all the parts and tools

ServoPod_004.jpg
For this Servo Pod, you'll need :

Parts :
1 x Microchip pic16f628(a) (free sample from microchip, don't abuse...)
1 x Dip socket for pic
5 x 4.7kOhm resistor (or 5 "pullup" resistor)
1 x 22kOhm reisistor
1 x serial port plug
2 x Servo Motor (any 5v model witch is powerful enought to hold the webcam)
2 x 3pin plug for your servo
1 x Led
4 x push button
1 x switch
1 x Breadboard

Tools :
1 x Soldering iron
1 x Pic Programmer (cheap on ebay or Diy)

Others :
1 x Webcam ?

Step 2: Flash the Pic

Picture of Flash the Pic
Get yourself a pic programmer and use the software you like (IcProg for me) and Flash the Pic with the following HEX file.

Look on the picture for the basic config.

Step 3: Soldering

ServoPod_004.jpg
Using this schematic, solder everything on the breadboard. Use the Dip socket for the Pic as you might want to flash it again.

Note : the 4 pushbutton are used for "joystick" mode. You should wire them ..on a another board with a cable.

The button wire like this :
rb0 Left (might be right..)
rb1 Right (migth be left...)
rb2 Down
rb3 up

The led is used to show joystick mode, you might want to have it remotly on the joystick board. ALSO NOTE !!! I used a internal resistor 5v led. Add a resistor if your led is not like mine (100ohm should be OK)

Your servo pin could not be the same as mine (1-5v, 2-Signal, 3-Ground) change for your need.

You need a 5v Power source

R1 to 5 = 4.7kOhm
R6 : 22kOhm

J1 = Pan J2 = Tilt
 
Remove these adsRemove these ads by Signing Up
argonmdq5 years ago
hi, how to comunicate con serial, for pan and til?, how to send data, one for pan and one for til?, width A o B and data?, i try to write delphi code, without exit. can explain please. jose.
andreq (author)  argonmdq4 years ago
I was lurking arround on the internet and tought I'd look at some of my old forum post... and guess what... I found this :

[code]

'****************************************************************

'* Name : SERVOPOD.BAS *

'* Author : André Quirion *

'* Notice : Copyright (c) 2005 *

'* : All Rights Reserved *

'* Date : 31-03-2005 *

'* Version : 1.5 *

'****************************************************************

include "modedefs.bas"

CMCON = 7

'Initialisation des variable, constante

pos1 var byte 'Variables de positionement

pos2 var byte

cont var byte 'Compteur

mode var byte 'Variable du mode

'Initialisation des valeurs

pos1 = 157 'Position centrale du servo au demarrage

pos2 = 152

mode = 0 'Mode joystick au demarrage, changer au choix

high porta.2 'Allumer la LED du joystick, changer au choix

if mode = 0 then goto joystick

if mode = 1 then goto remote

remote:

for cont = 0 to 40

pulsout portb.4,pos1 'Impulsion vers les servos

pause 8

pulsout portb.5,pos2

pause 8

next cont

high portb.7 'Handshacking hardware

serin portb.6,N2400,100,fin,pos1,pos2 'Attente des données serie.

fin:

low portb.7 'Handshacking hardware

gosub modeDetect

if mode = 1 then

goto remote 'Retour au debut des instruction

else

high porta.2

goto joystick

endif

end

joystick:

if portb.3=0 then pos2=pos2-1

if portb.2=0 then pos2=pos2+1

if portb.0=0 then pos1=pos1+1

if portb.1=0 then pos1=pos1-1

pulsout portb.4,pos1 'Impulsions vers les servos

pause 8

pulsout portb.5,pos2

pause 8

pause 20

gosub modeDetect

if mode = 0 then

goto joystick 'Retour au debut des instruction

else

low porta.2

goto remote

endif

end

modeDetect : 'Quel mode ?

if porta.3 = 1 then mode = 1

if porta.3 = 0 then mode = 0

return    

[/code]


Thats the BASIC code that compile using PicBasic Compiler. It's the code thats sits in the PIC

Don't know if you're still interested about it. Have fun :D
017066 years ago
Hello Any chance you could send me the source for the Pic and also the source code for the program please. Andy
andreq (author)  017064 years ago
I was lurking arround on the internet and tought I'd look at some of my old forum post... and guess what... I found this :

[code]

'****************************************************************
'* Name : SERVOPOD.BAS *
'* Author : André Quirion *
'* Notice : Copyright (c) 2005 *
'* : All Rights Reserved *
'* Date : 31-03-2005 *
'* Version : 1.5 *
'****************************************************************
include "modedefs.bas"
CMCON = 7
'Initialisation des variable, constante
pos1 var byte 'Variables de positionement
pos2 var byte
cont var byte 'Compteur
mode var byte 'Variable du mode
'Initialisation des valeurs
pos1 = 157 'Position centrale du servo au demarrage
pos2 = 152
mode = 0 'Mode joystick au demarrage, changer au choix
high porta.2 'Allumer la LED du joystick, changer au choix
if mode = 0 then goto joystick
if mode = 1 then goto remote
remote:
for cont = 0 to 40
pulsout portb.4,pos1 'Impulsion vers les servos
pause 8
pulsout portb.5,pos2
pause 8
next cont

high portb.7 'Handshacking hardware
serin portb.6,N2400,100,fin,pos1,pos2 'Attente des données serie.
fin:
low portb.7 'Handshacking hardware
gosub modeDetect
if mode = 1 then
goto remote 'Retour au debut des instruction
else
high porta.2
goto joystick
endif
end

joystick:

if portb.3=0 then pos2=pos2-1
if portb.2=0 then pos2=pos2+1
if portb.0=0 then pos1=pos1+1
if portb.1=0 then pos1=pos1-1

pulsout portb.4,pos1 'Impulsions vers les servos
pause 8
pulsout portb.5,pos2
pause 8

pause 20

gosub modeDetect
if mode = 0 then
goto joystick 'Retour au debut des instruction
else
low porta.2
goto remote
endif
end

modeDetect : 'Quel mode ?
if porta.3 = 1 then mode = 1
if porta.3 = 0 then mode = 0
return    

[/code]


Thats the BASIC code that compile using PicBasic Compiler. It's the code thats sits in the PIC

Don't know if you're still interested about it. Have fun :D
andreq (author)  017065 years ago
Hi, Thanks for your interest in this project, but unfortunaly, I kinda lost the source code of both the PIC and Delphi program. I'm still trying to recover something this week, but I wouldn't bet on this. I think your best solution would be to start from scratch. It wasn't that complicated to code. The PIC code was done using Pic Basic Pro compiler. I've used the based Servo example project and built around it. There is also a simple Serial/RS232 sample you could use. Good luck ;) And just to let you know, my current wecam setup is a Logitech Orbit Cam with built-in Pan/Tilt functionality ;)
orgasmotron5 years ago
can you explain how to use javascript http request
i have built de servopod , and i like it , how can i use it online ?
cause at work i would like to see my doorway

for the frame i use nerd-cam 2 (google it) enclosure , it a well made acrylic housing
it look very professional at low cost ,i use webcam xp
andreq (author)  orgasmotron5 years ago
Hi, It's a shame I never got time to finish the Delphi part of this project. I'm now using a nice logitech orbitcam :) Anyway, I think you could write your own software (VB or anything simple you might want to use). If I remember correctly (as I lost the sourcecode...in a backup problem)... to move the ServoPod from serial, you only need to send 2 coordinate (from 0 to 255) I was using PicBasicPro and ... I'm trying to remember... but I think I was only using a simple "SERIN DATA" and the data was 4 byte variable. Like... XXYY ... so if you wanted to move to 255,255... you just had to send FFFF... but also... I think on the PC part I was actualy sending 255,255 (byteshifted into each other) and the serial "socket" was converting this to a word... anyway this might sounds weird and really complicated, but I'll do my best to find the source-code... for the 4th time ;)
andreq (author)  andreq5 years ago
I just reread my instructable (funny...) and It's basicly explained (how cool I was back then!) in Step 4. Forget what I said before... I send Char... so I guest you'll have to send "FFFF" to the serial port (after waiting for DSR line to get high... I remember now!) and it will move the servo to 255,255 (actualy... 225,225 as this is the limit I implemented in the code.
clark5 years ago
i'd like to see an instructable where someone explains how to use servos, for the complete noob
amando965 years ago
i built a simple wireless one with an old RC car... it was cool and it took me ten minutes to make :)
sny2ksa5 years ago
Nice Work. :) Can u upload the source codes or send by mail sny2ksa@yahoo.com. Regards Shahid
andreq (author)  sny2ksa5 years ago
Look at my reply to 01706... It's kinda sad, but anyway thanks for your interest in my project.
Wickedweed6 years ago
hi. first of all, i must say that this is a wonderful project. i've just completed this a few days ago and i m monitoring my home and my pooch from work. do you mind sending me a copy of the source code so i can work on the software itself? jasoncws@hotmail.com
hi...any chance to send me the source code soon? thanks in advance!
Loolykinns6 years ago
Hey andreq, a quick question did you try using the parallel port instead of a PIC controller? i dont know if the parallel port's power could move the servos you mentioned. but if that possible it'll be more fun that using a PIC controller to me... If you think its possible to control and move the servos with parallel port only please let me know. or if you know any other servos that could move with the parallel port.
andreq (author)  Loolykinns6 years ago
If the parallel port is fast enought to pulse it's data line... it should be possible. You'd still have to power the servo from an external source, but the "data" line could be controlled by parallel port. You'll need to code some parallel port pulsing software but I think it could be done
can you explain the pulse software part? is it like, send data then stop then resend?
andreq (author)  Loolykinns6 years ago
I don't have more time to search now (google it) but I found this :

http://linuxgazette.net/issue97/pramode.html

It could asle be "possible" to control the servo from your soundcard output.... as it only need "pulse"... anyway try google :)
i have a problem flashing my pic it says that there is no "config word" in the file i wondered if you could send me the .asm file or the actual .hex file?! passed07@hotmail.com
andreq (author)  milo0is0hot06 years ago
The config word are written in step2
sorry i fogot to mention how good this project is!!!!!!!!!!!! very good!!!!!!!!!!!!!!1
BigRich6 years ago
I got that same programmer maybe 2 months ago but I can not get it to program a chip!
hulken8 years ago
Really cool project. Would be fun to build my own one. But it its not possible whit any servos to turn the camera 360 degrees or?
andreq (author)  hulken8 years ago
I think you can acutaly mod servo so than can do full circle, but remember that if you do so you must think about the webcam cable.. and tilt servo cable. Anyway with this setup I can almost do 220 degre witch is not bad.
As far as I know, you can't get a 360 turn from a servo, because it has a variable resistor for feedback, this can only turn so far b4 it hits the end of the track, so even removing the plastic stop from the gears inside wont work, instead connect the servo to a gear and mount the camera on that, but you still can't go beyond a certain point, before you have to turn all the way back to continue from the end of the movement.
hulken andreq8 years ago
Yes but the cabels can always be fixed in some way.. 220 degrees should be enough anyway.
andreq (author)  hulken8 years ago
Yeah cable is a minor problem...But if it is for online broadcasting with public control, you must have some way to block over 360 circle... for exemple : you have 1 to 360... but can go from 360 to 1 in 1 step, only by 359 ,358....to 1 This would remove the cable problem. but anyway.. as you said. 220 or even 200 is enought. You place the webcam near a wall or a corner and you have a full view of a room :D
you could always use those phone-cord-detanglers, or make your own.
Daedalus7 years ago
i did this ages ago forget about all this build your own PCI mumbo jumbo just get a good old RC controll unit from a old nitro car hook that up and controll it using a radio controll like i did. You could possibly even controll it up to a mile away and use wi-fi to tranmit the images back to your house if you placed your old win 98 laptop near a wi-fi hotspotand left it there!! its a good way to get rid of that old laptop as well.!!!!!!!
andreq (author) 8 years ago
That is were the magic happend.... nah... Actualy the 22k resistor do the same job as a Max232. It limit the current from the serial port so the Pic can handle the communication. And for sending, (not used in this projet) 5volt is normaly working to receive on the port.
prank andreq8 years ago
That's an incredibly cool trick--I've never seen that before
prank prank8 years ago
with the 22k resistor doing the RS232 conversion, I mean...
tek2000 andreq8 years ago
Thats interesting, would you mind of posting another schematic of the serial link the one above is kind of blurry ...
andreq (author)  tek20008 years ago
You can download a full size version by clicking on the small "i" on the top corner.
Woeka andreq8 years ago
Still not a very clear picture.
hulken Woeka8 years ago
andreq (author)  andreq8 years ago
I just uploaded a video so you can actualy how the thing move and work.

[http://ticpu.net:8080/~andre/ServoPod%20007.avi" Here (17mb...sorry)]
tek20008 years ago
This sounds really great, one question though: dont you need any extra hardware to communicate with a computer serial port, how does this work? I thought serial port is something like 12 V ??
xsmurf tek20008 years ago
I don't know much about much about PICs, so maybe they already include an RS232 to TLL regulator, but yes your right. Normally you'd need a MAX232, or similar, voltage regulator from Maxim ICs. Most devices I've worked with (mostly serial VFDs and Serial -> Parallel UARTS) will not function properly without the use of a MAX232.