Fab Academy at AS220 Labs

08 sensors, actuators, and displays

July 27, 2010 11:42 AM

Capacitive Sensing - PuppetMaster v.1-v.2

by Anna Kaziunas France

puppetv2

Puppetmaster Project Overview

My final project for Fab Academy is a universal remote I am calling PuppetMaster, due to its ability to control out of reach objects / devices using the fingers. This post details the PuppetMaster boards v.1 - v.2 that use capacitive sensing.

Capacitive Sensing Board Versions

The first working version of the prototype uses capacitive sensing built on the Hello World Step response example, but converted for use with a attiny 44.

I fabbed the board(s) myself, using the standard fab inventory parts.

PuppetMaster Board Version 1 —> pitfalls / issues

I designed my own board based on the hello step response with 3 additional inputs for each of the four fingers. (The hello step response has only one input). As the hello step response example uses the attiny 45 (and does not have enough input / charging pins for 4 inputs), I modified Shawn’s version of the hello step response to work with the attiny 44. This initial version of the PuppetMaster board has a FTDI header and 4 inputs / charge pins. PuppetMaster v.1 board v.1 However, there was a issue with this initial board and I could not get the modified code for the attiny 44 to work with the Hello.Step.45.py code. I attempted triage, but the board remained flaky. There seemed to be an issue between the ground pin on the chip and power. In addition, I realized that I routed the Tx to Rx wrong on the FTDI header pins. I was using jumpers to work around it initially, but after the version 1 board’s persistent flakiness, I decided to make a version 2 board. I am not including the schematics & Eagle files for version 1 because of these issues.

Code Modification:Â From attiny 45 to attiny 44

I modified the hello step response assembly language code to work with the attiny 44 microcontroller. Both sets of .asm files are listed below. Attiny 45 FTDI Hello Step Response Code Attiny 44 FTDI Hello Step Response Code

Puppetmaster Board Version 2

Here is the version 2 board with the correctly mapped FTDI header and some slightly shifted components to allow for more space between some problematic components. This board version has been flashed with the attiny 44 code (above) and works with Hello.Step.45.py code.

Eagle Files

Download - PuppetMaster v.2.0 Board Download - PuppetMaster v.2.0 Schematic schematic v2 board v2

CAD Image Files Used to Mill board v.2

mill tracesmill holes

Putting the Version 2 Board Together

puppet boardpuppet boardfilepuppetboard I ran out of time in the lab and did not get a chance to mill out the board. Instead, I scored the perimeter with a utility knife and broke off the excess edge. Then I used a rasp to file the edges down.

Capacitive Sensing in Action

Using Neil’s term.py program to visualize the initial charging graph and sensor input. capacitive sensingpuppetv2puppetv2puppetv2

July 27, 2010 11:28 AM

Hello FTDI Step Response

by Anna Kaziunas France

Hello Step Response

Step response board + FTDI + Capacitive sensing

My first step in building this project was to start with the basics. I milled, stuffed and programmed the hello step response board (modified to use the FTDI header by Shawn Wallace). I have a Mac and I can’t troubleshoot / develop at home with the serial header examples.

hello step response

What You Will See When The Example is Working:

I am using terminal in OS X 10.4.11Â - this was the terminal command I used to run the hello step response example and what it will say when it can communicate with the board and begin plotting the graph.

Anna-Kaziunas-Computer:~/Desktop/fab_runs/step annakaziunas$
python hello.step.45.py /dev/tty.usbserial-A600dVDy
finding framing ...
start plotting
0

This is the graph that is displayed:

Here is a screenshot of the charging graph that is produced by Neil’s hello.step.45.py code. This initial charging graph shows the capacitor charging up.

hello 44

Here is the Capacitive Sensor I Made:

capacitive sensor

I used thin copper sheets to create the capacitor to test the hello step response board. I hooked them up to jumper wires. When they copper sheets are touching or close to it, the graph will spike up. This indicates that current is flowing through the circuit. When they are far apart the graph will flatten out. This indicates that the circuit is not connected.

For a video of this type of capacitive sensor in action - see the Puppet Master posts.

May 12, 2010 1:08 PM

Levitating Elephant

by Noah Bedford

I wrote a small clutter program to change the position of a picture of a Muybridge elephant based on the output of the step response board:
hello.elephant.py
This is the code that runs on the FTDI version of the step response board
elephant-screenshot.png

April 28, 2010 10:05 AM

Servo motor mosh

by Jenine Bressner

Here is a very brief clip of a nodding head.

I attached a doll head that I sculpted (with flameworked glass eyes) to a servo motor. This will be part of a larger diorama of dancing automatons that I'm working on.

March 17, 2010 11:02 PM

Motion Sensing Glow Skull

by Anna Kaziunas France

Voodoo Glow Skull

I am ready for Halloween early this year. For my I/O sensor project for Fab Academy I put together a Arduino-controlled motion sensing glowing skull. When motion is detected by the parallax motion sensor, the board turns on the LEDs in the mouth and fades in and out the LEDs glued into the eye sockets.

