spooky headerarduino 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.

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.

44 Responses to “Spooky Projects - Introduction to Microcontrollers with Arduino”

Will the rest of the class notes be made available? I am interested in using them for the High Tech Explorer Post that I am an advisor for.

Yup, after each class I’ll post the notes and any code or links references within.

This is great. It made me go and buy an Arduino and now I can’t wait to use it. Thanks for publishing the class notes, it’s really helpful to someone (like me for instance) that is poking about with electronics but doesn’t know any theory. At all. Thanks again!

Wow. This is super! Next week I’m going to attend an Arduino workshop and as I will probably be the only not so programmy and female individual, I wanted to have a surf and sniff around some arduino-related websites, which is how I ended up here. I am really impressed and I think it is tooootally great that you post all your notes. May you have a lot of nice work and recognition :-)

Yeay from Brussels!

Your class_notes are really great!! Can we expect more and if yes, when? Thank you!

Thanks heaps for these notes - just got the board and am really enjoying trying out your suggestions - a fine resource - thanks

hello, thank you spooky ! I translated many of your skteches and words in french for my Arduino’s workshop booklet. great work !

Part one says “Complete kit manifest with part numbers will be online” - is this available somewhere and I’m just not seeing it?

Thank you so much! I found these class notes just in time. I volunteered to teach a few of our Linux LUG members some embedded development and was just beginning to put together the required courseware. This is exactly in line with what I was hoping to do and will save me SO much time that I can’t thank you enough.

Tophat, you’re not missing it, I’ve not done it yet. I forgot about it actually. Look for it in a few days.

I’ve added the parts list finally. :)

The arduino_ball.pde creates vertical ovals with a gradient from pink to blue. Here is a picture of it: http://img441.imageshack.us/img441/1393/arduinoballerrorgo4.jpg

Tim, yeah that’s what it’s supposed to look like. I guess ‘ball’ is a misnomer. You can change how far ‘long’ the ball is by adjusting the value ‘100′ in drawball().

Thanks Tod!

Thanks for the notes, i’m a keen ameteur myself and i found your notes a great help, thanks again, your a star.

Thanks, Tod, for these excellent learning resources. I, and I’m sure many others, are indebted to you.

[m]

thank you for all this information- it has being very helpful

Hi, this all looks awesome! Will utilize the code for reading the piezos, to make my own drum triggers. Lots of other cool ideas here too.

Have you used Arduino for reading distance sensors? I’m pretty confident I can get standard ultrasound ones working (same as pots or a photoresistor which are no problem), but I’m looking to use lasers as I need the measuring beams to be ultra-narrow. Wondering if you’ve ever hacked around with something like this.

This is part of a 12-string “Laser Harp” I’m building (break beams = trigger note or other events, but I’d like hand-height to give a continuous value along with it). Jitter and a camera could easily do it using color-tracking along the appropriate “column”, but it bogs things down a bit and makes the harp non-stand-alone…

I’m OK with the Arduino and quite familiar with Max (where the interface will be). Just need some electronics ideas (or a juicy link which I’m been searching in vain for) that you might have come across, that would be ever so helpful!

Great work, and thanks for the info. Would love to participate in the class and show some of the cool things you can do with Max and physical computing, it’s definitely worth a serious look if you’re into this sort of thing… plus it gives a interesting different “take” on programming.

–CJ

Hi CJ,
Most laser harps I’ve seen (look around on the net, you can probably find plans for a few), use LEDs/lasers as the light emitter and phototransistors/photodiodes as the receiver. They’re strictly an on/off detector, and the circuit is the same as any other type of “optical interrupter” that you’ll run into in, say, robotics. If all you want to do is measure “off” (hand breaking the beam), you’ll have no problem, and will be able to detect how long the hand is breaking the beam too.

If you want to measure how far away the hand is from the light source, that’s measuring distance, and measuring distance is a bit harder. To do so cheaply, an ultrasonic rangefinder is commonly used. Not sure how they would work if there were twelve in close proximity.

Let me know when you get your laser harp working, I’d love to see some pics of it.

Thanks todbot, I think I’m going to go with those parallax ones, experiment a bit. They might be good for some “master” controls rather than individual string controls. I’ll see what else is out there for possibly hacking into a commercial laser-measurer, or putting one together with parts somehow, if I want that (and it doesn’t cost more than it’s worth).

It may be that four of these ultrasonics placed cleverly will give enough gestural control, particularly with the interface design and being able to map the values to whatever parameters one wants. Plus, there will be lots of MIDI stuff included in the setup, so there’s no shortage of keys and knobs one can also use for control.

Will keep you posted, though it’ll be awhile. Lots of other projects going on…

Thanks again, this is a great resource!

CJ

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.

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.

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. ;-)

[...] tutorials that I find really valuable when teaching this stuff. This is namely Tod E. Kurt’s Spooky Arduino and Lady Ada’s Arduino Lessons. Great explanations on all sorts of issues and very useful [...]

[...] todbot blog >> Spooky Arduino, Tutorials [...]

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

Giulio

[...] great set of notes from Tod E. Kurt, from his ‘Spooky Projects - Introduction to Microcontrollers with Arduino‘ [...]

I love your notes. They are definitely a big help with my robot.

[...] This other random site. [...]

[...] http://todbot.com/blog/spookyarduino/ (full workshop in PDF with code examples) [...]

[...] This other random yet very useful site." [...]

Terribly entertaining and educative course, congratulations.

[...] http://todbot.com/blog/spookyarduino/ [...]

Excellent, excellent Arduino reference site. Great class notes!

[...] todbot blog 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. (tags: arduino electronics tutorial) [...]

[...] Spooky Projects [...]

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

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
  }
}

thanks for your quick answer!! I´ll try it. greetings from germany. mae

thanks! I´ll try it. greetings from Germany :)
your site is great. I´ll recommend it. mae

[...] Spooky projects with Arduino [...]

[...] Short video (m4v) of a piezo, photoresistor and Arduino…. Here’s the code we used from TodBot! [...]

Something to say?