Hi all,
this post is an "how to" for an Arduino pan and tilt camera moved by a Nintendo Wii Nunchuck.
Here's the video so you can check how it'll be the result. The most important thing is the precision and responsiveness of the system.
Here it is for all that asked me in the past and for those interested in putting something similar in their UAVs.
It's an "old" project I've posted the following video on YouTube more than a 5 months ago but never had the time to post schematics and the code online, even if a lot of people asked for it.
I use an Arduino Diecimila board to have a Nintendo Wii Nunchuck control a camera mounted on a
pan and tilt mechanism with two servos (Hitech HS-422).
Nunchuck's accelerometer (an
ADXL330) is used to move the camera.
As you can see, if the Nunchuck's "Z" button is pressed, the camera position is locked.
Here is picture of the pan&tilt mechanics with servos:
First of all I got to thank a few people that before me putted their experiences online. That simple project is based on the code and infos found on the following pages:
Read wii nunchuck data into arduino
http://www.windmeadow.com/node/42
Boarduino, Wii Nunchucks, and Servos
http://todbot.com/blog/2007/10/25/boarduino-wii-nunchuck-servo/
Here's a simple schematics on how to connect the servos and Nunchuck to the Arduino. Servo's pins are 6 and 7.
The code is
here.
You can find more infos about the code in the two links I mentioned before, but feel free to ask.
The only section you should customize to adapt to your servos an need is a list of variables:
refreshTime (set to 20) - minimum refresh time for servo pulse
minPulse (set to 1000) - minimum pulse value for servo 1
minPulse2 (set to 500) - minimum pulse value for servo 2
dtime (set to10) - delay (in milliseconds) for each loop
pwbuffsize (set to 10) - how many values has to be buffered and the averaged (that's the same value for both servos)
Next post will be regarding the evolution of that interface: changed camera and servos with a smaller and ligher one (
this one) and made the connection between the Nunchuck and the camera, wireless.
Hope that can be helpful and feel free to ask anything about that.
Thank you and ciao,
Andrea
You need to be a member of DIY Drones to add comments!
Join DIY Drones