book collections email follower instructable user
Picture of RGB LED Newton's Cradle

The Newton´s pendulum is a device that demonstrates conservation of momentum and energy. A typical Newton's cradle consists of a series of identically sized metal balls suspended in a metal frame so that they are just touching each other at rest.

Instead of buliding such device, I thought to build an idealized 5-LED-ball Newton´s cradle desk-toy using a microcontroller. The strikes between balls is simulated by two micro servo motors.

I have included a potenciometer to adjust the frequency of the movement and a button to switch between the two run modes availables.

I hope you like.

Step 1: List of Material

The list of material is the following:

  • ARDUINO MEGA 2560 R3 or compatible ARDUINO MEGA 2560 R3 microcontroller
  • Protoboard 480
  • 2 micro servo motors
  • 5 ping-pong balls
  • 5 RGB LED (common anode)
  • 15 220 ohmios resistors
  • 1 10K ohmios resistor
  • 1 potenciometer
  • 1 button
  • Metal tubes
  • Methacrylate
  • Wooden rods
pjessing3 months ago
When verifying the sketch it says "expected '}' at end of input". Any thoughts?
TecnoProfesor (author)  pjessing3 months ago
Thank you pjessing for your message
I have just downloaded the sketch from the web page and I have just verified it without errors. Please dowload it again. If the problem remains don't hesitate to contact me again.
lreynol44 months ago
This is just TOO cool!!!
TecnoProfesor (author)  lreynol44 months ago
Ok. Sorry. I didn't understand you
I have just included in the code comment lines. Just only download the zip file and open the sketch
I hope be enough.
TecnoProfesor (author)  lreynol44 months ago
I am glad you like
Thanks and regards
wclapie4 months ago
is there a program you have to load for the Arduino?
TecnoProfesor (author)  wclapie4 months ago
Hi. I recommend you to download and install the ARDUINO IDE 1.8.9 from
Okay, i know i am a noob at this, but this is just an >IDE of Arduino, could you help us with the actual coding, i know basics so i could figure out how to manipulate servo by checking examples on Arduino page, but it would be helpful if you post explanation on whole coding
NiggyB4 months ago
TecnoProfesor (author)  NiggyB4 months ago
Thanks NiggyB
I am glad you
RanT14 months ago
That's really ingenious, simulating the swinging with two servos, instead of trying to make an actual cradle with all the LED-filled balls banging into each other. Even if you could get the mechanics to work, getting the LED sequencing right could be a nightmare.

Did you consider using WS2811 or WS2812 modules, instead of "bare" RGB LEDs? It would simplify the wiring, and drastically cut the number of I/O pins needed. You could build it with a Micro or Nano, instead of a Mega.

Thanks for sharing this.
TecnoProfesor (author)  RanT14 months ago
Thank you for your comment RanT1
It is a good idea and of course it would simplify the wiring.
I will take into account.
HGC4 months ago
Very clever
TecnoProfesor (author)  HGC4 months ago
Thank you for your comment HGC
L. NicholsC4 months ago
I downloaded the zip file but all the unzipped files have extensions I don't recognize. What application used them?
TecnoProfesor (author)  L. NicholsC4 months ago
The file with fzz extension are Fritzing files. Just only to clarify the connections. The last pictures in the step 4 are the jpg versions of these files.
fruityfred4 months ago
Very nice project! You're a genius! :)
TecnoProfesor (author)  fruityfred4 months ago
Thank you very much for your comment
I'm glad you like it and If you have any question don´t hesitate to contact me
Thanks for sharing this fun Arduino project!
TecnoProfesor (author)  WeTeachThemSTEM4 months ago
Thanks for your comment