# Rainy Day Fun By Calculating Pi

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.

[via r/electronics]

## 14 thoughts on “Rainy Day Fun By Calculating Pi”

1. Truth says:

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.

1. Maybe turn the containers into.capacitors (or.inductors) and measure the difference that way.
Possibly more accurate measurement of pi.

2. Truth says:

%s/one/once/g

3. John says:

Shouldn’t time between drops also eventually lead to Pi?

1. John says:

Thinking about it it would just be the inverse of what it does already.

4. jbb says:

Nice! Way more fun than just bounds-checking random (x,y) coordinates on a computer.

5. notarealemail says:

Really nice!
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…

6. rogeorge says:

Or, you can just calculate PI by throwing some sausages on a wooden floor.
:o)

1. Friend of mine told me throwing sausage down hallway is not very enjoyable. I have to show him this video.

7. Hans Middelbeek says:

What about weighing the square and circular pieces of wood? Their ratio also would give us Pi I think?

8. why_make_it_simpler_if_it_can_be_far_more_complex says:

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

1. nuclear says:

. . . or just look it up, LOL! My kids made a game of how many digits of pi they could memorize. I stopped at 11.

9. Hans Middelbeek says:

That’s what I said above…

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.