Spooky Projects – Introduction to Microcontrollers with Arduino

spooky header
arduino usb

Spooky Projects is a set of four 3-hour classes in October 2006 hosted by Machine Project and taught by Tod E. Kurt. It is an introduction to microcontroller programming and interfacing with the real world using the Arduino physical computing platform.

In the class, participants are shown and experiment with the Arduino’s capabilities and learn the basics of common microcontroller interfacing, such as: digital output to control lights and LEDs, digital input to read switches and buttons, analog output to control motor position or LED brightness, and analog input to read sensor inputs. From these tools all sorts of interesting projects can be created. In the class, a few simple project sketches are covered using the provided parts kit, under the theme of spooky animatronics for Halloween.

The class assumes no previous electronics knowledge, though it does assume a little programming knowledge. No soldering is needed during the class, as all circuits are built with solderless breadboards.

At the end of the class, Mark Allen of Machine Project bestowed upon each of the students an awesome programming merit badge. Take other Machine Project classes to get other great geeky badges!
arduino class merit badge

Blog Posts

Class Notes

Arduino Sketches Used in Class

Processing Sketches Used In Class

  • http_rgb_led — fetch a web page, parse it, send RGB color value to Arduino. Used with Arduino sketch ‘serial_rgb_led_too’ above.
  • arduino_ball — Arduino with piezo sends a number, Processing parses it and draws a ball the size of the number.
  • arduino_spookysounds — When piezo on Arduino is whacked, Processing draws scary eyes and plays a spooky sound.
  • spook-processing-sketches.zip — all the processing sketches zipped up

Class Kit Parts

Arduino & Other Microcontroller Resources

Parts Suppliers

  • SparkFun — Arudino board and shield, and many other neat gizmos.
  • Jameco — General electronic parts, easy-to-use, also has computer parts.
  • Digikey — Exhaustive parts supplier. Cheaper than Jameco usually, has more variation, more hard-to-find parts.

68 Replies to “Spooky Projects – Introduction to Microcontrollers with Arduino”

  1. Hi mae,
    For the Arduino sketch, grab “piezo_read.pde” above and replace the “loop()” function with something that will look at each piezo and send out via serial the number of the piezo that’s been hit. Something like this:

    int numPiezos = 6;
    void loop() { 
      digitalWrite(ledPin,LOW);     // indicate we're waiting
      for( int i=0; i= THRESHOLD ) {      // is it bigger than our minimum?
          digitalWrite(ledPin, HIGH); // tell the world
          t = 0;
          while(analogRead( i ) >= (THRESHOLD/2)) {
            t++;
          } // wait for it to go LOW  (with a little hysteresis)
          if(t!=0) 
            Serial.println( i );  // print out the number of the piezo read
        }
      }
    }

    Then in the Processing sketch, you want to read that piezo number sent by the Arduino. That means the “serialEvent()” method in the “arduino_spookysounds.pde” sketch would turn into something like:

    void serialEvent(Serial p) {
      int num = port.read();
      println("num="+num);        // print out the value read
      if( num >= 0 && num < num_sounds ) {
        myChannel[num].play(1);   // play a sound
      }
    }
    
  2. hi,
    I was trying arduino_spookysounds and it works fine. I want to use six piezos. Can you tell me how to modify the sketches on Arduino and Processing so that each piezo plays its own sound?
    thanks, mae

  3. Thank you so much! I found these class notes just in time. Your class_notes are really great!!

    Giulio

  4. You’re right Mike, oops! Though that wiring diagram is a bit vague so it’s hard to tell exactly how the LED is wired up. General rule of prototyping with LEDs: if it doesn’t light up, switch the leads around and try again. ;-)

  5. Thanks so much for your class notes. There is a minor error in lecture 1. On page 29, the blinky LED circuit wiring diagram should have the positive terminal of the LED connected to the resistor (it looks like it is the negative). The schematic is correct.

  6. Oh yeah, you could totally just have one of the ultrasonic sensors be a “mod wheel” hooked to filter cutoff or pitch bend or something and the note triggers being the just the on/off light sensors.

Leave a Reply

Your email address will not be published. Required fields are marked *