Introduction: Magnetic Pendulum

Here's a quick and simple project for a lazy afternoon. We are going to make a perpetual pendulum using Arduino and a few components. If you pack it nicely it will make a great decoration for your workshop or a nice gift.

Step 1: Parts

Here are the basic parts you will need:

  1. Arduino.I used Nano on a small breadboard.
  2. Coil. You can salvage one from a dead hard drive, or even make one, as described below.
  3. Acquire some magnets. I found some small neodymium 2x5mm disk shape magnets on eBay.
  4. 100Ω..1kΩ resistor.

You will need some additional parts to complete the pendulum. This is up to your imagination, but I will give an example.

Step 2: How It Works

Imagine a magnet passing over a coil. According to the Faradey's law of induction, the voltage induced in the coil is proportional to the rate of change of the magnetic flux through the coil. Without going into equations, the induced voltage will depend on the number of turns in the coil, speed of the magnet, magnet's flux density ("strength") and the size/shape of the coil. The induced voltage will look pretty much like the one shown above (or inverted, depending on polarity). The first, in this case negative, part is induced as the magnetic field is entering the coil (magnetic flux rises) and the second, in this case positive, part as the field is leaving the coil (magnetic flux decreases). When the magnet is right above the coil the induced voltage is zero as the magnetic flux is constant, since the magnet is neither coming nor going, and the rate of change (derivative) of the field is zero.

OK, enough with the science. What we want is to detect the second part of the waveform just when the magnet passes the center of the coil. Then, by turning the coil into electromagnet, we'll give the magnet a small push.

Step 3: Schematic

Connect the resistor and the coil in series between A0 and GND on your Arduino board. Don't worry about the coil polarity as the proper operation can be achieved later by flipping the coil or the magnet. The resistor value is not fixed, different values will change the force that the magnet will be pushed with (lower resistance - higher force). Although it might even work without the resistor if the coil resistance is high enough, I wouldn't recommend going bellow 100 Ω and relying on Arduino's current limiting (or the lack thereof).

If you don't have a premade coil you can make one. Find some thin enameled wire and wind a coil using this calculator. Aim for couple of mH or more. Mine is about 2.6 mH, inner radius ~15 mm, approximately 250 turns of 0.14 mm wire.

Step 4: Code

The ADC is constantly sampling the coil voltage at 1 ms period. Once the THRESHOLD value is reached during the second, positive, part of the waveform the coil turns into electromagnet, pushes the coil for PUSH_TIME milliseconds and than goes back to sensing the voltage again. Here, it is important that the second part of the waveform is positive since we cannot measure negative voltages directly with the Arduino's ADC.

Set THRESHOLD low enough to detect the magnet as soon as it passes the center of the coil, but high enough to avoid false triggering by noise. Set PUSH_TIME to couple of tens of milliseconds.

Step 5: Completing the Pendulum

Here's one example how to complete the pendulum. Using a plastic cap, a wire, some cotton thread and an IC make a miniature swing. Place the circuit inside the box, glue the coil under the top side of the cap and cut a hole for the power supply. Using some LEDs, diodes and resistors make a small figure, give it a pair of magnetic feet and place it on the swing. Adjust the thread length and bend the figure's legs to position the magnets just above the coil. Plug the power in, give the figure a little push and enjoy the perpetual motion! In case it's not working reverse the coil or magnet polarity and give it another try, or play with THRESHOLD and PUSH_TIME values as described above.

Comments

author
manic+matt made it!(author)2015-09-27

I like this but do you know if it is possible to get it to light up every time it passes its peek or the base

author
rafununu made it!(author)2015-09-28

You could simply use the pulse to the coil to light a Led.

The Arduino can be replaced with a couple of transitors and passive components.

author
gravityisweak made it!(author)2015-09-28

Do you have more info on how this can be done with the transistors and passive components? Arduino is great, but it seems like overkill for many things.

author
JimRD made it!(author)2017-02-21

Here is a two transistor kicker circuit I have used. Simple and works great.

http://www.trainelectronics.com/Pendulum/article.h...

author
gravityisweak made it!(author)2017-02-24

Thanks! That's exactly what I was looking for!

author
JimRD made it!(author)2017-02-24

Welcome. I use mine for a couple of projects and it runs for days or weeks on a set of batteries. I want to replace the 1 meg with a 1 meg potentiometer to get some control over the timing. I think that is the resister to replace.

author
markinstruct made it!(author)2015-09-29

You could also use the Adafruit Trinket or even an ATTiny45 or ATTiny85 if you already have a programmer.

author
tangenendt made it!(author)2015-09-28

Was thinking about the same... ;)

author
JimRD made it!(author)2017-02-21

Thanks for this. I use a two transistor circuit but want to use an Arduino.

author
Machine made it!(author)2016-04-27

Very nice! Love it. I'll make one. Thank you.

author
martin.pfitzner.942 made it!(author)2015-10-23

Awsome idea. I used an ATTiny85 and added a swing activated, blinking LED-head.

Magnetimpulsschaukel.avi
author
Jlburt made it!(author)2015-09-29

What is the code? I am a noob.

author
bandidr made it!(author)2015-09-30

See Step 4:

magnetic_pendulum.ino308 bytes

author
gravityisweak made it!(author)2015-09-28

I'd love to see a video or animated gif of this!

author
alexkirlian made it!(author)2015-09-29

Me to.

author
robot797 made it!(author)2015-09-27

no video?

author
dmwatkins made it!(author)2015-09-27

Awesome project and writeup!

About This Instructable

24,214views

195favorites

License:

More by zohurap:Magnetic PendulumBicycle Handlebar Phone Holder
Add instructable to: