Resources for Getting Connected


Jackson & Imaan:

Yuxi, Maz, Hudson:

Lindy, Yifat, Alex, Torin:

  • Making Things Talk**, Project 7: Networked Air-Quality Meter
  • Learning Processing**, 18.4: Text Parsing <–Uses Yahoo’s XML weather feed
  • Processing Weather Library

Cris, John, Andrew, Pui

Demi, Ryan, Heather:

Mitzi & Jeremy:

Borzu, Ryan, Ruzette:

Hank & Peggy:

*Book available from OCADU’s e-library
**Book available on CANVAS

General Interest

  • Arduino Cookbook**, Chapter 12: Using Time & Dates
  • Learning Processing**, Chapter 17: Strings
  • Learning Processing**, 18.3: Reading & Writing Text Files
  • Learning Processing**, 18.4: Text Parsing <–Uses Yahoo’s XML weather feed
  • Processing Weather Library
  • Processing Yahoo Search Library
  • Arduino Cookbook**, Chapter 15: Ethernet & Networking

Cosm, formerly Pachube

Processing/Arduino Application with Cosm –> no new hardware required
EEEML Library for Processing

Upload sensor data to Cosm with Arduino Ethernet Shield
Upload data from 2 sensors to Cosm with Arduino Ethernet Shield

If This Then That


Wireless Resources

Links from Thursday night’s class:


Technical guides & products:
How Tos:

Prep for Wireless Class

Here are some things you can do in preparation for Thursday’s class:

  1. Do the Serial Lab.
  2. Read Sparkfun’s guide on How to Read a Datasheet.
  3. Spend some time getting more comfortable with Processing, either with the Getting Started with Processing Book or some of the other resources I recommended last week.
  4. Do a first read of Chapter 6 in Making Things Talk, 2nd edition. Available on Canvas or through the Toronto Public Library site.

Basic Threshold Switch from a Mic

The Electret speaker breakout board from Sparkfun has been super popular in class so far.

The thing is that when you finally get it wired up, it outputs what appear to be random number pulses. In waves. These are the amplitude wave of the sounds near the microphone, not an error. They can themselves be used for many things, but will not tell you if, for example, someone is talking TO the critter, just the background levels. Terrible! We need a threshold to tell us when someone’s surpassed the normal background volume instead.

Much like “face recognition,” “hearing” speech is tough. This is simple. This creates a threshold switch from a microphone. It will tell you when the sound levels nearby change to a wider range than “normal.” It requires some calibration, and some simple math. If you are outputting to a nearby speaker, it may not work very well; it will hear the speaker, as well as yourself. Better math would fix that issue. This is a simpler switch than that.

electret breakout wiring
To wire it, hook 5v to a 10k pulldown resistor, ground to ground, and information to A1* as in the diagram. The datasheet says the thing needs 1.5v in, and most sources say a 5k will do you, but a 5k gives you a big fat wave with numbers between 200 and 400 – it looks super random. The 10K will compress your business like no nevermind.

*NB: I prefer A1 to A0 because A0 sometimes acts weird, and code occasionally interprets a “0” as a null value. This is important with analog inputs.

Once hooked up, here is your code:


Electret Mic Threshold Reader
Alex Leitch

Oct 31 2012

Appropriate for All Ages, 2006, uses a much-simplified version of this circuit.
That one ran on a similar mic circuit, picked up for $3 in a spare halloween “spooky robots” pile.
This is better because you can calibrate it, that was better because you didn’t have to. Also, it cost $3, not $30.


const int pinSpeaker = 3;

int valMic;
int valMicRange;
int valMicLast;

int iHearYou; //set threshold for “being talked to”

