3D Map Control

3D Map Control is a project for the Arduino Development Environment that uses the Arduino development board to read, decode, and transmit data received from the Wii Nunchuk to a computer.  A simple Processing/Java application running on the computer reads the Wii Nunchuk data from the Arduino development board and makes it available to any modern web browser through a simple web service.

The goal of the project is to use the Wii Nunchuk to control mapping applications such as Google Earth in the web browser.  JavaScript code to control the Google Earth web browser plug-in with the Wii Nunchuk is included with the project.  

Here is a video demonstration of the 3D Map Control project controlling Google Earth:

Actions supported by the 3D Map Control are:

  • Jerk the Nunchuk up or down to reset the camera
  • Press the C button to zoom out
  • Press the Z button to zoom in
  • Tilt the Nunchuk up or down to tile the camera up or down
  • Tilt the Nunchuk left or right to rotate the camera left or right
  • Use the joystick to pan the camera left, right, forward, and backward

Camera tilt, rotate, pan, and zoom operations can all be performed simultaneously.   

The Arduino portion of the project is fairly simple.  The Nunchuk is connected to the Arduino's I2C controller and a simple program reads data from the Nunchuk, which is transmitted to a computer through the serial device:

3D Map Control

I have attempted to illustrate the pin connections for the Wii Nunchuk with the following ASCII art:

 

                 NC
             __  |  __
            |  \___/  |
  Clock ->  | *  *  * |  <- GND
   3.3V ->  |_*__*__*_|  <- Data
                 |
                 NC

The data line connects to the Arduino's analog pin 4 and the clock line connects to the Arduino's analog pin 5.

The web server application, written with the Processing programming language, makes use of the HttpServer package from the JDK for serving web pages (Processing is a specialized version of Java).  Control of Google Earth is achieved with custom JavaScript code that uses the Google Earth API to manipulate the view of the globe.  

Building Your Own 3D Map Control

Source code for the Arduino IDE and the Processing IDE to help you build your own 3D Map Control for Arduino are freely available, distributed under the terms of the open source MIT License.  You can find all of the relevant files in my Arduino projects repository hosted by GitHub:

git://github.com/dgraves/ArduinoProjects.git