Camera Panning Using Parallel Port Controlled Floppy Drive
The set-up:
Webcam view:


Howdy folks,
I’ve finally managed to control the stepper motor found in 3 ½ inch floppy drives! It took me almost 3-4 days to accomplish this. The first floppy drive I tried using had a broken stepper motor. So, I went to a computer service center and asked if they had any unused floppy drive they could give to me. They gave me three old floppy drives and didn’t charge anything! I connected these floppy drives to my computer’s motherboard to check if they actually worked. All of them worked perfectly. I opened their outer covering and for the first time had the opportunity to see how a floppy drive works under the hood.
Here are two articles which helped me in controlling the stepper:
According to the instructions on these articles, I tried connecting the floppy drive connector cable to my computer’s parallel port. I didn’t take out the stepper motor from the floppy drive because floppy drives have a built in controller which is capable of controlling the motor. Anyway, the connections I made were:
Floppy Drive--------------------------------Parallel Port
PIN # 18 (Direction)------------------------>PIN # 2 (D0)
PIN # 20 (Step)------------------------------>PIN # 5 (D3)
PIN # 14 -> Ground (Drive Select A)
All odd pins on the floppy drive connector are Ground pins. For example, pins 5, 7, 9 etc.
To make the stepper motor on the floppy drive move, first we have to ground pin 14 on the floppy drive connector. This is done to select the drive electronics. Grounding pin 14 selects Drive A (my floppy drive is jumpered as drive A). Then, we have to send a step pulse to pin 20 of the floppy drive connector to make the stepper move. The direction of movement is determined by the high/low state of pin 18 (the direction pin).
To control the stepper motor through my parallel port, I wrote a program which sent step pulse signal to D0, which is normally high. One low going pulse at step pulse line makes the stepper motor take one step.
All this sounds pretty straight forward, but trust me, I had all the difficulties in the world. The main problem was in my program. The values it sent to the parallel port were incorrect. So after a lot of testing with a multimeter and LED (used as a logic probe), I finally managed to fix it. Now, I am able to control the motor and move it in any direction.
After controlling the motor, I thought, what am I gonna do with this thing? I decided to somehow hook the motor to a camera and move it. With a little bit of construction, I attached the camera to a CD case cover. Then, I hooked the cover to the R/W head on the floppy drive. Whenever the stepper moves the head forward, it pushes the CD case cover open. When it moves backward, it pulls it. Pretty cool, eh? Check out the video and pictures above to get a better idea.
Well, I feel great right now! I can’t tell you how happy I feel. :) This project has taught me a lot about how floppy drives and stepper motors work. Now, my brain is full of all sorts of awesome ideas. I’m planning to write a program which will make the camera turn towards the brightest point in its field of view. In my case, this bright point will be a laser dot. So, if the laser dot is to the camera’s right, the stepper would turn the camera till that dot gets near the center of the camera’s view. Another wonderful implementation could be to make the camera follow a moving person! I already have some experience on motion detection, so this shouldn’t be very difficult.
If you found this post interesting (or even if you didn’t), do send me your comments. I’d love to hear from you. :)
See ya…Keep visiting!