void setup() {

void loop() {

valMic = analogRead(pinMic); // every loop read the mic

valMicRange = abs(valMic – valMicLast);
// take an absolute value of current and last value of amplitude wave for threshold

// Find out what the absolute value of difference is – this will make a pretty visualizer out of your thresholds

if (valMicRange > iHearYou) { //do something if threshold is passed

else { // if not being talked to, what to do?

valMicLast=valMic; // hang onto that mic reading


Here is where the exhortation to do Amazing Things with this information comes in! But no. I am not going to lie to you: working with sound is tough and the sort of thing [redacted judgemental comment] (hi there, GearSlutz) work with. Sound is a wave, which is to say a four-dimensional transform, waves are a challenge if what you really want are robots. Sound becomes useful as a switch when, using thresholds maybe, you can transform it from a wave to a point, or at least a baseline, which is what this circuit does. Audio obsession knows no upward bounds. That message board is maybe the best review board for people who are really into analog inputs, though, and I think you may find something of use there.

Appropos of nothing, The Simpsons. Happy Hallowe’en.

Processing & Kinect Resources

For those of you who are using Processing & Kinect, here are two books that I’d recommend:


It just so happens that with a Toronto Public Library card you get access to Safari Tech Books Online which includes these books and others. This is a massively valuable resource and includes the following titles which are relevant to this course:

Dan Shiffman also has a really good book called “Learning Processing”. The second year DFI students used this book last year so you might be able to borrow a copy from one of them.

Also, there are very clear and helpful tutorials available on the internet:

Finally, if you go to Canvas and look in the Creation & Computation files folder you’ll notice that I left some goodies for you…

Post-Project 1 Resources

Some things that might be helpful for you…


Fritzing – for circuit drawings and diagrams. Includes a library of Arduinos!
Upverter  –  **Zak Homuth is speaking at OCAD next week. Details here.

More Arduino tutorials:



Lasers! and Pointers!

After a fair amount of dreaming way beyond my capacities for this first project, I ended up finding a solution to the workspace question by being slightly paranoid.

I work at a studio where my office is blind to the door of the studio space, which means that I can’t physically see anyone coming in or out. Having all kinds of equipment being used there means there’s lots of potential for theft, so my Personal project became a way to let me know (or anyone else working) that someone has passed through the doorway.

The initial prototyping of the project was pretty straightforward:

  • 1x Arduino Uno
  • 1x Breadboard
  • 1x Photo Resistor (CDS 5mm)
  • 1x LED Green 3mm general
  • 1x Laser pointer (Infinitor Red Laser)
  • 1x 330 ohm resistor
  • 1x 10K ohm resistor
  • lots x 22 ga. wire

I started with the potentiometer code from the online tutorial on this site and started exploring the idea of using a sort of tripwire to sound a chime of some kind. Running the tests gave me this setup and code:

/* Source code altered from this site’s demo potentiometer sketch found here with a lot of influence and ideas from Login258 at  */

int LEDpin = 8;
int OUT13 = 13;
int potentiometerPin = 0;
int LEDvalue;
int potentiometerValue;

void setup(){

pinMode(LEDpin, OUTPUT);
pinMode(OUT13, OUTPUT);


void loop(){
potentiometerValue = analogRead(potentiometerPin);
LEDvalue = map(potentiometerValue, 0, 1023, 0, 255);
analogWrite(LEDpin, LEDvalue);

Serial.print(“Light sensor value: “);
Serial.print(“. LED output: “);

analogWrite(LEDpin, LOW);
digitalWrite(OUT13, LOW);
analogWrite(LEDpin, HIGH);
digitalWrite(OUT13, HIGH);

Ostensibly, the code was written with the idea that the photosensor receiving the light from the laser pointer would be covered and so have a relatively low threshold. The green indicator light, for whatever reason, wanted the code written above, even though theoretically it should have turned LOW if the laser was tripped. I couldn’t logically sort that out but it worked, so I left the code as it was.

It was once I started assembling the components together that the project became a lot more complicated. I decided that I should beef up the buzzer and photocell size (in order to make the action louder and easier to aim), but over the course of the construction of the prototype box both components broke and so I returned to my original parts, which worked out okay.

I learned about maintaining access to components when my speaker failed after I’d glued the lid down without thinking about how to get everything out if I needed to. Fortunately, I was able to get back into the box without too much external damage and discovered that the speaker failed due to the ground wire that had unseated.

While the initial design was to alert people coming into the studio, the applications can expand much further into my photographic work: during my research I found a few different possibilites for using this basic system as a slave trigger for strobe units or camera flashes, some that went so far as to fire the camera as well. Ideally, I’d like to move away from a laser altogether, since something like infrared, ultrasonic or even proximity sensors would allow me to widen the active area for an object to pass through – allowing more versatility of tripwire to actuate cameras.

For now, it works fine and while it was a fun project to do, I’m looking forward to exploring the tripwire possibilities further.

Your friend Lynda

As many of you may know, as OCAD students have access to the library of videos on Lynda.

Lynda Login

While they don’t have Arduino videos yet, it seems they do have Processing