The Fab Academy Assignment

  • Interface an input device with an output device.

The Project: Motion Sensing Glowing Skull

Voodoo Glow SkullVoodoo Glow SkullVoodoo Glow Skull

Parts List:

  • 1 Parallax PIR [Pyroelectric ("Passive") InfraRed)] motion sensor
  • A few lengths of wire
  • 1 Arduino compatible board (I used a Seeduino (Seeed Studios) I had laying around). I like this board because I can flip the power source switch to turn it off / on.
  • 1 9 volt battery
  • Mouth: 10mm Red LED (3)
  • Eyes: 5mm Red Wide-Angle LED (2)
  • 5 in or so metal strip with holes (to house mouth LEDs
  • 3 plastic LED holders (to insulate the mouth LED wires from the metal strip)
  • super glue / hot glue

Prototyping the Circuit / Interaction + Putting It Together:

prototypingprototyping - jumbo LEDprototypingprototypingprototypingsoldering the motion sensorLED harnessLED harnesssoldering wires / LEDgluing LEDs into eye socketsclose upskull wiringwiring containerwiring container openall wired up - ready to testGlow!

Code:

The code works - but needs to be modified, right now after the motion is activated, the lights stay on / fade in and out in an infinite loop until the power is switched off. Look for an update to this post.

Arduino code for the LEDs and Parallax PIR Motion Sensor:

/* -----------------------------------------------------------------
 Anna Kaziunas France
 --------------------------------------------------------------------
 Fab Academy - Sensors I/O Module
 Glowing Skull Project
 03/02/2010
 --------------------------------------------------------------------
 Motion Sensor code:
 Motion Sensor code:I have seen this code a few places,
 it is never attributed to anyone in particular.
 I saw it last at: http://www.ladyada.net/learn/sensors/pir.html
 --------------------------------------------------------------------
 LED Fader code by: By David A. Mellis - Created 1 Nov 2008
 Modified 17 June 2009: By Tom Igoe
 http://arduino.cc/en/Tutorial/Fading
 --------------------------------------------------------------------
 Combined / Modified by Anna Kaziunas France - 03 March 2010
 --------------------------------------------------------------------

 --------------------------------------------------------------------
 Purpose of this Program
 --------------------------------------------------------------------
 Read input value from the sensor
 Determine if motion is present (input is HIGH)

 When motion is detected via motion sensor:
 1. Eyes slowly glow red (fade in and out - continue)
 2. Mouth glows (steady)

 When motion is not detected after (length of time)
 Switch off LEDs
 ------------------------------------------------------------------*/

// Variables
int ledPinSolid = 13; // choose the pin for the LED
int ledPinFade = 11; //
int inputPinSensor = 2; // choose the input pin (for PIR sensor)
int pirState = LOW; // we start, assuming no motion detected
int val = 0; // variable for reading the pin status

void setup() {
  pinMode(ledPinSolid, OUTPUT); // declare Solid LEDs as output
  pinMode(ledPinFade, OUTPUT); // declare Fader LEDs as output
  pinMode(inputPinSensor, INPUT); // declare sensor as input

  Serial.begin(9600);
}

// Begin Motion Detection
void loop() {
  val = digitalRead(inputPinSensor); // reading input value
  if (val == HIGH) { // if the input is HIGH
    digitalWrite(ledPinSolid, HIGH); // turn LED ON
    // sets the value (range from 0 to 255):
    analogWrite(ledPinFade, HIGH); // turn LED ON
    // fade in from min to max in increments of 5 points:
    for(int fadeValue = 0 ; fadeValue < = 255; fadeValue +=10) {
      // wait for 30 milliseconds to see the fade in effect
      delay(400);
    }
    // fade out from max to min in increments of 5 points:
    for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=10) {
      // sets the value (range from 0 to 255):
      analogWrite(ledPinFade, fadeValue);
      // wait for 10 milliseconds to see the dimming effect
      delay(110);
    }
    if (pirState == LOW) {
      // we have just turned on
      Serial.println("Motion detected Huzzah!");
      // We only want to print on the output change, not state
      pirState = HIGH;
    }
  }
  else {
    digitalWrite(ledPinFade, LOW); // turn Fader LEDs OFF
    digitalWrite(ledPinSolid, LOW); // turn Solid LEDs OFF
    if (pirState == HIGH) {
      // we have just turned of
      Serial.println("Motion ended");
      // We only want to print on the output change, not state
      pirState = LOW;
    }
  }
}

Skills Learned

  • Basic wiring
  • Modifing Arduino code
  • How to read a sensor datasheet

Tools Used

  • Arduino
  • Paralax motion sensor

March 17, 2010 8:52 AM

The Gellerizer

by Elliot Clapp

gellerizer1.jpg

gellerizer2.jpg

gellerizer3.jpg

gellerizer5.jpg

gellerizer6.jpg

gellerizer7.jpg

gellerizer8.jpg

gellerizer9.jpg

gellerizer10.jpg

Return to front

Older articles