Final Project





the piece



For my final project I designed a face piece inspired by Halloween masks which consist of a pair of glasses, a nose and a mustache. This digital mask contains two LCD screens mounted in the glasses' frame where pupils are displayed and act as eyes. Carbon filament thread is used as an input sensor which actuate the position of the pupils when being manipulated. The eyes are looking down the nose when the mustache is squeezed and looking straight when sitting idle.



The different parts of the project:
  1. CIRCUIT:

      Eagle was used to design the circuit which consists of an ATMega88 MCU, a AT26f flash memory IC, 3.3V voltage regulators for the two LCD and the MCU, input leads to the carbon filament thread, a couple of resistors and capacitors. Two revisions where made to the board in order to integrate all the pieces together.

      The first design was composed of a single LCD and was used to write code for the driver. The LCDs consume 130 mA (backlight) out of a 3.3V power source and are really sensible to the input voltage level, therefore I decided that use a 5V power supply instead of batteries.

      The second revision integrated the carbon filament input to the previous LCD board and code was written to perform ADC conversions to the input signal. Surprisingly the ATMega88's ADC unit gave me some trouble at first. The voltage reference did not seemed to conform with the one I provided on the AVCC pin. I had to play with my voltage divider to achieve anticipated results. I was able to display ADC results on the LCD screen with the char driver I wrote previously.

      Finally the last revision integrates two LCDs and the input device. At the end I did not used the Flash memory because I was able to compact the pupil bitmap into program memory of the MCU and testing with the system's display refresh rate was not convincing enough to implement full screen bitmap animations.

      --Design--



  2. MICRO CODE:

      Writing the code for the LCD driver as not been as trivial as expected. I did write some code for Epson based controller as part of the output device assignment but the new LCDs ordered for the final project had a Phillips based controller with different implementation of the SPI protocol. This was a surprise.

      I first started to write assembly code for the driver but switched to C code and inlined some assembly when I started to prototype animations - the code was easier to understand and maintain. My first idea was to display full screen sequences of bitmaps but as I progressed and tested the refresh rate of the display (with backgound colors) it became obvious that full screen animations would not give the desired effect. I then decided to crop my images and only display a pupil changing positions when the carbon thread is being manipulated. In order to display the pupils I had to encode the bitmap into an 8-bit per pixel format. GIMP has been wonderful in achieving this transformation because it can export images in to a char array! I used this feature and was able to compress the bitmap enough to embed the array in to the ATMega88 program memory. I found a script which parses an .o object file and outputs information about memory usage depending on the flavor of AVR . This script has been very handy in writing the bitmap array into program memory.

      A simple state machine is used to implement the logic of the interaction. The mask can be in two states, not active or active. Transition between these two states is triggered when manipulation of the carbon thread is detected through successive readings of the ADC.

      --Source code--



  3. FAB GLASSES :


      The glasses were designed using Inkscape. The designs were exported as dxf files and imported into CorelDraw before being printed with the laser cutter on an acrylic sheet. Dimension of the LCD screens was important in the layout the glasses which had to be wide enough to mount the two screens. The result was good and no revision had to be performed after the first cut.



  4. CARBON FILAMENT THREAD :


      I had been experimenting with carbon filament thread for the input device assignment earlier in the semester and decided to use it again for this final project. Actually the whole project revolves a little around the fact that I wanted to use this soft hair-like sensor as an input device. I found the thread in a Arts&Craft shop few years ago and always wanted to make something with it. It has the property of being conductive and offers low resistance (about 140 ohms per two foots). When squeezed the resistance lowers down. Therefore I decided to use it as a basic resistive sensor.