Can you imagine a tall glass dome jam-packed with a three-dimensional array of LED-based neurons frantically flickering away in response to sound?
I can’t help myself. With all the talk about deep learning and artificial neural networks that's currently flying around, I have the overwhelming urge to build my own brain. Well, "brain" might be somewhat of a grandiose term for what I have in mind, but I had to call it something and "Simon" didn’t quite cut the mustard.
This all came about when EE Times community member GSKrasle posted a comment to my recent column: Who Wouldn't Want a Big Hex Computer? In this comment, GSK pointed me at what he described as "A whole digital clock 'air-wired' with no digital chips."
In fact, this little scamp was created by techno-logic-artist Gislain Benoit, and it really is a thing of beauty that's gorgeous to behold. Simply called The Clock, this amazing creation is constructed using resistors, transistors, diodes, and LEDs. In all, it comprises 1,916 discrete electronic components, one of its most amazing features being that these components are directly soldered together to form a three-dimensional structure; that is, there is no printed circuit board.
Now, as jaw-dropping as The Clock is, it's Gislain's second creation, dubbed The Tower, that has captured my attention. If anything deserves an official "Oooh, Shiny!" appellation, then this is it.
The Tower is also a timepiece. In this case, however, all the diodes used to form the digital logic are LEDs (1,415 in all). This allows the observer to watch the various logic and counting operations take place at the most fundamental level.
On the one hand, I do like the idea of implementing digital functions using discrete resistors, transistors, and diodes (LEDs) and watching them all clock along (no pun intended). On the other hand, I fear that Gislain has pretty much cornered this market.
Next, I started thinking about my chum Steve Manley and his entry to our Cunning Chronograph Competition. Take a peek at this video showing Steve's creation when he brought it over for a "show and tell" at my brother's house when I was visiting my mom in England last year.
As you'll see, starting around 40 seconds into the video, Steve has equipped his clock with a microphone, and he uses this to implement a suite of very tasty audio display modes. I think a combination of Steve's audio presentation and Gislain's 'air-wired' tower is going to form the basis for my Bodacious Brain. I'm envisaging this little rapscallion responding with an organic light display to any ambient sounds, such as me talking, my cat meowing, or music playing.
Introducing the Bodacious Brain
Let's start by saying that, having seen The Tower, I'm visualizing my own not-so-little beauty as being presented in a glass dome. I had no idea just how expensive these little rascals could be until I started rooting around on the Internet. The most cost-effective option I've found thus far is this 25" tall, 10" diameter dome for ~$115 from a seller called PartySpin on eBay.
Of course, whatever anyone tells you, size does matter, and it's definitely a case of "the bigger the better" for this sort of thing. I'm currently drooling over the thought of a 30" tall, 18" diameter dome from the guys and gals at GreatGlas.com, but I fear the $1,595 price tag is just a tad outside your humble narrator's reach.
Whichever enclosure we end up with, I want you to imagine that it's jam-packed with a three-dimensional matrix of artificial neuron-like "cells," each of which comprises a LED and a smattering of other components, all 'air-wired' together as in Gislain's creations. How these cells actually respond to external stimulus in the form of sound is something we will be discussing a little later, but first...
Who is in control?
The master control is going to be provided by an Arduino Nano, which can be picked up for $9.95 from MPJA.com. Why this processor? Well, it's small, cheap, and cheerful; also, I just happen to have a bunch of them laying around in my office.
As you may recall from my Bodacious Acoustic Diagnostic Astoundingly Superior Spectromatic (BADASS) Display project, the MSGEQ7 contains seven band-pass filters tuned to 63 Hz, 160 Hz, 400 Hz, 1,000 Hz, 2,500 Hz, 6,250 Hz, and 16,000 Hz (see also my MSGEQ7-Based DIY Audio Spectrum Analyzer: Construction, Testing, and Software & Timing columns).
(Source: Max Maxfield)
As illustrated above, each filter has an associated peak detector. The clever thing is that the outputs from the seven peak detectors are multiplexed together, which explains how everything fits into a teenie-weenie eight-pin package.
The way this works is that the analog output from the MSGEQ7 is connected to one of the Arduino's analog inputs. By using a pair of digital outputs to probe and strobe the MSGEQ7, the Arduino can read the seven analog values corresponding to the amplitudes of the seven frequency bands.
I'll be providing circuit diagrams and more detailed component selections in future columns. Suffice it to say for the moment that my chum, Duane Benson, is creating a small Arduino Nano-compatible shield to hold the MSGEQ7 and associated components. (The price of the bare board should be a relatively paltry sum. If you think you might be interested in having one of these boards yourself, email me at email@example.com with the subject line "Bodacious Brain" and I'll add you to the list. Once we have the prototype up and running and we know how much they cost, I'll email you back to see if you're still interested.)
Tight-laced and restricted vs. fluid and organic
In the case of the BADASS Display, we employed a 16 x 16 = 256 array of tri-colored LEDs. Looking at this video, I'm reminded that I really do need to equip this little ragamuffin with a Simblee-based Bluetooth control system, as opposed to forcing my chum Ivan to lay on the floor pressing the buttons (locating the control panel at the bottom seemed such a good idea when we were on the drawing board), but we digress...
One thing about the BASASS display is that I used NeoPixel Strips from Adafruit. This means that each pixel can be used to represent practically any color one wishes. It also has the advantage that the pixels are daisy-chained together and you can drive the entire string using a single digital output from the Arduino. The disadvantage in the case of the Bodacious Brain is that -- if we use a single, central controller -- we will have to explicitly define the state of each LED under program control, and that's not what I'm wanting to do.
Another aspect of the BADASS Display is that I predominantly used the lit height of the columns to reflect the amplitude of the corresponding frequency band. I don’t plan on doing this in the case of the Bodacious Brain. Instead, I'm envisaging something much more "organic" -- like the animations you see of neurons firing in the brain -- with one neuron triggering another, which may or may not trigger another, and so on and so forth. Thus, an initial sound might trigger a cascade of flickering LEDs that gradually dies down once the source of the sound has been removed.
This is where things start to get tricky
We should probably kick-off this section with my acknowledging that I really don’t have much of a clue where we're going with this at the moment, so any and all suggestions will be very much welcomed. Let's begin with the fact that the Arduino Nano has 12 usable digital Input/Outputs (I/Os). It also has 8 analog inputs that can be used as digital I/Os. Based on this, I'm envisaging something like the following:
(Source: Max Maxfield)
As we see, the analog output from the microphone breakout board is used to drive the analog input to the MSGEQ7; also, it will be fed directly to one of the Arduino's analog inputs. Meanwhile, the analog output from the MSGEQ7 will be fed to another of the Arduino's analog inputs. Two of the Arduino's digital outputs will be used to control the MSGEQ7 (remember that we can use these to read the magnitudes of the seven band-pass filters as analog values out of the MSGEQ7's analog output).
We'll also reserve two of the Arduino's digital inputs to act as controls to select between four different modes (I have no idea what these modes will be at this time, but it seems like a good idea to be prepared). This means we have 14 digital signals (comprising the 8 remaining digital pins and the 6 remaining analog pins) that we can use -- if we wish -- to drive into the tower; i.e., the main part of the Bodacious Brain.
With regard to the different operating modes, the only thoughts I have thus far is that it would be nice if the brain reacted to random sounds like someone talking to it or the cat saying "meow," and also if it reacted in an appropriate and interesting manner to music being played nearby. It may end up that there is only one operating mode and that both of these occurrences are treated in the same way, in which case we will have two more digital pins at our disposal.
In the case of the 14 signals available for us to feed into the tower, there are several things we could do here. One might be to bypass the MSGEQ7 and output one or more pulses on one or more pins if we detect any sound whatsoever coming from the microphone. Alternatively, we could generate pulses on seven of the outputs corresponding to specified thresholds (say 50% values) being crossed on each of the MSGEQ7's filters.
Yet another possibility would be to treat seven of the signals as software-driven PWM (pulse-width modulated) outputs whose values corresponded to the amplitudes of the MSGEQ7's filters. The real trick, of course, is to decide how to use all these values inside the brain...
Earlier, I mentioned my idea that the tower would be "...jam-packed with a three-dimensional matrix of artificial neuron-like 'cells,' each of which comprises a LED and a smattering of other components, all 'air-wired' together..." When I first began to cogitate and ruminate on this project, I vaguely thought about using individually-packaged, single-color LEDs -- probably a mix of red, yellow, and orange; possibly some purple and green; probably not any blue, although I don’t want to rule anything out at this stage.
I was also thinking that we'll use the LEDs that come in transparent packages -- rather than the ones in colored packages -- because that way an observer won’t know what colors to expect until things start to light up. Based on these initial assumptions, I started off visualizing each cell as looking something like the following:
(Source: Max Maxfield)
Well, I don’t know about you, but I feel much better now we have something concrete to talk about (LOL). In the case of the "cloud" driving the input to the transistor, I was vaguely contemplating some sort of analog "stuff" that takes a bunch of signals from other cells and ultimately triggers this cell once some sort of threshold has been reached. In the case of the "cloud" driving the output from the cell, I have no thoughts whatsoever, it just seemed like a good idea to add this to balance the diagram.
There are, of course, several problems with this scenario, not the least being that wibbly-wobbly signals in the analog realm invoke feelings of disquiet within my soul -- I'm much happier with the tried-and-trusted logic 0s and 1s of the digital domain.
This leads us to an alternative scenario, in which each cell boasts a small microcontroller that is used to monitor the inputs to the cell, control the LED, and drive any outputs to other cells. In this case, since we are already using a microcontroller, we may as well use a tri-colored LED, perhaps looking something like the following:
Regular common-cathode tri-colored LED (Source: Max Maxfield)
The input/output signals from/to other cells could be in the form of pulses or logic (0 and 1) levels. The three signals driving the LED could be simple 0 and 1 values, thereby providing us with eight colors (assuming off/black to be a color), or they could be PWM outputs, thereby allowing each LED to present millions of different colors.
Yet another alternative would be to use individually-packaged 8mm NeoPixels from Adafruit as illustrated below (the reason I mention 8mm specifically is that I happen to have 550 of these little beauties here in my office because I still intend to one day build an 8 x 8 x 8 cube):
Each NeoPixel includes its own controller and PWM functions, and it can be driven using a single pin from the microcontroller, so our cell would now look something like the following:
Tri-colored NeoPixel (Source: Max Maxfield)
In both of the above examples, we'd probably use a surface-mount microcontroller and -- if necessary -- surface-mount current limiting resistors, in which case all of the components forming each cell would probably be presented on a small (~0.5" x 0.5" square) circuit board. The downside to all this is that we've moved away from the original pure 'air-wired' concept, but there would still be a humongous amount of cell-to-cell wiring, and the big advantages are that we would have many more colors to play with and total control over the way things happen at the cell-level, while still maintaining our "organic" cell-to-cell interactions.
Speaking of control...
If we opt to go with the original, 100% air-wired, analog-cell implementation, then it may be that each cell needs to include one-or-more trim-pots allowing its sensitivity and/or trigger levels to be fine-tuned. It may also be that we need to provide some sort of global reference signals that can be tweaked on an individual basis.
Alternatively, if we decide to go with the microcontroller-in-each-cell approach, then we have another problem to consider. Let's start by saying that all the microcontrollers driving the cells will be running the same program. Even so, once the Bodacious Brain has been constructed, there's no way we want to have to keep on individually re-programming 100s of cells to fine-tune the system. What we need is for the master controller in the base of the tower to be able to instruct the microcontrollers in the cells as to how they are to perform their duties. I'm envisaging using an I2C approach looking something like the following:
(Source: Max Maxfield)
There are so many ways we could go here, such as having the microcontrollers in the cells each running a Python virtual machine, and then -- on power-up -- having the Arduino in the master controller broadcasting the same application program in byte code to all the cells.
As always, however, I fear I'm in danger of over-engineering the problem. It will be far simpler to create the base program running in the cells in C/C++. Then, on power-up, the master controller can simply broadcast a series of byte values that are used to fine-tune the program, such as the number of inputs to the cell that need to be active in order to activate that cell's LED, the color of the LED, how long the LED stays on, and so on and forth (we might decide to allow the cell to generate these values randomly, in which case we need only broadcast the upper and lower limits associated with each parameter).
Regarding the two mode pins, if we do decide to have multiple modes, then switching between modes could cause the master controller to upload a different series of values into the cells.
I think I'm just about ready to hand this over to you to hear your ideas, but first...
One last point
I'm an impatient man. I don’t want to spend months building the Bodacious Brain before I start to see something happen -- I want flashing lights and I want them now! This means that we need to construct the brain in a modular fashion.
In my case, I'm thinking of creating a series of ~1" tall slices. Each slice will boast a bunch of cells. In the case of the lowest-level slice, the primary inputs to some of the cells will come from the master controller, but there will also be a lot of cell-to-cell connections, which means that the first slice will be sufficient unto itself.
In the case of each subsequent slice, we will want to accept some number of signals from the slice below and pass some number of signals to the slice above. Furthermore, in addition to passing signals "up" the tower, we also want to feed some of the signals back down again.
If we do this right, someone should be able to build a small "brain" using just a handful of cells, while someone else could scale everything up to whatever size their heart desires.
OK -- I've waffled on for long enough. If we do decide to use the microcontroller-based cell approach, and if we could manufacture the cells cheaply enough, do you think you'd be interested in using some number of these cells to create your own Bodacious Brain? As always, any comments, questions, and suggestions will be very much appreciated.
@DigitalEngineer: ...Have you thought about doing it all analog ? It would add a mind blowing dynamic to the brain. More of a back to the roots kinda thing. A cell with a single transistor and a (variable) capacity...
Actually, this was my initial plan -- it was my chum Ivan who persuaded me to look at an MCU-based solution -- there are just so many fun things to do and so little time to do them all in...
@jwizard93: ...I just wanted to mention a very cheap PIC MCU that I've found can handle software PWM on all five of it's outputs no problem. The PIC12LF1552...
Thanks for the suggestion -- we (my chum Duane and myself) are just in the process of bouncing ideas back and forth on this.
In addition to +5V, GND, and two I2C pins, we need three pins to drive the tri-colored LED -- we're still undecided as to whether to have these as PWMs or just on/off.
If we envisage each cell as occupying a cube, and if we say each cell can accept one input from below, above, left, right, forward, and back, plus it has one output to indicate it's triggered, then in addition to power, ground, and I2C we need 10 digital I/Os -- so that's a 14-pin chip.
Another decision is whether we go surface mount or lead-through hole. The former would make for a much smaller cell, but the latter would allow self-assembly. We were wondering if people would be interested in buying these and building their own brains.
@Realjjj you mean shrink a whole bunch of them :-) Those spherical drones are clever, I've seen a couple of variations on them. I saw one video of one flying through a forest, doesn't matter if it bumps nto trees....
This project sounds pretty sweet. I'm pretty new and have only a small amount of experience, but I just wanted to mention a very cheap PIC MCU that I've found can handle software PWM on all five of it's outputs no problem. The PIC12LF1552 has a 4x PLL that gets you executing instructions at 8 MHz. If you already have a PIC programmer you can get the RGBs plus two auxillary single colors flashing and fading with virtually any pattern for about $0.70 a pop. I thought I did well to select this MCU for my LED project so I thought I'd share. I don't recall the I2C situation but if you drop an auxillary LED it could be handled with software I presume. I look forward to reading more about this.
Was deviating from that, wanted fireflies in the night so each light would need to be able to fly. You wouldn't have control to create an image but maybe that's better as predictability would make it boring.
Flying seemed easier in a liquid and electromagnets could be a viable propulsion system at the right ball density. Each ball would have a mind of its own but it has to be kept simple to keep mechanical volume and costs in check.
In my first comment i was mentioning maybe adding a laser sculpture. One or a few lasers at the base and some mirrors. With wired balls you could add laser in some balls ,maybe some mirrors in other balls. Optical fiber can be used too, doesn't have to be only LEDs.