I have thought about how to use it useful and have tested with two servos, but I had no time to proceed that project which have sit on my desk for a long time.
Recently, when I hang a picture frame on the wall at home, I got an idea to use the Wii Nunchuck more useful. That is the electronic level like a bubble level (or spirit level) using the accelerometer of the Wii Nunchuck and Arduino compatible board, JeonLab mini v1.3. Why JeonLab mini? Because 1) it is small enough to integrate into a small case; 2) once the program is loaded, the FTDI interface is not needed; and 3) since I'm going to use a small power supply, I don't need the 5V regulator circuit. It's a minimal Arduino, so you can easily make one on a small piece of prototype board.
What this Arduino spirit level does is to show whether the surface or edge (picture frame or a table for example) is leveled or not by displaying LEDs. If it is leveled, the central red LED is lit, otherwise the left or the right LED will turn on depending on which side it is tilted. It works similar to a bubble level, so if it tilts left the right green LED will turn on. I like this way but if you don't like, you can modify the program and load it through the FTDI breakout board which can be plugged in at the top right corner of the JeonLab mini board as shown in the picture.
In the later steps, you will find the entire circuit diagram and Arduino codes for this project.
Remove these ads by
Signing UpStep 1: Circuit diagram
The circuit is quite simple. There is a minimal Arduino compatible board, JeonLab mini v1.3 on the left of the diagram. As you can see, if you have an ATmega328P chip with Arduino bootloader, a 16MHz ceramic resonator, and a few resistors and capacitors can replace it. There is no built in FTDI interface so you need an external FTDI breakout board or FTDI-USB cable to load the program. But that's not a big deal and good to reduce the whole size.
The accelerometer board is from a broken Wii Nunchuck and it can communicate via I2C interface: 3.3V, GND, data pin (SDA) to Arduino analog input pin 4, and the clock pin (SCL) to Arduino analog input pin 5.
The digital pins 5 to 9 are used to illuminate the LEDs to show which direction it is tilted. The digital pin 10 is normally pulled down through a 10k resistor and goes HIGH when the calibration switch is pressed and connect the pin to V+.
After some trials, I decided to use a 12V A23 size battery and a 3.3V regulator to provide 3.3V to both the accelerometer and the Arduino.
IMPORTANT NOTE ON THE POWER SUPPLY
The power supply I initially thought was 3.0V battery, so I thought sharing the power should be fine. BUT I forgot the program upload through the FTDI. The accelerometer chip and the I2C interface need 3.3V (3.0-3.6V) and the ATmega328 on the JeonLab mini v1.3 (and other Arduino compatible boards as well) can work at 3-5V. The Nunchuck data reading header, nunchuck_funcs.h (from WiiChuckDemo by Tod E. Kurt) provides the settings for utilizing the analog pins 3 and 2 as power source for the Nunchuck board but this provides 5V, not 3.3V. The problem is that 5V supply to the Nunchuck board could damage the chip(s) either the accelerometer or the I2C chip or both. Actually, the first one I used had gotten unstable and noisy after several times of tests, so it had to be replaced with a new one. That’s when I decided to change the power source from the 3V battery to 12V battery with a 3.3V regulator and added a Schottky diode (1N5819) to protect the Nunchuck board from FTDI 5V supply. This way, when the FTDI is connected, the 5V from a USB port ONLY powers the ATmega328P and not the accelerometer board.












































Visit Our Store »
Go Pro Today »




Ralph
http://gettheworkdone.net/Projects/images/Fuzzy_Circuit_Design.jpg
Kinda fuzzy.
Ralph
Once you click on it, it will open Instructable image library page and there is a link for a full size picture just under the image. Here is the link: http://www.instructables.com/files/orig/FEL/VRLG/GZPBM6U9/FELVRLGGZPBM6U9.png
I'm using Firefox and have no problem.
Ralph
Also any idea of accuracy, how sensitive is it?
Ralph
As for the accuracy, I have no quantitative data but as you can see in the video, slight (I don't know how many degrees) tilt changes the LED state.
http://www.instructables.com/id/Make-your-own-1x1-22-IO-pin-Ardunio-Compatible/