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:
bpt01.jpg
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 arduinohttp://www.windmeadow.com/node/42Boarduino, Wii Nunchucks, and Servoshttp://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.
boarduino-nunchuck-servo-450.png
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 pulseminPulse (set to 1000) - minimum pulse value for servo 1minPulse2 (set to 500) - minimum pulse value for servo 2dtime (set to10) - delay (in milliseconds) for each looppwbuffsize (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
E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • Ciao Dincer,

    as I told you the Nunchuck z-axis is almost unusable, or I've not been able to use it. But the x and y-axis are those that I used. If you uncomment "// printNunchuckData();" line you can see the reading and can see the values of the x and y-axis variation as you move the Nunchuck, and better understand how they are used then.

    The Arduino can be attached to display but usually they are not that "graphic" oriented. Usually they are 1, 2, 4 text lines that can be used via serial or i2c protocol.

    When I talk about a Gustix with LCD display I talk about a real LCD screen 4.3" wide with touchscreen overlay 16bit or 18bit colour.

    Not to mention that the Gumstix can managed 2d and 3d graphics quite easily. That's a whole different thing, but I'm sure that'll start with something "simple" as an Arduino + 4 lines serial LCD screen that I already got at home.

    But I'm preparing a more detailed post about that and there'll be more accurate in describing my controller project.

    Cheers,

    Andrea
  • hi Andrea,
    indeed i checked the Nunchuck data with Tod Kurt's NunchuckPrint sketch which can be found at http://todbot.com/arduino/sketches/NunchuckPrint/ and see that z-axis response is weak, only fast vertical movements can be read from the z-axis but still i think it can be useful to some extent. maybe for altitude correction. but i also saw that yaw reading (x,y) is also weak. how do you think we can make it more sensitive? why are you considering Gumstix for better lcd display? there are cheap and simple displays are awailable for Arduino. i even saw an old Nokia 3110 display attached successfully to Arduino on the internet...

    still brainstorming... lol..
    wish you luck and success...
    dincer
  • Ciao Dincer,

    thanks!

    That's exactly what I'll do: use a Nunckuck as a controller for my RC airplane. Maybe the next post will have a simple schematic of it. It's very easy to implement and it can be used as a 3channel radio command. But more intuitive, in my opinion.

    I made some test and the Nunchuck z-axis is not usable. I'll use an accelerometer and a gyro (on an IMU board) on the airplane for the autopilot (maybe I'll put a compass too). The Nunchuck is more than enough for piloting.

    I'm thinking about having an LCD display attached to the microcoputer (that's in the case I'll use a Gumstix). That could give me the possibility to have telemetry, GPS control/programming, Nunchkuck control all in one box. That'd be cool.

    Why do you want to add a thermometer onboard? For thermals? As I told you probably I'll test an infrared thermal array to "see" thermals. Hoping it's good enough for it. I doubt but it's a test that has to be done.

    Lot's of brainstorming :D

    Ciao,

    Andrea
  • Hi Andrea,
    i tried many Arduino sketches for nunchuck and servos but yours is the best one. very responsive... i am now trying to use your setup other way round. i will not use this for Gimbal camera but instead i will use the nunchuck servo response for actually stabilizing the plane. only rudder and elevator control. i have to find a way to stabilize the altitude... trying... as of your Thermal Sensing idea, can we use the Z-axis of the accelerometer For g sensing upwards? furthermore can we combine this with an on-board thermometer?... must think over... just brainstorming... :)

    dincer
  • 3D Robotics
    So cool! Now just interface it with a RC transmitter, and you've got a great FPV setup...
This reply was deleted.