If you need a truly random event generator, just wait till your next rainstorm. Whether any given spot on the ground is hit by a drop at a particular time is anyone’s guess, and such randomness is key to this simple rig that estimates the value of pi using raindrop sensors.
You may recall [AlphaPhoenix]’s recent electroshock Settlers of Catan expeditor. The idea with this less shocking build is to estimate the value of pi using the ratio of the area of a square sensor to a circular one. Simple piezo transducers serve as impact sensors that feed an Arduino and count the relative number of raindrops hitting the sensors. In the first video below, we see that as more data accumulates, the Arduino’s estimate of pi eventually converges on the well-known 3.14159 value. The second video has details of the math behind the method, plus a discussion of the real-world problems that cropped up during testing — turns out that waterproofing and grounding were both key to noise-free data from the sensor pads.
In the end, [AlphaPhoenix] isn’t proving anything new, but we like the method here and can see applications for it. What about using such sensors to detect individual popcorn kernels popping to demonstrate the Gaussian distribution? We also can’t help but think of other ways to measure raindrops; how about strain gauges that weigh the rainwater as it accumulates differentially in square and circular containers? Share your ideas in the comments below.
14 thoughts on “Rainy Day Fun By Calculating Pi”
Put a square container and a circular container in the rain, and one the rain has passed calculate PI from the ratio of the adjusted volume (if different sizes) captured in each.
Maybe turn the containers into.capacitors (or.inductors) and measure the difference that way.
Possibly more accurate measurement of pi.
Shouldn’t time between drops also eventually lead to Pi?
Thinking about it it would just be the inverse of what it does already.
Nice! Way more fun than just bounds-checking random (x,y) coordinates on a computer.
You could possibly do a similar calculation of π using radiation detectors shielded with lead except for the square and circular apertures.
You could use a banana or the Americium in a smoke detector as a radiation source.
Actually, you could probably modify the smoke detector…
Or, you can just calculate PI by throwing some sausages on a wooden floor.
Friend of mine told me throwing sausage down hallway is not very enjoyable. I have to show him this video.
What about weighing the square and circular pieces of wood? Their ratio also would give us Pi I think?
Isn’t it easier to just cut a circle and a square out of the same material and then do the ratio based on their weight? No need to accumulate water drops, volume displaced or anything else
I think his intent was to show how pi can be calculated using the monte carlo method https://en.wikipedia.org/wiki/Monte_Carlo_method rather than just to work out pi.
. . . or just look it up, LOL! My kids made a game of how many digits of pi they could memorize. I stopped at 11.
That’s what I said above…
Please be kind and respectful to help make the comments section excellent. (Comment Policy)