Maxed Out: Building a Microcontroller-Based System

Reading time ( words)

Well, things are bouncing along at their usual frantic pace. As you may recall from my previous blog, I'm going to be presenting a couple of papers at the forthcoming Design West Conference and Exhibition, scheduled for April 22-25, 2013, at the McEnery Convention Center in San Jose, California.

One of these sessions is titled Danger Will Robinson! How Radiation Can Affect Your Embedded Systems. As part of this, I'm in the process of constructing a prop to illustrate how different forms of radiation can affect your electronics components and systems.

I started with a rather interesting wood-and-leather case from Amazon as shown here; my inventor friend Brian LaGrave, a master of rooting interesting things out on the Internet, tracked this little rascal down for me. I’ve just finished augmenting it with three antique telephone switches and three antique faceted light covers as shown here.

The antique telephone switches are a joy to behold. Even though they must be at least 50 or 60 years old, their feel shouts quality and this is the way things should be made.

The same thing applies to the light covers on the right side – by just looking at them and touching them, you know that these are well made.  Although it's a bit hard to see in the image, the three covers are, from top-to-bottom: green, amber, and red. In addition to being rugged, they are very well defined in terms of the light spectrum they will pass. I took a super-bright orange LED and held it behind them – the light passed easily through the amber filter, but almost nothing could be seen through the green and red filters.  

It's amazing to me just how long it took for me to decide just where to place these on the case. I'm not an industrial designer, but I know enough about the aesthetics of things to know that you don’t want everything obviously centered (like you don't want the three switches bang in the middle of the case); also, an odd number of items is generally more pleasing to the eye than even numbers, unless you are presenting them in a rectangular or square array, of course.

On the other hand, things also look bad if you just randomly scatter them all over the place. Thus, I mounted the switches with 1/2" clearance from the dark wood at the top and 1/2" clearance from the leather strap on the side. Also, the mid-line of the upper-most light cover is centered on the pivot point of the switches. All in all I think it's looking rather good so far.

Adding the lights

In some ways things used to be a lot simpler when I was young. In the case of the three light sources, I would have simply used little 6-volt filament bulbs, because that was pretty much all that was available at that time. On the good side, these gave a nice, distributed glow; on the downside they could get very warm and the filaments were somewhat fragile.

Now, of course we have LEDs (I don’t even know if you can get the little filament bulbs anymore) which consume very little power and last forever (well, forever as far as this project is concerned). One great things about LEDs is that they are super-responsive and they are totally amenable to being controlled by a microcontroller. Using pulse-width modulation (PWM), it's possible to precisely control the brightness of the LED. And using the microcontroller to control the PWM, it's possible to get all sorts of effects like making the LEDs "breathe" – that is, gradually brighten and dim in a rhythmic way.

As an aside, on the off chance that you are unfamiliar with PWM, let me explain. With an old-fashioned filament bulb, you could control its brightness by varying its voltage supply. If 6 volts made it glow brightly, then 3 volts would make it glow half as brightly. Actually, this wasn't 100% linear, but it will do for what we're talking about here. In the case of LEDs, however, they can pretty much be in only one of two states – on or off. So the trick is to turn them on and off very quickly and control the amount of time they are in one state or the other.

So if an LED is on all of the time, for example, then we will see it as being at full brightness. If it's only on 50% of the time and it's off 50% of the time, we will perceive this as being half as bright. Being on 25% or 75% of the time equates to one quarter or three quarters brightness, respectively, and so on and so forth. (Once again, this isn’t strictly linear for a variety of reasons, including the way our eyes work, but this approximation will serve our purposes here.) The thing is, if we perform this switching on and off of the LED fast enough, then we won’t perceive any flicker, and microcontrollers are so fast that they can do this sort of thing millions of times a second.

Having said all of this, there is a slight problem: When I held my super-bright orange LED behind the amber cover, the light was certainly bright enough, but it appeared as a very sharp "point source." I really want something that looks a little more diffused. One solution might be to use part of an LED flashlight – or "torch" in the UK – with the conical aluminum beam-former thingy. I picked up a cheap LED flashlight on the way into work this morning. I will be performing some experiments when I return home this evening and I shall report further in a future column.

Adding the Electronics

And, of course, as soon as I've tied down the light selection, the next step will be to add the microcontroller-based electronic system to control everything – this will be the topic of my next column. Until then, have a good one!

Clive (Max) Maxfield is founder/consultant at Maxfield High-Tech Consulting. He is the author and co-author of a number of books, including Bebop to the Boolean Boogie (An Unconventional Guide to Electronics) and How Computers Do Math featuring the pedagogical and phantasmagorical virtual DIY Calculator. To contact Max, click here.


Copyright © 2015 I-Connect007. All rights reserved.