Gas station without pumps

2011 December 28

More on the slinky and the speed of sound

The Slinky Lab post got an interesting pingback from Engineering Failures » Secrets of the ‘Levitating’ Slinky, which describes the curious phenomenon that happens when you suspend a slinky vertically, then release the top end. The bottom end does not move for about 0.3 seconds, when the compression wave from the top reaches it. It might be worth videotaping that phenomenon in this week’s lab.

I think it might be interesting to try to calculate (either analytically, or as part of the VPython simulation) the movement of Slinky as you drop it. In particular, I’m curious at what point the compression wave becomes a shock wave (that is, when does the top of the slinky start moving faster than the speed of sound in the slinky). Note that the speed of sound in the slinky is best expressed as “coils per second” rather than m/s, in order to get a constant speed of sound in the non-uniformly stretched slinky.

The other lab/demo I was thinking of doing this week, measuring the speed of sound in a metal bar, is not going so well.  I was planning to use a setup similar to that in the Chapter 4 Lecture 3 video at  That is, a long metal bar, with a microphone at one end, tapped with metal striker at the other end.  A clock is started when the tap is made (a simple electrical connection), and the waveform is recorded at the other end.

The first problem was that I did not have a suitable microphone.  I found a quick workaround for that problem, as just last week my wife had given me a fine electromagnet that she had found in the street (we have a lot of “found objects” at our house).  The coil has a 68.3 Ω resistance and a laminated iron core, so waving a magnet around near the pole piece results in a fairly substantial electrical signal across the ends.  So I made my own “microphone” with the coil, a refrigerator magnet, and a folded piece of paper as a spring.  If I rest a piece of aluminum bar stock on it and tap the other end, I get a signal of about 0.3 v, which I can see clearly on my oscilloscope.  If it was a storage scope, I’d be almost done, since I could trigger on one channel and record on the other.  I might still have to do something like that with my analog scope.

What I had hoped to do was to use an Arduino to measure the time it took from the tap to the signal arriving at the other end. Using the micros() subroutine provides timing with a resolution of about 4 microseconds, and starting it on electrical connection from the tap is pretty easy.  I had initially thought to use the analogRead() function, but it is too slow: each analog-to-digital conversion takes about 100 microseconds, and the speed of sound in aluminum is about 6400 m/s, or about 150 μsec to go a meter.  I don’t think I can do speed measurements with that low a time resolution unless I had a bar of aluminum 100s of meters long.  That means that to use the Arduino for timing, I have to convert the analog signal to a digital one by some other means.  The most obvious method is to use a comparator chip, such as an LM339.  I looked through the spare chips I have from 30 years ago, and found one LM311-N14A chip, which has a comparator that takes only a +5v supply.  The data sheet even has a circuit for a “magnetic transducer”.  I tried the circuit, and found that  I needed to add capacitors across the input and the output to reduce noise that otherwise kept the comparator triggered.

Once I got the comparator circuit working, it was fairly trivial to hook everything up to the Arduino and write the following program:

void setup()
  //  put a 20k pullup resistor on pin 3
  digitalWrite(3, HIGH);
  //  put a 20k pullup resistor on pin 2
  digitalWrite(2, HIGH);


void loop()

  // wait for pin 2 to go low
  while (digitalRead(2)>0) {}
  long start_1=micros();
  while (digitalRead(3)>0){}
  long start_2=micros();
  Serial.print(F(" start_1="));
  Serial.print(F(" start_2="));
  Serial.print(F(" diff="));


I tried it out with a piece of aluminum about 1.026m long, and got numbers in the range 272μsec to 304μsec, which would be speed of sound of 3380 m/s to 3780 m/s. That is a little slower than I expected. One possibility is that the comparator is not responding to the movement of the magnet toward the coil, but the rebound as it moves away. If I flip the magnet over, I get even longer times (784μsec to 884μsec), so I suspect the first orientation was the correct one, and the speed of sound in this aluminum alloy is a little lower than I expected, or the comparator circuit is adding some delays.

