Monday, August 18, 2014

Arduino Library for Adafruit's 2X16 LCD Shields

In order to make programing my camera dolly's user interface easier, I decided to create my own Arduino library. While there were a couple navigation libraries for Adafruit's 2X16 LCD Shields, I wanted to learn how to write a library, something that I haven't done before. Additionally, I had in mind a simpler interface than what I found online and wanted to make numerical input more efficient by entering numbers by place value.

Here are a few features:

  • Intuitive menu navigation
  • Supports selection of multiple options
  • Numerical input of integer and decimal values
  • Optional delay for static menus
  • Optional menu headings
The .zip file containing the library itself, examples, and documentation can be found here. To get started, go to the "documentation" folder and open "home.html". From here, you can learn how to install the library. Additionally, the page can direct you to several examples and the library's function list.

Many thanks to Prof. Silvan Linn, Grant Paul and Cheng Cheng for their generous help.

Tuesday, April 1, 2014

Arduino Camera Dolly

As a summer project, I decided to design and build a programmable camera dolly in order to take time-lapse footage. An Arduino microcontroller is the "brain" of the dolly and runs a medium servo and two stepper motors through a pair of Big Easy drivers. The steppers are both NEMA 17's and have 400 steps per revolution. The stepper that controls lateral movement moves the dolly at 0.1 mm per step while the stepper dictating rotational movement turns the camera 0.25 degrees per step under half-step mode. The whole system is held together by custom 3D printed parts I designed in Solidworks, two 3/4 in plastic pipes, and a few shafts, bearings, and belts. The LCD screen displays a simple interface that can be used to change the camera's path before it takes the photos that are stitched together to make a time-lapse film.

From this project, I learned a great deal about stepper motors, LCD interfacing, coding, and 3D printing. The entire process allowed me to discover the many caveats that become apparent as things start or stop working for no apparent reason. 

There’s a minor problem with the rig. The servo doesn’t keep the camera in position 100% of the time. I’m not sure if it’s because it’s not receiving enough power through the extensive wiring or it’s just too weak. Either way, it’s a bit of a problem because when it does draw too much energy the Arduino resets.

Here are a few things I learned through the process:

3D printing
  • To avoid bolts and screws. If it’s not a tank, there’s no need to design it like one. 
  • To use epoxy. Better yet, print everything in one piece if you can while still maintaining every parts’ integrity
  • How to take into account printing tolerances along the different axes
  • Making sure every detail is worked out in Solidworks. It prevents things from getting messy later.
  • LCD interfacing
  • The AccelStepper library
For the next iteration:
-No bolts or screws
-Everything down to the wiring will be modeled in Solidworks
-Less wiring
-An infinite degree of rotational freedom around the z-axis

Update: The problem with the servo was simply that I was running it directly off the Arduino so the amperage was too low. This has been fixed with a UBEC that provides enough current and correct voltage. I finished CADding the the structural components of the camera dolly; all that's left is the wiring, which I've never done before, so it should be fun. Here are a couple pictures:

Many thanks to Prof. Silvan Linn at San Francisco State University for his guidance and support.  

The New York Times Crossword Puzzle

Below is a picture of the crossword puzzle that I constructed for The New York Times. Edited by Will Shortz, the puzzle was published on Monday, January 30, 2012.
To do the puzzle, simply download the PDF here. You can also read Wordplay, the NY Times blog that includes readers' comments in response to the puzzle.

Night Sky with Python

After seeing the digital planetarium exhibit at the California Academy of Sciences, I decided that I wanted to paint the night sky on my ceiling and walls using glow-in-the-dark paint. To do this, I wrote a Python program to chart each star's position and magnitude relative to a single point in space. I plan to complete the project in Summer 2013.

The images below are screenshots of the scalable vector graphics (SVG) that were generated by the program.

To see the SVG pages, click the links below:
Night sky
Ursa Major and Ursa Minor
Stargate-like projection (see 2001: A Space Odyssey)

Click here to access all files from the project, including the Python script, a readme file with detailed instructions, and a .zip archive of everything.

Night Sky

Ursa Major and Ursa Minor

Stargate-like Projection

Origami Models

I constructed the origami models shown below between 2009 and 2012. Most are based on existing designs by the origami master Satoshi Kamiya, indicated by the initials SK, and a few are my personal designs. All are constructed from an unbroken sheet of paper. Click on each image to enlarge.

Divine Boar (SK)

Ancient Dragon (SK)

Ancient Dragon detail (SK)

Giraffe (personal design using chewing gum wrapper)

Ring (personal design using one dollar bill)

Unicorn (SK)

 Wizard (SK)

Piano 2012

The three pieces below were recorded on November 30, 2012 at the San Francisco Conservatory of Music. John McCarthy, piano teacher. Click here for my piano resume.
Click on each title to hear the pieces (audio only).
The mp3 files can also be downloaded here.

Bach - Prelude and Fugue in C Major, (WTC II) BWV 870
Length: 4:38

Prokofiev - Sonata No. 4 in C Minor, Op. 29, Movement I
Length: 5:39

Chopin - Nocturne in C Minor, Op. 48, No. 1
Length: 5:53

Piano 2009-2010

The two videos below are from 2009 and 2010. Jacqueline Divenyi, piano teacher.
Click on each link to see the videos.

Chopin – Nocturne in D-flat Major, Op.27, No.2
Length: 5:45.
2010 San Francisco Chopin Competition for Young Pianists
Honorable Mention
San Francisco Conservatory of Music
Saturday, June 5, 2010

Bach - Concerto in D-Minor (S974) Adagio-Presto (after Marcello)
Length: 5:00
Bach Junior Festival. Berkeley, California
Sunday, March 22, 2009