Intro to Physical Computing Syllabus

Research & Learning

Other Class pages

Shop Admin

ITP Help Pages
Tom's pcomp site
DanO's pcomp site


Dustyn Roberts

Who

I'm one of 5 instructors teaching 6 sections for PComp this fall. You can reach me by:
email (preferred) dustyn.at.dustynrobots.com, phone at 201.452.1583, or Skype at dustyn.roberts

What

Useful pages:

Where/When:

Office hours: Sunday evenings 6:30-8:30pm in the adjunct lounge, and by appointment - email me to set something up. Also, the latest version of Skype has a screen share feature that's great for remote help. My Skype name is dustyn.roberts. By day my office is at the NYU-Poly campus in Brooklyn: 6 Metrotech Center, Rogers Hall 520B. Stop by any time for help (take the A/F train to Jay St, exit at back of train).

Notes from classes:

What is Physical Computing? SixthSense Technology

Can you find out what code is already on an Arduino?
A: No, you can't get it back, because it's compiled. The source code isn't stored on the chip.. There isn't an easy way to extract the assembly code either (though it can be done, but the explanation is beyond the scope of this class)

http://www.bareconductive.com/home.html (A video of conductive ink, invented by Royal College of Art students)

Why 1024?
This is the magic number for the full range of analog input we saw with the pot. This is NOT necessary to remember, but since I'm an enginerd, I'll explain for those of you who are interested: The analog-digital converter (ADC) pins on your Arduino are capable of sensing a varying voltage (from your potentiometer, fsr, etc) and outputting a 10 bit number. A bit is a 1 or 0, a byte is 8 bits. Each bit represents "2 to the power of (bit)", called the binary system. So 1000000000 = 2^10 = 1024. Read more on counting in binary in this wikipedia article:
http://en.wikipedia.org/wiki/Binary_numeral_system
A byte is actually one of the data types we can use with Arduino (but very seldom do). A byte is not big enough to hold the output of the ADC (Analog) pins, so we move up to an int (integer) when we declare things like int potValue = 0. That way we can store the whole 1024 values in that variable. An int can hold up to 2^15 = 32,767. This is the default data type we use most often on the Arduino, but remember it also has its limits. For super big numbers or fractions/decimals, you can use data types long or float, but these take more Arduino brain power so are slower than using int.

Illustration of water analogy of electricity

Illustration of series vs. parallel

Alex's notes in response to reading - The User Illusion:

Notes from Alex and Ezer's EMG project:

Below is the link to the lab that we used for the EMG (although it was a ECG schematic). This is the one that seemed to work. Be warned, the background 'pictures' make the lesson almost unreadable.
http://www.cs.wright.edu/~phe/EGR199/Lab_4/
And the schematic comes from this site that encourages diy EMGs using Arduinos.
http://www.biomed.engsoc.org/node/30

Serial

1 bit: 0 or 1
1 byte = 8 bits: range from 0-255. The value of the byte is determined by the binary interpretation of the 8 bits.
Every group of 8 bits (1 byte) is interpreted at one time in serial communication. If all you're doing is sending a potentiometer value divided by 4 (for example), you're only ever sending a number from 0-255 so you don't have to do anything. This is sometimes called the raw value. But if you want to send bigger numbers, or text a human can actually read, you have to format the byte that's being communicated from the speaker to the listener to know what the F you're talking about.

It turns out that there's a standard system called ASCII code that can takes any value from 0-255 and assigns it an alphanumeric character (letter, number, or punctuation mark). Here's an example table:
http://www.asciitable.com/

The drawback is that when you send things at text, it takes as many bytes as there are digits. For example: a raw value of 12 only takes up one byte, but an ASCII encoded number 12 takes two bytes: one byte for 1 and one byte for 2. Be careful here. If you're speaking in ASCII-encoded text but listening for a raw value, you might interpret the 1 and 2 as their representative values in ASCII of 49 and 50. And if you're speaking in ASCII and listening in raw, you can get all kinds of garbage characters like ~, +, *, etc. that correspond with the representative ASCII values.

If you're thinking that ASCII encoding is an inefficient way to send numbers from 0-255, you're right. After all, sending the number 12 as two ASCII encoded bytes instead of one raw byte takes twice as much information. However, at the standard baud rate of 9600 that we work with, you're unlikely to feel this efficiency for just a few numbers. And it also gives you the flexibility to agree on one method of encoding for anything you might want to communicate between the speaker and the listener.

One more note about ASCII: the first 32 raw values correspond with control characters, that won't even show up as garbage but stand for things like "carriage return" (ASCII 13).

This serial data is passed byte by byte from one device to another. If you're constantly sending values between 0-255 like with a potentiometer, you don't particularly care how the message starts or stops because it's a constant flow of numbers. But if you want to send a more specific message, or more than one message, the speaker has to give the listener clues as to when the messages start and stop and how to tell the difference between them.

Ways to see/visualize serial data:
Mac & PC: Serial Monitor in Arduino, Processing graphing sketch, Coolterm
PC: Hyperterminal
Mac: Zterm, Terminal, Cornflake

On Arduino's serial monitor, by default, it interprets bytes as ASCII-encoded decimals. So the following lines will print out the same thing:
Serial.println(analogValue); // print as an ASCII-encoded decimal
Serial.println(analogValue, DEC); // print as an ASCII-encoded decimal

Week 10

Final project matchup

Motors - review family tree, pg 6 Finish h-bridge lab

Steppers

Wireless communication and Bluetooth

Week 11

Myers-Briggs Personality test link

<object width="512" height="400"><param name="movie" value="http://news.bbc.co.uk/player/emp/external/player.swf"></param><param name="allowFullScreen"

  Edit | View | History | Print | Recent Changes | Search Page last modified on December 06, 2010, at 08:55 PM