Blogma

Intro to Physical Computing
Fall, 2003
Jeff Feddersen

Week 7


Common Ground!


My home phone number is, apparently, one digit different from the front desk of Screw magazine.
I get some bizzare wrong numbers.


I was temporarily without my bread board, so I did some soldering and hooked up the servo directly to a 5V DC power supply, with red to + and black to -.
The yellow control/signal end was free, and I noticed that every time it came into contact with my skin, the motor rotated counter-clockwise. Touching the control wire to power or ground had no effect.


Another general electronics-y site: play-hookey.com with guides on how DC power works, etc.
And here's one all about building analog music synthesizer components.
This one's even better.
And this one has great, thorough explanations and tutorials of things such as 'Darlington Pair Speed Control': Electronics in Meccano.
And here's another good site in the same vein.


Tested servo with sample script online - works just as promised.
It makes a funny sound.
I love the little guy.


In college I took a midi class with David Borden, who had worked with Bob Moog (pronounced 'mohg') in Trumansburg, NY, just a few miles north of my home town. He would tell stories about Wendy Carlos (back when she was Walter Carlos). Borden was kind of a jerk, and his music wasn't even very interesting. When he couldn't think of a melody, he would just take some random piece of sheet music (say, "Jingle Bells"), turn it upside-down, and play it that way, at Carnegie freaking Hall, no less. I suppose that is an avant-garde technique of sorts, but it sounded terrible. Still, the class was a lot of fun.


I try the second online script, but the servo just cycles between 'start' and 'minimum'. I add call putPin(26,0) and see the on-board led switch on and off with each cycle, which tells me the chip is shutting off every time the servo turns on. It must be drawing too much power away from the chip. This happened before. I forgot that I need a separate power supply.


I resoldered the connections on my power supply jack, which were kind of threadbare. Making them nice and solid again seems to have improved my serial connectivity.


The popcorn song was a hit with everyone this week. I realized that I'd heard that songs lots of times, but never really thought about where it was from. In my mind, I always associated it with the Axel-F theme from 'Beverly Hills Cop'.
Paraphrased from an interview with Kingsley:

The Popcorn song was composed by Gershon Kingsley in 1969, who, in addition to surviving the holocaust at age 15 and serving with the British military in Palestine, joined Moogby, the first Moog synthesizer quartet. 'Popcorn' was composed "in about two minutes" for the group, and has since become kind of an anthem for electronics musicians. Kingsley said he uses Macs, and said he prefers Performer and Overture software.
Maybe I should switch back to macs.

The vanBasco's Karaoke Player is the best midi player I've seen. It's free, and good for when you don't have access to your midi keyboard.


I remove the wires connecting the right and left power bays, like Jeff showed in class, and put a 9V battery on the right side. So now the chip doesn't shut off, and the servo acts like it's having a seizure. The instructions say the minimum pulsewidth of 0.001 and maximum of 0.002, but the code uses 0.0003 and 0.0022. Hmm. I change the values to 0.001 and 0.002, but it doesn't seem to make any difference, although the seizure looks slightly more erratic.


There's a mnemonic device for resistor colors:
BadBoozeRotsOurYoungGutsButVodkaGoesWell
blackbrownredorangeyellowgreenbluepurple (violet)graywhite
0123456789