50 comments:
Just got to know about your project via Scott Hanselman's blog.
Awesome Ashish! Its amazing that you are experimenting successfully :-) with this stuff at this young age.
Keep up the good work.
-SourabhM
ashish, dude! you're cool!
Keep these posts coming regularly. I would love to know more about your programming exploits.
BR,
~A
Thanks for the kind words guys..I really appreciate it. :)
I'm working on some more fun computer projects right now..Keep visiting!
Ashish :D
Cool! I wish I had that much time to experiment. Keep up the good work!
nice
Very, very good! I would like to ask you is any chance to get source code of your program. I have problem with LPT signals. My e-mail is: damir.h@excite.com
great job. after thinking about it i was wondering if you could modify the light tracking program and combine this and the usb controled airsoft gun hack then you could paint a target with the laser and shoot the target. but i know verry little about programing so i dont know how hard that would be
I'm planning to do this. Are USB nerf weapons available??
You are a genius!
This is very cool! An the use of a simple CD cover was clever.
Great job!
USB Nerf Weapons... Hmm, brings thoughts of using multiple USB interfaces and stepper motors. Robotic PaintBall! Now to learn about USB interfaces....
well insted of using floppy stepper i prefer a small motor from printer.so that we can avoid all the mess from floppy drive and we can make a box with stepper connected to the bottom of the webcam.
so do u have any such design.ur current design is nice but iam thinking of compact version.
Yes, it's possible to connect a stepper motor without all the floppy drive stuff. There are several articles on the net which have instructions on doing accomplishing this. Just do a google search. :)
Cool project and wery intresting :)
hello
your work is really nice and great
can u please send me a copy of your code program .. i would like to see it and see how do you control the stepper motor
send it to my e-mail please : taisso_k@hotmail.com
very great project ! i would like to get a copy of the source code please , send it to it please : qais_k2001@yahoo.com
in c#, how can i, send a bit of entrance, (photodiode bit) and then that response the pulse to the stepper motor (to what port, 10,11,12,13?) how the code goes?
:(
can u respond me to franck_85@yahoo.com
hi boss !! u r really great man...cool... how did u got d idea for all these...any way can u just send me the source code of it to my id...its shankar.np@gmail.com...
hey boss me too planning to do something exciting for my engg mini project...can u suggest me some thing like the one u did ...hw abt controlling a remort control toy car using ports...pls help me out? mail me at ...shankar.np@gmail.com..
hi sir your work is great...
u done really a nice thing .
sir i have my final year project "PC BASED HEIGHT MEASUREMENT SYSTEM"
in which we r using using infrared Tx Rx for height sensing .
but for up n down we r using stepper motor .but we r facing problem in that part .
plz can u send me the program or ur project report to me .
i m very thankfull to u for ur kind act.
my email id is
yadav.kr.anil@gmail.com
These comments have been invaluable to me as is this whole site. I thank you for your comment.
can help me o control a cd drive step motor
one hell of a programmer
Hi Man, i from Mexico, I read about your project, i think is amaizing. congratulations for you great idea!.. is to amaizing to the motion project idea..
I be so happy if you can add to you IM, i use the Live Messenger, my email is javyermtz@hotmail.com
I hope you can contact me.. i want to lear to do that.. hehe
Congratulation man again!!
Be happy!.
Javi Martinez.
Monterrey, Mexico.
Hi I'm Alain from Canada
Nice work, it will help a lot.
Is the code avelable.
Sorry for my english
Ciao
Hello Alain,
The source code is available here - http://www.codeproject.com/cs/system/floppystepper.asp
Hello ashish,
I saw your project which is wonderful.I also inspire by that but i face one problem.In my project control stepper motor through PC.In whicch i programming in Turbo C.I control stepper motor which operating votlage is 12 volt through PC. Now i required small stepper motor for my application.so i used floppy drive stepper motor.I removed this stepper motor from floppy drive & applied same logic through parallel port.But this floppy drive stepper motor is not rotate.I considered this motor operating volt is 5.so plaese give idea about this things.
Thank you.
my mail id: diyora.ankur86@gmail.com
hello ashish,
can u please send me a copy of your code program .. i would like to see it and see how do you control the stepper motor
send it to my e-mail please :
naim_snyper@hotmail.com
thanx..
Hi,
I have just been sent a link to your site. I have been trying to drive a FDD head-read motor for some time, but could find very little info. Then someone found Tomi Engdahl's web-site and, using this, I did what you have done here, i.e. I drove a motor ( except that I didn't use a computer. My set-up was very basic; the motor simply turned.
It was surprisingly easy. However, within a minute, the motor stopped and I cannot get it to turn any more. Both motor and its control chip were hot. I suspected that continuous rotation ( not how it normally works ) causes fatal overheating.
What is your experience?
Regards
Bruce (UK)
Bruce: I have experienced that thing myself. This sometimes happens when the motor heats up. Don't rotate your stepper continuously for long periods of time..and release it (de-energize all its coils) whenever its not moving.
hey Ashish,
Good work, Keep It Up!
Open the floppy drive and theres a big broad & flat stepper motor.just lift the circular cover and you can see the whole of the inside! Its truly amazing.
Joel
joel_m_pinto@yahoo.co.in
Hi
I don't have a floppy drive cable so can we control the floppy drive without it?
Please tell me what connections i have to make in the absence of the cable.
Joel
joel_m_pinto@yahoo.co.in
Hi Joel,
Yes you can do it without a floppy cable. You might have to solder some wires to your floppy drive though. Just make the connections described in this article -
http://www.codeproject.com/cs/system/floppystepper.asp
Cheers,
Ashish
Good work, it sounds a bit brutal on the motor. I like the use of a CD case as a hinge. If you're still experimenting with this stuff you should look at servo motors. They aren't too expensive and are ideal for positioning tasks. They often use analogue inputs between a set voltage range then match the input with a output angle. Use two and you have horizontal and vertical. You could build two 4-bit ADCs (16 point resolution) using a handful of resistors and attach to the 8-bit output of the parallel port. This way you'd have a full pan and tilt camera.
All the Best
Dr Matt
Ashish,
You've come up with a lot of cool shit recently. This is the post which originally drew me to your site. You think u could control the stepper motors even if the drive wasnt connected through the parallel port? what would the code for that look like? Also how do you send a value to the parallel port? I've been trying to write my own code but I just learned C#.
thanks and again good shit...the CD cover thing was ghetto and brilliant.
great idea, you are very ingenius! this inspires me to use floppy to build a miniature cnc mill!
hi,
nice job man but i want to know something about can it is possible to connect webcam with 8-bit parallel port.
if u find something then please reply me on my e-mail add ronak.gcet@gmail.com i am waiting for ur reply please
Hello ashish ,
i have done project controlling motion of tool in cnc trainer lathe in which some operations like tapering,turning etc....have done using two diff stepper motors now my intension is to go towards making threading,knurling...can u have any idea to prepare g codes for the same?my ID:gurunath_1986@rediffmail.com
hii..
nice project..even i'm working on control of stepper motor..hey can u just mail the source code of stepper motor control to 1swaroopa5@gmail.com..
Thank you in advance..:-)
Swaroopa..
Sir your documents are not worked . when I click tha link the page cannot find error found . now tell me how would I access this articles
Hi
Can u send me ur program code my email id is sanayaseen1@hotmail.com
I recently came accross your blog and have been reading along. I thought I would leave my first comment. I dont know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.
Joyce
http://www.shunmigraine.com
Hi Ashish, your projects are very good! I'm Edin from Bosnia. I want to control 3 floppy drives with one parallel port cable, is it possible? Thank you!
@Edin: Hey Edin, since there are 8 data ports on an LPT port, you should easily be able to control three floppy drives with a parallel port.
Good work dude! Reminds me of my final year project days. :)
nice videos
i like your blog ....
hello ashish,
can u please send me a copy of your code program .. i would like to see it and see how do you control the stepper motor
send it to my e-mail please :
Thats a very interesting post. I have been inspired. Thanks. Web Designer
Hi this is a nice post and nice overview about using the parallel port controlled floppy drive.
i am Web Designing
expert and i like your blog!
Post a Comment