Introduction: Coupled Pendulums Experiment Using Arduino Uno

In this instructable I'm going to show you how to build coupled pendulums, how they work and how we can track and analyze their movement using an Arduino Uno with ultrasonic sensors.

Supplies

  • material (e.g. Lego) to build your coupled pendulums
  • neodymium magnets
  • Arduino Uno
  • 2x HC-SR04 ultrasonic sensors
  • Jumper Wires
  • Breadboard
  • Excel or Google Sheets

Step 1: Build the Coupled Pendulums

First, we need to build the two single pendulums. For optimal results they need to be identical in terms of length, shape and mass distribution. Hang them up like a swing so they can only swing in one direction. They also have to move very easily and shouldn't have much friction. I used Lego for this so I could build them the exact same, but you could use wood or cardboard too.

To couple the pendulums, glue the magnets onto the bobs so they repell each other. The distance between the pendulums needs to be big enought so that they're not visibly pushed out of their equilibrium position. They still have to be able to repell each other if one pendulum is moved towards the other one though.

If you're using lego like me and the rods have holes in them, close them by adding flat Lego pieces. Otherwise you won't get a clear sensor signal later on.

Step 2: Testing the Setup

Give one of the pendulums a push and try out if it affects the other one. After a few seconds the other one should begin to swing too.

Step 3: Build a Sensor Holder

Now we need to build something to hold the sensors. They need to be placed upright like in the picture to work properly in this experiment. They also need to be at a height to be able to track the rods or, in case they're too thin, the bob.

In my case, I used Hot Glue to attach them to a piece of cardboard which I then glued onto a breadboard. To keep everything nice and organized I attached the Arduino Uno to the other side.

Step 4: Wiring

The ultrasonic sensors need to be wired to the Arduino as follows:

left Sensor:

  • Trig => 6
  • Echo => 7

right Sensor:

  • Trig => 12
  • Echo => 13

GND and VCC obviously need to be connected too.

Step 5: Upload the Code

Upload the code to your Arduino Uno and open the serial monitor of the Arduino IDE. It should now print the time since the programm started running in ms, the vaue of the left sensor and the value of the right sensor. If the sensors 'see' the pendulum infront of them their output is '1'. Otherwise the output is '0'.

The sensors need to be around 5 cm away from the rods. You might need to readjust your sensors a little bit so both of them are triggered when the pendulums are in their equilibrium position.

Step 6: Measuring

To measure the pendulums movement press the Reset Button of the Arduino Uno and give one of the pendulums a swing. You will notice that the second pendulum starts to swing a little bit after a few seconds with increasing amplitude. The amplitude of the first pendulum decreases more and more until only the second pendulum is swinging. Then the same ting happens again for the forst pendulum and so on.

After a while both pendulums stop swinging. Depending on how well your pendulums can swing this takes a longer or shorter time.

Due to their coupling, the pendulums give each other a 'kick' or slow down each other depending on their relative position to one another. This results in a constant exchange of energy which also leads to a changing amplitude and swinging speed. If you'd plot the defelction of one pendulum over time you would get a picture like above. While the frequency at which the pendulum is swinging theoretically doesn't change (if there was no friction) the amplitude is changing constantly. The deflection of the other pendulum would look the same but would have an offset.

If you're done with your measuring, copy everything from the serial monitor with by pressing [str]+[a] and paste it into an Excel or Google spreadsheet.

Step 7: Analyze Your Results

Plot the table like shown in the picture and you should get a similar result like me.

You can see that the intervals where the sensor detects a '1' change in length more or less periodically. The shorter they are, the faster the pendulum is swinging which means that it has more energy 'stored' in that moment. The shorter they are, the less energy is 'stored'.

You propably notice some very wide impulses. Thats when the pendulums amplitude is so small that the sensor doesn't notice that the pendulum is still swinging. Nevertheless it is still swinging a little bit in that moment. It's just not measurable for us in that moment.

The other sensor notices a similar change in swinging speed but here the pendulum is swinging faster when the other one is slower and so on. These diagramms visualise the exchange of kinetic energy between the pendulums.

Step 8: Have Fun With Your Data

now it's your turn to go and have fun with the collected data. You could calculate how fast the pendulums are swinging by taking the impulse width and dividing it by the width of your rods. You could also calculate how long it takes to transfer all the kinetic energy from one pendulum the other.

Maybe try to give both pendulums a push in the beginning, or do whatever comes to your mind. You can meaure everything and compare your measurements with your expections.