(if engineers had invented the English language, we wouldn't have three basic color names that begin with the letter 'B')
So some common resistors in the cabinet are:

  • red-red-brown (221) which = 22x101 or 220 ohms
  • red-red-red (222) which = 22x102 or 2200 (2.2K) ohms
  • red-red-orange (223) which = 22x103 or 22000 (22K) ohms
Now, if I manage to memorize these, would that make me a nerd? Practical knowledge like that somehow seems cooler than your typical nerd behavior.


So now I try 0.0001 and 0.003, but that doesn't seem to matter either. I change the sleep from 2.0 to 5.0 - no significant difference. Change the 'refreshperiod' to 0.05, and the only difference is intermittent pauses. And the servo is getting kind of warm.


How to read a capacitor (it sort of makes sense) This one takes a stab, too, and one more
Basically, it works like the resistors: the first two of three digits are the number, the third digit is the multiplier, and the letter that follows is the tolerance. Additional letter codes refer to operating temperature range, which, who knows, we may have some opportunities to test.
Lentils (Ceramic Disc)
18J | NPO (tan) = 18 x 100 = 18pF = 0.018nF = 0.000018µF
56J | CO (brown) = 56 x 100 = 56pF = 0.056µF = 0.000056µF
681J | KCK (orange) = 68 x 101 = 680pF = 0.56µF = 0.00068µF
x | 473.k (green) = 47 x 103 = 47000pF = 47nF = 0.047µF
473Z | Z5V (tan) = 47 x 103 = 47000pF = 47nF = 0.047µF
10% 3KV | D 180 | N 1500 (yellow)I have no idea. It's much larger than all the others, but neither 1500 pF or 1500 nF seem right.
Maybe 180nF? (0.18µF?)
Cylinders (info written right on side)
10µF 0.000010F 0.010mF 10,000nF 10,000,000pF
100µF0.0001F 0.1mF 100,000nF 100,000,000pF
220µF0.00022F 0.22mF 220,000nF 220,000,000pF
2200µF0.0022F 2.2mF 2,200,000nF 2,200,000,000pF

I put back the original script - no difference. I notice that if I manually twist the motor all the way clockwise, the first thing that happens when I run the script is that the motor turns all the way back ccw, then vibrates. Good thing I bought two servos. I try the 2nd one, and it jitters as well, but in a different way. Try all the things I did with the 1st one, and they both act the same - even the part about spinning ccw before jittering. Maybe the example code is bad. The first script worked fine. Oh, but I try the first script again and it doesn't work. Oh, that was before I put in the 9V - that must have too much power - ah yes, the servo doesn't want more than 6.


I have one little blue thing, that looks like this:

(I used a flatbed scanner to get this image, pretty good - better than my camera)
I don't know what the symbol on the left is, and Googling for "480BK" didn't yield much fruit.
I think it might be a timer.

This diagram from Kyocera may be a clue, but I don't know what that symbol is above the KBR-480K.


So I need a different power supply, or a voltage regulator. Here's one, no wait, that's not a 7805, that's a NL|CE LM|317T|NLAS947 - an adjustable voltage regulator. Where the hell did that come from?

Instead of the pins relating to in, ground, and out, this one uses in, out, and adjustment. So I put it in the board, and... without an adjustment, the output is around 19V so apparently this thing wants 28V in, and can deliver anything from 1.2 to 37V out. So I've got it right in the middle now.


This Word doc has a thorough listing of circuit symbols, and leads me to believe that the blue component is a 'piezo transducer', although it doesn't look like the photos of piezo transducers I see on the Web. But it looks like it makes sound.


To regulate the new VR, I need a 240Ω resistor and a 5KΩ variable one. I've got a 220 (red, red, brown) resistor, close enough, and a 10K pot. Let's see how it goes...


I've learned that, just as the US has different spelling (color vs. colour), sports (football vs. football), and measurements (imperial vs. metric) when compared with the rest of the world - the US also uses different circuit diagram notation. The differences are more for logic gates than for component symbols, but geez, why do we always have to be different? All the same, ours are easier to read.


Now, with the pot turned all the way one way, I get about 14V, and turned all the other way gives me 0V, success! I guess the difference in resistances in my components is why the max isn't 37, but I'm not going to do the calculations now. So I turn the pot and watch with the multimeter until I have about 5V. Now, to try the servo script again... and... nothing.


Here is a diagram for a Variable Frequency Quadrature Sinewave Oscillator. I want to try it. I think I might print out the diagram, paste it to some cardboard, and then just lay out all the components on top of the diagram and solder them together. It requires:

  • 1 100K pot
  • 1 10K pot
  • 2 330pF capacitors
  • 6 1K resistors
  • 4 15K resistors
  • 3 22K resistors
  • 2 100K resistors
  • 4 1N4148 transistors
  • 3 TL072 transistors
  • 2 1/2 LM13700 transistors
  • 1 1N4735A transistor
It uses some odd symbols, such as a simple rectangle to represent a potentiometer, and has triangles here and there with no evident purpose. Also, some of the connections between components have numbers next to them. I can't tell what they're for.


I was testing voltage at the wrong points, across the pot, instead of where the motor will get it. The instructions also suggest some optional capacitors. Let's try those as well. It asks for 0.1µn;F and 1.0µn;F, I have 0.047 and 10. Oh, but one is directional and the other isn't(?). I try a few configurations, but no dice.


This British electronics componments site: Maplin seems to have everything. Too bad the shipping charge is so high to the US. They even have loads of fireworks. Japan sells loads of fireworks, for like, $5/pound. I tried smuggling $20 worth from my last trip, but ever since 9/11, the airport personnel are a little twitchy about piles of explosives being brought aboard. Oh well.


Let's make it simple, just stick the pot between the battery and the regulator. Well, I now have a min of 2V and a max of 3 - that's no good. Okay, start over. Putting batteries in series should have an additive effect on the voltage, right? So put two AAs at 1.5V each and, yes: 3V. So I just need one or two more.


This site has a diagram to make something that is essentially the same as a 7805 (but better input voltage range) for $0.46 in parts. Too bad the shipping would be more than the cost of just anew 7805.
I'm getting into the whole idea of actually understanding all this stuff. I still have trouble reading a circuit, whether as a diagram or as implemented, but I'm getting better.

Nikolai Tesla was awesome. This page has some good circuit diagrams and projects on it. I think I'll try the tesla coil and plasma globe. That would be fun for Halloween.


Shortly before Bloomberg ran for the mayor's office, his people were hanging out on NYU's campus, handing out little radios that could only be tuned to one station, the AM broadcast of Bloomberg radio. I still have mine, ripped apart, but alas, it only has a battery bay with room for two. No problem, there's one with room for four in the bottom of junk box #4. Multimeter says: 6V - finally!


An automated plant-watering system


But dammit, still jittering! I try with three batteries (4.5V) - same, 2 batteries - same. I try the first script with the same 5V power that's running the chip - and it's fine.


Phaedra was talking about bioinformatics.
But what I want is some kind of helmet, full of low-frequency sensors, that detect delta (0-4Hz), theta (4-8Hz), alpha (8-12Hz), low-beta (smr: 12-15Hz), (midrange) beta (15-18Hz), and (high) beta to gamma (18-40) waves. (Looks like Advanced Brain Monitoring, Inc. is ahead of the game. They have a device called the 'Cerebrum Profiler') You could calibrate it for thinking about left, right, up, down, and 'enter', then configure it to play Super Breakout. That would be cool. I just need to figure out how to do low-emf frequency detection. This site has a useful diagram. Man, that would be awesome.
And this site seems to be the mother lode of circuit diagrams. (Where would we be without Google?)
Another EEG circuit. Looks like we'll need a 10,000x amplification of the signal.


I now have the 4 AAs powering the servo, which is still jittering. Futzing with the numbers helps somewhat. The fact that both motors have a left-bias, concerns me. This guy did a thorough test of pulsewidths for the CS-60.


I need to eat more Chinese food, just so I can get more of those clear plastic tubs. I've got resistors in one, LEDs in another...


Oh man, I fucking got it. I remember overhearing someone say in the lab something about 'common ground' so I link the ground between the batteries and the 7805, and voila. So now I can see that a 0.001 sec pw only gives me 45°, and 0.002 only gives me about 135. Tom's numbers are much closer to the right ones, though still a little off on mine.


When I left the lab yesterday, I tossed my random wires, leds, and stuff into a paper bag that was on the floor. When I got home and was rummaging through it, I found some napkins, which seemed very odd. Then I found a large slice of chocolate cake in saran wrap. So, to whoever lost a piece of cake in the lab: it was very tasty.


About two years ago I built a perpetual motion machine, of sorts. It would only make about two revolutions before it was overcome by the friction on the axles. With some better lubricant and more precise gears, I might be able to get it to work. People say perpetual motion is impossible, but if you notice, the Earth has been moving around the Sun for quite a long time. The trick is to have a balance of non-collinear forces. The Earth is always falling toward the Sun, while at the same time hurtling away along a tangent of its orbital path. These forces are at right angles of each other, so the method here on the ground is to use magnets at right angles to gravity. Several magnets repel each other while fixed to two interlocked gears, both of which are on ratcheted axles, so they can only turn in one direction (1 cw, the other ccw). It's not 'free' energy, which is impossible, because over time, the magnets gradually lose their field. It's very similar to a water wheel - the potential energy in a magnet is converted to kinetic energy.


Looking at that LM317T VR, I see that I may have had pins 1 and 3 reversed. Oh well.


I don't think I'll do anything interesting this week for IPC. But I have a plan for how to use the servo for my Halloween project.


I got a sort of robot arm powered by servo working, based on a sketch at http://zzz.com.ru/


Tried building a tesla coil, but I didn't have any of the right parts. I substituted in a regular transformer for the flyback one, 220Ω resistors for the 240 and 27, and I don't even know what transistor I used. I powered it up, and the transformer was working because the steel loop became magnetized, but I didn't get any sparks. Then smoke started coming out of it, so I pulled the plug. The lesson is that electronics is not like making a stew, you can't just substitute ingredients if you run out. (I guess I knew this already, but I was hopeful that I might get at least something interesting)



Matt Slaybaugh
ms171 at nyu.edu