Netduino home hardware projects downloads community

Jump to content


Photo

PanAndTilt


  • Please log in to reply
7 replies to this topic

#1 Veetrik

Veetrik

    Member

  • Members
  • PipPip
  • 12 posts

Posted 13 May 2011 - 04:01 AM

Pan And Tilt Project

This project is used to control a webcam's orientation from any web browser. I developed this so that I could monitor my back yard remotely (via VNC while at work) to see what animal(s) are eating my plants.

The project hardware consists of two servos for controlling the pan and tilt of a webcam by the Netdunio+. The Netduino accepts commands via the network and moves the appropriate servo using the Servo_API from Chris Seto. It uses pins 9 and 10 for the servos. Make sure that you hook the Netduino via the power jack to a 9v brick since the USB connector can not supplied the required current for the servos.

Posted Image

The commands are sent from any browser by using the Netduino+ IP address (e.c: http://192.168.0.104) followed by /PanTilt.htm as the URL. In my setup I use: http://192.168.0.104/PanTilt.htm.

PanTilt.htm is a small HTML file that resides on the Netduino+ SD card. It displays arrows for controlling the camera position. When you press on the left arrow, the browser send a 'L' to the netduino via Javascript. The Netduino+ PantAndTilt application (which is a modification of my MicroServer application) server the page of the SD card and translate the commands, in this case into a 'left' command for the servo that controls the x-axis. There are commands for up, down, left, right and center.

I got the following Parts from SparkFun for this project:

Servo - Medium (ROB-10333)
Pan/Tilt Bracket (ROB-10335)

I believe SparkFun recommends the smaller servos for the bracket, but I was able use the
medium servos. You will need to play around with the servos, especially the one for the Y-axix (tilt) to make sure the alignment is straight one the application starts the servo's at the default 90 degrees.

Posted Image

Make sure you copy the contents of the web folder to the root directory of the SD card before testing the application. Good luck finding those animals!

Attached Files



#2 Michel Trahan

Michel Trahan

    Advanced Member

  • Members
  • PipPipPip
  • 155 posts

Posted 13 May 2011 - 02:55 PM

I thought we should never connect motors directly to the netduinos because of spikes ... just a thought !
Started with C in 1985, moved to Vb3 ... to vb6 and stopped. Now started with .Net and learning C# and VB.net and wishing VB.net was on MF !

#3 Veetrik

Veetrik

    Member

  • Members
  • PipPip
  • 12 posts

Posted 13 May 2011 - 04:15 PM

I'm not really a hardware person as you may have guess. So while this circuit did work, I think its advisable to look into adding drivers to protect the Netduino from the spikes. I will post an update when I have a safer circuit. Thanks Michel for the heads-up.

#4 Michel Trahan

Michel Trahan

    Advanced Member

  • Members
  • PipPipPip
  • 155 posts

Posted 13 May 2011 - 04:20 PM

Thanks Michel for the heads-up.

No thanks needed, I'm much of a newbie too so ... just saw the diagram and got shivers ... lol
Started with C in 1985, moved to Vb3 ... to vb6 and stopped. Now started with .Net and learning C# and VB.net and wishing VB.net was on MF !

#5 Veetrik

Veetrik

    Member

  • Members
  • PipPip
  • 12 posts

Posted 14 May 2011 - 05:28 PM

I have done some research on this and it looks like you can connect a servo directly to a pwm pin (see forum. I have not run into any problems by the original circuit, but as a precaution and since I'm familiar with TTL circuits I decided to add a 74LS04 chip as a buffer. This chip has six 'not' gates in it. Each gate inverts the single, so we need to use 2 gates for each line in order to get the correct signal out. I'm sure that there are many other ways of isolating the pins, but this is what I had available. Below is the breadboard diagram.
Posted Image

The thing about servos is that they use the +V pin for most of their current, the pulse pin seems to draw a small amount.

http://www.youtube.com/watch?v=W1WQ3EzciOA

#6 apitsuikka

apitsuikka

    New Member

  • Members
  • Pip
  • 2 posts

Posted 07 July 2011 - 03:31 PM

Hi. Good work! But is it possible to change the ip-address to static? and print the address to the debug terminal? I am having problems with my router.. static seems to work better.. I am getting these; CLR_E_FAIL errors and newer get that time from network.. Sometimes I can ping the address .104 and get to the Web-page, some times I can't.. var networkInterface = NetworkInterface.GetAllNetworkInterfaces()[0]; networkInterface.EnableStaticIP("192.168.0.104", "255.255.255.0", "192.168.0.1"); //networkInterface.EnableDhcp(); Debug.Print(networkInterface.IPAddress); I was trying to change it like that, but didn't manage to get it right.. Thanx! Also I would wan't to add more buttons, just to rise some I/O pins Up /Down...

#7 tel001

tel001

    Member

  • Members
  • PipPip
  • 13 posts
  • LocationVancouver BC

Posted 15 August 2011 - 01:19 AM

Very nice!...

#8 r1ch4rd

r1ch4rd

    New Member

  • Members
  • Pip
  • 7 posts
  • LocationIpswich, UK

Posted 24 August 2011 - 02:25 PM

This is great! I am trying something very similar as my 1st project :D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2010-2014 Secret Labs LLC  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.