I’ll have to make a bit more robust way of holding the magnet and stuff, before Friday’s lab/demo, since everything is currently rather wobbly (the magnet is held to the coil with a PostIt note to act as the spring).

2011 December 4

Slinky lab

Filed under: home school — gasstationwithoutpumps @ 20:54
Tags: , , , , , ,

In the Physics homework (Chapter 4) post, I mentioned one lab I wanted to do:

Compression waves in a Slinky.  We want to measure stiffness and mass as well as the speed of compression waves.  That way we can compare our simulation to real measurements.

Well, my wife was downtown today and bought us a Slinky in the toy store, so the lab is on for this Friday.  Here are some things we should do:

  • Determine the mass of the Slinky.
  • Determine the number of turns of the helical coil (and hence get mass per turn).
  • Determine the stiffness of the spring.  Since the Slinky has a low stiffness and a fairly high mass, it might be good to do this by measuring the stretch of the slinky under its own weight.  Note that the top of the Slinky stretches much more than the bottom, so it is necessary to come up with the proper model for how a spring stretches under its own weight (a fairly simple thing, but a good test of understanding).
  • Come up with some other way of measuring the stiffness of the Slinky, and compare it with the self-weight estimate.
  • Estimate the stiffness for each turn of the Slinky, so that we can model it as a stack of many identical 1-turn springs.
  • Write a Vpython 1D simulation of the Slinky, using the mass and stiffness of each turn of the helix a separate object.  (This is essentially 4.P.90, but using measured mass and spring constants, rather than estimates of atomic masses and metal-lattice bond stiffness.)
  • Videotape compression waves in the spring, and estimate their speed (the “speed of sound” in the spring).
  • Compare the measured speed of sound with the Vpython computation.

If the 1D simulation does a good job, we can look into doing a full 3D simulation of a Slinky, and see if we can simulate it walking down stairs.

Unfortunately, I’m probably going to have to use the same household computer than my son uses for the Vpython programming.  I had to break Vpython on my  laptop, so that I could run a different Python package that I needed for work.  Unfortunately, Vpython only runs on the obsolete 32-bit Python, because it is tied to the obsolete Carbon framework on the Mac.  This means that Vpython will be dead within 5 years, unless the developers can figure out how to run it under Cocoa (they claim there is a thread priority problem in Cocoa that they don’t know how to work around), or go back to running under X Windows.  Actually, there is an X Windows version of Vpython that supposedly can be compiled for the Mac, but I read the installation instructions for it, and decided that Vpython was simply not worth that much hassle—if I wanted to spend all my time figuring out arcane installation techniques I would have bought a Linux box, not a Mac..  If they rewrote the Mac installer so that you had the choice of 32-bit Python and Aqua windows or 64-bit Python and X windows, I’d do it.

2011 December 2

Physics homework (Chapter 4)

Filed under: home school — gasstationwithoutpumps @ 18:21
Tags: , , , , ,

Physics homework for

  • (re)read Chapter 4.
  • Work problems
    • 4.P.44 Also, look up copper’s density, atomic weight, and Young’s modulus on the web and add copper to the list. This should repeat the computations on p. 163.
    • 4.P.46
    • 4.P.47 We’ll do this measurement of Young’s modulus as a lab together.
    • 4.p.51 (Compare to the computation in 4.P.44)
    • 4.P.55
    • 4.P.78
    • 4.P.81
    • 4.P.82
    • 4.P.85
    • 4.P.88 (See 4.P.86 for needed numbers)
  • Do computational problems:
    • 4.P.89
    • 4.P.90, but instead of interatomic springs, let’s use the mass and stiffness of turns of a slinky (which we will have to measure).

I have several labs I want to do with Chapter 4, now that we are finally into the meaty material:

  • Measurement of Young’s modulus using a wire.
  • Compression waves in a slinky.  We want to measure stiffness and mass as well as the speed of compression waves.  That way we can compare our simulation to real measurements.
  • Speed of sound in a metal rod (using an Arduino to do the timing).

Since this looks like three or four weeks worth of labs, the homework assignment should be spread out over a similar time period.  Do 4 problems a week, starting with ones that don’t depend on lab measurements.

%d bloggers like this: