Intro to Physical Computing
Fall, 2003
Jeff Feddersen

Week 11

MPJA has little 5V motors for 39¢ a piece for orders of 5 or more.

Some old friends visited over the weekend. Anna, the girl, was fascinated with all my electronics junk. I taught her how to solder and she wired up some potentiometers and speakers for me. She was into making LEDs turn on, and before long she had set up a circuit where she could vary the brightness of the LEDs with a variable resistor. She's only 9 but made as much progress in a few hours as I had made in my first week in this class.

She asked me whether I enjoyed playing sports. I said, 'Not really.'
Then she said, 'So are you a computer nerd?'
'Uh, well, um, there are other types of people in the world.'
'You mean oafs?'

Thinking about the final project - here are some ideas (I suppose I should be farther along than at the brainstorm stage, but, oh well):


  • Develop Monster Hand - Redo the midterm project, only this time it actually works
  • Develop Hexapod - Redo the technical research project, only this time it actually works, using motors instead of that stupid muscle wire
  • Walker - Build robot with 4 or even 2 legs, using steppers. Maintaining balance would be the hard part.
  • Centipede bot - Create a chain of identical 2-wheeled bots, each with simple electronics and own battery - connected to head via something like telephone connectors. So theoretically I could have any number of modules in series.
  • Swarm bots - Create several identical small wheeled robots that follow each other, or perhaps follow one central 'queen'. Each would have an LED on the back and a light sensor on the front.
  • Skeleton - A hand or even an entire skeleton that 'blooms' when enough ambient light has charged its solar cells. The hand would open, the skeleton would stand erect from a crouching position at rest.
  • Environment Readers

  • Weather Chime - A box containing wind sensor, temperature sensor, sunlight sensor, perhaps humidity and barometric pressure sensor. Music is played depending on conditions.
  • Piano Roller - (Steve Oh's idea)- A robot that reads variations in floor and produces tones based on patterns of light and dark. If you were to take sheet music and scale it up by say, 10x, the robot would move over it and 'read' the notes with photosensors. Placing the robot over a wood floor would yield different sounds.
  • Wearable Music - Shirts or vests or something with metal contacts at key points. When two people wearing the shirts embrace, audible sounds are played. The clothes would have to be wired together somehow.

My hesitation with all of these involves my concern that they aren't original or interesting enough. The robots described above have been done before, and the 'music' stuff is only interesting if the output sound is actually good music. Generating tones based on environmental variables is basically the same as listening to a modem at slow speed or listening to static hiss on the radio. There needs to be some algorithm that translates, for example variations in temperature, into a chromatic scale.
The last one may just be too silly, although it might sell, particularly if made as underpants instead of shirts.

Youth is the time spent discovering the rules of life. Maturity is knowing the corollaries and exceptions.

These 'ant' robots from MIT are pretty cool, but I don't think I could build them, at least not in the next few weeks.

The more I collaborate with people, the more I come to realize that I'm bad at it. I think I'm destined for hierarchy, either as a grumbling minion, as a hapless middle-manager, or ideally as a tyrannical dictator. I would make a good dictator - I'd have way more edicts and decrees and stuff than anyone else. Although looking at tyrants in the past, it seems like fluency in a foreign language would be required, particularly Spanish.

I ordered 32 motors (6 5VDC 15° stepper, 6 12VDC 3.6° stepper, and 20 regular 5VDC motors). I'm leaning toward the millipede-style robot. I don't want to use an existing design or pre-built components (other than the motors), I'd rather come up with all the design and construction myself. The Head shuold have some kind of turning ability, but the body segments should be 'dumb' and just follow the head. I want it to walk rather than roll (walk and roll, baby!) and having loads of little legs should help the balance issue The image on the right is my current idea for powering the legs, similar to how the motion of the main piston on a steam engine is converted to rotational motion, except I want to go in the other direction: rotational to linear. Whereas on a train, the open slot on the arm is at the pivot attached to the wheel, in my idea, the open slot is at the pivot that is fixed to the body.

The tricky part (one of the tricky parts) will be to sequence the leg motion on each body segment so that those at the apex of rotation are supported by those at the nadir. Otherwise, the body segment will move more than the legs and the robot won't walk forward.

I don't know why I bought a bicycle. I never ride the thing. It's too much trouble to carry up and down three flights of stairs.

If I make the legs shorter than the height of the body, then the body segment will drag once per rotation, guaranteeing that the legs move up and forward without pushing the robot backwards.

I can't figure out whether it would be better for the left and right legs on each segment to walk in parallel or out-of-phase.

This is beginning to look like a series of cams more than anything else. Maybe I should just use those.

Scott Clifford is a really swell guy. He would never go on a murderous rage because of something he read in this blog.

For the head, I could put two photosensors on either side, and have them trigger legs on the opposite side so that it follows a light source - light on the left would make the right leg move, turning the head toward the left.

Got some Girl Scout cookies. Mmm, Thin Mints.

Each motor will need 5V, so do I have one central battery at the head or have each segment use its own battery? If I pass a single voltage down all the segments, there will be a 5V drop at each motor. If I use a AA battery on each segment, that will only be 1.5V per motor - not enough to power it, unless I use a capacitor to store power and release it as needed. Or I could use a 9V battery on each segment. I don't want it to go too fast, though. I could use gears to reduce the RPMs, I guess.

I'm ready to do the lab assignment, but I'm having trouble locating the midi connector the midi connectors were hiding at the campus store! Those little rascals. Also, I kinda wanna get going on the final project rather than doing work that I know will be irrelevant to it.

P-Comp is clearly focused on programming more than electronics. I would rather have one class devoted exclusively to electronic circuits, and another that goes into midi, max/msp, etc.

Another idea: a 3D mouse. Imagine the rubber grip from a bicycle handle oriented vertically in a box. Springs from all directions keep the grip steady. Flex sensors are attached so that they can detect pulling/pushing, movement left and right, and up and down. They can also detect twisting around the three axes. This wouldn't be too useful for regular applications, but could be useful in 3d environments.

Finally tried Tom's stepper motor exercise. Kind of a pain when you don't know the order of the 6 wires. I got the gist of it, and got motion without resorting to any fancy Darlington transistors, just 2n2222, thank you very little.

A few weeks ago, for my Spatial Design class, I did a study of how horses run, specifically looking at Muybridge's famous photographs

I made an animation from the stills and saw how all the power is in the back legs and the forelegs are for stability and direction - just as they are in every quadraped I can think of (frogs, tigers, many insects).

An issue with robots is whether to choose wheels or legs. Wheels tend to have more power, but legs are better at traversing irregular gruond. So what if we use both? Have wheels in the back and legs in the front. When a horse gallops, the front of the body is lifted, like a motorcycle doing a wheelie, giving time for the forelegs to move. If I'm precise (unlikely) with my robot design, I could have just the right amount of power in the wheels so that the front legs can step forward without the whole thing just falling forward.

However, the rear legs only provide thrust when moving backward. It is when they are being drawn forward again that the front of the body is lifted. So the robot's rear wheels may have to vary their speed to better mimic the animals and be in proper harmony with the front legs.

I've gotten a few emails with complaints about some of the stuff I've written in these journals. Not about the technical stuff, just about the various random thoughts I've put down.

Seiko Epson (I didn't know Epson was a Japanese company) has made the world's smallest flying robot. It's remote-controlled, so not a fully-independent autonomous robot, but with wireless communication as good as it is, it's reasonable to imagine a bug with its brains on the ground.

Another idea is to create a musical language that is understandable by both machines and people - something between the hiss of a modem and English.
Silbo Gomero is a whistled human language with about 4,000 words.
Here is an example

Lab Assignment
Step 1: Not clear from the diagram whether we're looking at the front or back of the connector, so I can't tell which pin is #4 and which is #5.
220Ω = red red brown
(I calculated from memory, but double-checked them here)

Step 2: I bought two of those flex sensors, which turn to be made by... Abrams Gentile Entertainment - not sure if that's a joke. They also make mediocre cartoons.
Can't load program while midi is connected to com1.
Add a 22KΩ resistor (red red orange) in the circuit from the flex sensor to increase sensitivity. Not much difference.
I use the following code:

Option Explicit
dim noteVar as integer
Public Sub Main()
	call putpin(26,0)
		noteVar = (getadc(15) * 2) + 36
		if (noteVar > 96) then
			noteVar = 96
		end if
		debug.print cStr(noteVar)
End Sub
I've got arithmatic on my side.

Step 3,4: I don't have a stinking midi cable! But what if... I were to just stick random wires into the jacks? Okay, you talked me into it.
The sound I get is a deep harmonious pulsing, at a frequency of one second - as if Darth Vader were playing the harmonica in his sleep. Bending the flex sensor gives different tones. Touching the contact (grounding it against my skin) gives a much higher tone.
The music is actually quite beautiful.

I accidentally nudged my rather delicate setup and now the pulsing has changed, as though two or three frequencies are passing in and out of phase. It doesn't seem to matter whether the midi connector is grounded (pin 2), which tells me I've done something wrong, but it's all very harmonious

Now I know I've done something wrong. If I pull out all wires to pin 14 and com 1, I still get the same harmonious pulsing, which means it's a function of the electronics not anything else. Still, I was able to vary the tone with the variable resistors.

The sound has two measures: f# (half note) c# (half note) - f# (quarter) f# (quarter, one octave up) f# (quarter) c# (quarter)
60Hz, the frequency of wall current would be between a B and a B flat, so I don't know why I'm getting F#
This is totally Close Encounters of the Third Kind.
Forget what I said about music above - I'm having a 'Music of the Spheres' moment.

Although the music was pleasant, I shut off the BX, but the keyboard kept playing the same sound. I pulled out the wires, and it kept playing. I must have set it up on some sort of oscillation. The keys still work, so I can jam along with the groove.

An okay intro to midi music
WOBU the dancing midi robot

For eons, people have enjoyed mapping the musical scale to the color spectrum.
Despite knowing that music is waves in air and light is waves in electromagnetic fields, I decided to do a little research and math.
The color spectrum ranges from 384 to 769THz (terahertz)
By repeatedly doubling a note (say A, at 440Hz) we can find where it would actually fall in the electromagnetic spectrum. In the case of A, we can find its relevant note many octaves (40 octaves, 240, or 1,099,511,627,776) up at 483,785,116,221,440 (~484THz) which puts it at the redder side of orange.

You can get comparable results by multiplying the original frequency by 1.1 to get it in terahertz.

notemidi notefrequency in center of audible, euphonious rangefrequency in visible section of electromagnetic spectrumcolor
F 65349.23Hz384THzinfra-red/red
Gb 66369.99Hz407THzred
G 67392.00Hz431THzred
Ab 68415.30Hz457THzred
A 69440.00Hz484THzred/orange
Bb 70466.16Hz512THzyellow
B 71493.88Hz543THzgreen
C 72523.25Hz575THzgreen
Db 73554.37Hz610THzgreen/blue
D 74587.33Hz646THzblue
Eb 75622.25Hz684THzviolet
E 76659.26Hz725THzdeeper violet
F 77698.46Hz768THzviolet/ultra-violet

The abundance of red and green in the chart has to do with the fact that our eyes are most sensitive to those two colors, not because of any bias on the part of the spectrum. Color is, of course, entirely subjective.

These are the numbers that, when multiplied by 240 (ie are transposed up by 40 octaves) map onto the spectrum of visible light. Other notes, such as middle C would need a different multiplier, in this case, 2^41. Douglas Adams' number, 42, would be the exponent of the multiplier for the octave below middle C. Maybe that's what he meant by saying that 42 was the answer to the question of the universe.

The above is based on standard tuning. Other tunings wouldn't make much difference. When multiplying by 1.1 trillion, small differences get magnified, but not enough to matter here.

F is an interesting note in that it happens to match exactly with the upper and lower ranges of frequencies of visible light. That could be a coincidence, but I wouldn't be surprised if our brains use some sort of hardwired math that results in the spectrum of sound and color having the same bounds, albeit separated by many orders of magnitude.
Either way, F really should be the start and end of the scale, not C. And I suppose D is the bluest note of them all.
Frankly, I'm amazed that the color spectrum maps onto the music scale so perfectly. I was expecting all the notes to map out between yellow and green, or perhaps all the colors to map out to the range between F and A#.

Matt Slaybaugh
ms171 at