Simple Arduino Build Lets You Keep An Eye On Pi

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.

Continue reading “Simple Arduino Build Lets You Keep An Eye On Pi”

Tensors Explained

You can do a lot of electronics without ever touching a tensor, but there are some situations in which tensors are absolutely essential. The problem is that most math texts give you a very dry description that is difficult to internalize. That’s where [The Science Asylum] comes in. Their recent video (see below) starts with the dry definition and then shows you what it means and why.

According to the video, the textbook definition is:

A rank-n tensor in m-dimensions is a mathematical object that has n indices and mn components and obeys certain transformational rules.

That sounds a lot like an array but we are not sure what “certain transformational rules” really means to anyone.

Wikipedia does a little better:

[A]n algebraic object that describes a linear mapping from one set of algebraic objects to another.

These constructs are key to anything electromagnetic (including antennas) and show up a lot in stress calculations and quantum mechanics. Even Einstien’s theory of relativity uses tensors.

Continue reading “Tensors Explained”

Wolfram Engine Now Free… Sort Of

You’ve probably used Wolfram Alpha and maybe even used the company’s desktop software for high-powered math such as Mathematica. One of the interesting things about all of Wolfram’s mathematics software is that it shares a common core engine — the Wolfram Engine. As of this month, the company is allowing free use of the engine in software projects. The catch? It is only for preproduction use. If you are going into production you need a license, although a free open source project can apply for a free license. Naturally, Wolfram gets to decide what is production, although the actual license is pretty clear that non-commercial projects for personal use and approved open source projects can continue to use the free license. In addition, work you do for a school or large company may already be covered by a site license.

Given how comprehensive the engine is, this is reasonably generous. The engine even has access to the Wolfram Knowledgebase (with a free Basic subscription). If you don’t want to be connected, though, you don’t have to be. You just won’t be able to get live data. If you want to play with the engine, you can use the Wolfram Cloud Sandbox in which you can try some samples.

Continue reading “Wolfram Engine Now Free… Sort Of”

Creating Black Holes: Division By Zero In Practice

Dividing by zero — the fundamental no-can-do of arithmetic. It is somewhat surrounded by mystery, and is a constant source for internet humor, whether it involves exploding microcontrollers, the collapse of the universe, or crashing your own world by having Siri tell you that you have no friends.

It’s also one of the few things gcc will warn you about by default, which caused a rather vivid discussion with interesting insights when I recently wrote about compiler warnings. And if you’re running a modern operating system, it might even send you a signal that something’s gone wrong and let you handle it in your code. Dividing by zero is more than theoretical, and serves as a great introduction to signals, so let’s have a closer look at it.

Chances are, the first time you heard about division itself back in elementary school, it was taught that dividing by zero is strictly forbidden — and obviously you didn’t want your teacher call the cops on you, so you obeyed and refrained from it. But as with many other things in life, the older you get, the less restrictive they become, and dividing by zero eventually turned from forbidden into simply being impossible and yielding an undefined result.

And indeed, if a = b/0, it would mean in reverse that a×0 = b. If b itself was zero, the equation would be true for every single number there is, making it impossible to define a concrete value for a. And if b was any other value, no single value multiplied by zero could result in anything non-zero. Once we move into the realms of calculus, we will learn that infinity appears to be the answer, but that’s in the end just replacing one abstract, mind-boggling concept with another one. And it won’t answer one question: how does all this play out in a processor? Continue reading “Creating Black Holes: Division By Zero In Practice”

Wolfram Alpha Electronic Tips

Electronics takes a lot of math. Once you’ve mastered all the algebra and calculus, though, it is sometimes a drag to go through the motions. It also can be error-prone. But these days, you have Wolfram Alpha which will do all the work for you and very easily. I use it all the time when I’m too lazy to solve an equation or do an integral by hand. But did you know it actually has some features specifically for electronics?

If you want to do a lot with electronics — or nearly any technical field — you are going to have to learn some math and you shouldn’t just rely on tools like Wolfram to skirt understanding the math. Unfortunately, schools often teach us that the point to math is to get a correct answer. For bookkeepers and at the very final stage of engineering, that may be true. But the real value to math for engineers and scientists is to develop intuition about things. If you increase a capacitor’s value does that make its reactance go up or down? Does a little change in load resistance make a corresponding small change in power consumption or is it a lot more? So you should understand why math works. But once you do, using a tool like Wolfram can free you to focus on the abstract questions instead of the detailed “grunt work.”

 

Tip #1: Split Personality

Wolfram can’t seem to decide if it is a symbolic math program or a search engine. Sometimes just putting a topic name in can lead to some interesting calculations. For example, look what happens when you enter the word opamp: Continue reading “Wolfram Alpha Electronic Tips”

Richard Feynman: A Life Of Curiosity And Science

It was World War II and scientists belonging to the Manhattan Project worked on calculations for the atomic bomb. Meanwhile, in one of the buildings, future Nobel Prize winning theoretical physicist Richard Feynman was cracking the combination lock on a safe because doing so intrigued him. That’s as good a broad summary of Feynman as any: scientific integrity with curiosity driving both his work and his fun.

If you’ve heard of him in passing it may be because of his involvement on the Space Shuttle Challenger disaster commission or maybe you’ve learned something from one of his many lectures preserved on YouTube. But did you know he also played with electronics as a kid, and almost became an electrical engineer?

He was the type of person whom you might sum up by saying that he had an interesting life. The problem is, you have to wonder how he fit it all into one lifetime, let alone one article. We’ll just have to let our own curiosity pick and choose what to say about this curious character.

Continue reading “Richard Feynman: A Life Of Curiosity And Science”

Solve 2D Math Equations Colorfully

Electronics can be seen as really just an application of physics, and you could in turn argue that physics is the application of math to the real world. Unfortunately, the way most of us were taught math was far from intuitive. Luckily, the Internet is full of amazing texts and videos that can help you get a better understanding for the “why” behind complex math topics. Case in point? [3Blue1Brown] has a video showing how to solve 2D equations using colors. If you watch enough, you’ll realize that the colors are just a clever way to represent vectors and, in fact, the method would apply to complex numbers.

Honestly, we don’t think you’d ever solve equations like this by hand — at least not with the colors. But the intuitive feel this video can give you for how things work is very valuable. In addition, if you were trying to implement an algorithm in software this would be tailor-made for it, although you wouldn’t really use colors there either we suppose.

Continue reading “Solve 2D Math Equations Colorfully”