Posts | Comments

Planet Arduino

Archive for the ‘Pi’ Category

Are you a math aficionado in need of a new desk toy? Then do we have the project for you. With nothing more than an Arduino and a seven-segment LED module, [Cristiano Monteiro] has put together a little gadget that will slowly work its way through the digits of Pi forever…or until you get bored of looking at it and decide to use the parts for something else.

On the hardware side, we really can’t overstate how simple this project is. A common four-digit LED display is connected up to an Arduino Nano, which is then plugged into the computer for power. [Cristiano] is using a breadboard here, but you could just as easily use four female-to-female jumpers to connect the two devices together. We suppose this would be a pretty good project for anyone who’s looking to get some practical experience with PCB design as well.

The real magic is in the software, which [Cristiano] has been kind enough to release under the MIT license. Calculating Pi on such a resource-constrained chip as the ATmega328P is far from ideal, but by porting over a C++ algorithm developed by [Xavier Gourdon] and [Pascal Sebah] for their paper Computation of the n-th Decimal Digit of π with Low Memory he was able to pull it off, albeit slowly.

Now if you’ve got slightly better hardware, say a pair of Xeon processors and 96 GB of RAM, you could calculate Pi out to a few trillion digits for fun, but it wouldn’t look as cool as this little guy blinking away.

Pi Time is a psychedelic clock made out of fabric and Neopixels, controlled by an Arduino UNO. The clock started out as a quilted Pi symbol. [Chris and Jessica] wanted to make something more around the Pi and added some RGB lights. At the same time, they wanted to make something useful, that’s when they decided to make a clock using Neopixels.

Neopixels, or WS2812Bs, are addressable RGB LEDs , which can be controlled individually by a microcontroller, in this case, an Arduino. The fabric was quilted with a spiral of numbers (3.1415926535…) and the actual reading of the time is not how you are used to. To read the clock you have to recall the visible color spectrum or the rainbow colors, from red to violet. The rainbow starts at the beginning of the symbol Pi in the center, so the hours will be either red, yellow, or orange, depending on how many digits are needed to tell the time. For example, when it is 5:09, the 5 is red, and the 9 is yellow. When it’s 5:10, the 5 is orange, the first minute (1) is teal, and the second (0) is violet. The pi symbol flashes every other second.

There are simpler and more complicated ways to perform the simple task of figuring out what time it is…

We are not sure if the digits are lighted up according to their first appearance in the Pi sequence or are just random as the video only shows the trippy LEDs, but the effect is pretty nice:

 


Filed under: Arduino Hacks, led hacks

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]


Filed under: Arduino Hacks, misc hacks


  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook