ArdIAC – Arduino Illustrative Aid to Computation

Way back in high school, I received a copy of the CardIAC computer simulator ( … omputation, there is also a great description with programs and an emulator: from my math teacher. The CardIAC is Bell Lab’s Cardboard Illustrative Aid to Computation, a great introduction to how computers operate on a very low level.  Earlier I had been introduced to the school district’s (School District 214, in North-Western Chicagoland) HP-2000 computer and taken to it like a duck to water. In learning HP’s TSB (Time Share BASIC) I wrote my first emulator, a CardIAC emulator. Unfortunately, I have no memory of the user interface, only the background. Over the past several years, I have wanted to recreate my emulator, but in hardware.

A while back, I ran across the Kim-Uno (a 6502-based KIM computer simulator: http://obsolescenceguaranteed.blogspot. … o-uno.html) which stirred my creativity. I recently ordered an Arduino Nano ( … 59231.html) and several Nokia 5110 LCD modules ( … 45893.html.) Time to play.

Here is my prototype as of this point (note that I have not done the initial wiring yet.)

I prefer to do my prototyping off of a CAD drawing, and then when everything works, it already matches up and so I can just have some boards manufactured.  So, this is what the ArdIAC drawing looks like to this point.

The ArdIAC, so far. The bottom portion is an existing hex keypad, that I designed for my store.

The next step is to get the prototype LCD wired up, and then load some testing code to display something on the LCD.

Since the CardIAC only has 100 words of memory, and the Arduino’s Mega328 has 2K bytes of RAM, this will be enough to simulate the CardIAC.  However, I am thinking of adding an external serial RAM, so that this thing can simulate/emulate more complex systems.

Ideas? Question? Suggestions?

Expanding Your 2313 Experimenter System

In the book Introduction to Microcontrollers, I alluded to the ability to expand your 2313 Experimenter System (2313ES.)  On page 70, I showed a drawing of a breadboard attached to a 2313ES.  This week, we will go ahead and expand our 2313ES with a medium-sized breadboard – this will provide pretty decent expansion capability, but will allow the 2313ES to keep it’s portability.

To start off, you will want to pick a piece of plastic, or something, to use as a base.  In this example, we use a plastic base plate

from Tamiya ( – Eddy was thinking about offering the base plates separately, write to him and ask him about this,) but you could use just about any flat-surfaced item.  Consider a small piece of thin plywood, a small piece of metal, or plastic, cut from the side of something from the trash, a small clipboard without the metal clip, or maybe even the inside of the lid of a plastic pencil case (back-to-school specials abound right now.) The important thing here, is to just make sure that your kit and breadboard (and battery box, if you want it,) will fit.

This 2313 Experimenter System expanded system.

This 2313 Experimenter System board is mounted to a Universal Plate kit from Tamiya to make our expanded system.

Once you find your base, peel the backing off of the sticky foam tape on the bottom of your breadboard, and stick the breadboard into place on your base.   Next you can solder two small pieces of jumper wire to the two power rail holes on your 2313ES printed circuit board (PCB.) Now, peel the backing off of the 2″X2″ foam tape that was included in your kit, and use it to mount your 2313ES near your breadboard.  Then plug the the power wires into the power rails of your breadboard (you could also use the left-most holes in the power rail female headers, of your 2313ES, for a less permanent solution.) Finally, mount your battery box (if you want it) to your base; make sure that you leave access to both the sliding door and the power switch, as they are on opposite sides of the battery box.  Also, if your breadboard has dual power rails on the top and bottom, you will need to connect the two +V, and the two Ground, rails, as we have on the right side of the photos.

Once you get your 2313ES and breadboard mounted, you will want to test the connections to make sure that everything is wired up properly. You can use a simple “blinkenlight” ( – this is the same as the small test device that you built while testing your 2313ES,) to test power; place the negative lead (the one with the resistor) into the ground power rail, and the positive lead into the +V power rail.  Place the power selection jumper over the Pgmr jumpers and connect the programmer and the LED should light up.  You can also simulate the blinkenlight by just plugging an LED and resistor in to the breadboard.

If the LED does not light up, there is a bad connection between the 2313ES and your breadboard.  Remember to disconnect power before changing any of  the wiring, here. Recheck the wires connecting the two pieces.  If you soldered the wires to the holes in the 2313ES, then disconnect one from the breadboard and temporarily replace it with a jumper plugged into the 2313ES’ female header for the power rail.  Connect power again and check that the LED lights up.  If it does, then the wire that you replaced is bad; recheck the soldering and maybe replace the wire.  If the LED still does not work, then remove power, temporarily replace the other wire and check again.  Again, do not forget to jumper the top and bottom V+ and Ground rails together.  LESSON LEARNED – When I first connected this breadboard, I accidentally connect both V+ and Ground to the same rails – not good!  Fortunately, this system is pretty durable.  The USBASP (or the USB port on the computer) detected the short, and just shut down the power to prevent damage.  As soon as I corrected that goof, everything worked again.

Once you get the LED to light, you may want to permanently mount the LED and resistor.  Take a look at the photo for how you may want to do this.  Once you get the parts placed and working, you will want to cut the leads short (make sure that you remember which LED lead is for the cathode (negative.)  This will keep the LED and resistor neat and out of the way – in fact, you may want to use a tiny bit of glue, or epoxy (or hot glue) to keep them in place, it will be more durable that way.

This will provide a quick, and easy, pilot light, to let you know when your 2313ES has power applied.  Just remember that the LED does draw power, even if you are not running any useful program on your Tiny2313 chip.  This is not a lot of current, about 20mA, but it will help to drain your battery, if you are using the battery pack.  Just make sure that you turn off the power switch on your battery box when you are not using the experimenter kit.

Next week, we will start adding stuff to the breadboard expansion.  Stay tuned.

Developing New Products

Today, we are going to start looking at developing new products.  We will begin with getting to know our development kit (starting off with the 2313 Experimenter System.)  This new product was developed, specifically to allow engineering students to learn about microcontrollers, and how to use them.  As an advanced part of learning how to use microcontrollers, you can use the 2313 Experimenter System to develop new products.

The 2313 Experimenter System (from now on, let’s call it the 2313ES for simplicity) provides you with an AVR ATtiny2313A microcontroller, from Atmel, a programming port, three LED lights, two push-button switches, a speaker, and two servo-motor/sensor I/O ports.  In addition, the 2313ES provides the ability to draw it’s power either from the programming port, or a battery – complete with protection from reversed polarity.  There are also two power strips available, to easily provide ground and +V connections for your circuits.  Right next to these power rails, there are additional drill holes to allow you to easily extend power to an optional breadboard.  Our first “product” will not be using the breadboard (don’t worry, we will expand the 2313ES later on.)

The Product
A couple of my kids have had to have braces.  Every kid who has had braces, has heard the admonition from the doctor to “make sure that you brush for three full minutes.”  Of course, when you are doing something that you don’t enjoy, time seems to crawl.  It is very difficult for a kid (of any age) to brush for a full three minutes – it seems to take forever.  So, our first product will be a simple tooth-brushing timer.  The requirements for this product will be pretty simple: start timing and let the user know when the three minutes have passed (by the way, you could also use this for a “time out” timer for young children for when they misbehave.)

The doctor’s office gave both of my kids a simple “hour glass”-style sand timer for them to use, and it does the job; however, I think that it can be improved.  That is what we will work for in this development project.

Developing The Timer
Let’s start off with the hardware side of the timer. Take your 2313ES and make sure that the programming cable is not attached and that the battery box is not turned on.  Now, run a short jumper wire from the the second from the right-most hole (or pin) on the Tiny2313 socket, labeled PB0, to the right-most LED (like the blue wire in the drawing to the right.)  Take a second wire and connect PB1 to the speaker terminal (as shown in yellow.)  This will give us all that we need to start developing the program (the firmware) for our new tooth-brushing timer.  That is one of the beautiful things about development kits (or dev kits;) it is really simple to set up your system for developing new products.  In fact, that is where the dev kit gets it;s name.

The Program
The program that will run our timer, is called the firmware – this is software that is always there, and cannot be easily changed (like you would change from a word processor to an internet browser on your desktop, or laptop, computer.) Normally, you would not want to change the program on your program on a control system.

We will develop our firmware in MCS Electronic’s BASCOM-AVR, as we used in the book, Introduction to Microcontrollers.  Launch your BASCOM program and enter the following:

‘ Title: Tooth-brushing Timer
‘ Author: Art Granzeier, Granzeier Consulting  – Use your name here.
‘ Date: 13 Oct 13  – Use today’s date here.
‘ Description: Delay for 3 minutes and then alert the user.

‘ Configuration Section
$regfile = “ATtiny2313a.dat”     ‘ Specify the micro
$crystal = 1000000                    ‘ Frequency for internal RC clock
$hwstack = 32                             ‘ Default – Use 32 for the HW stack
$swstack = 10                              ‘ Default – Use 10 for the SW stack
$framesize = 40                          ‘ Default – Use 40 for the frame space

Config PortB = Output

‘ Main Program
‘ Pause for 3 minutes

‘ Alert the user
‘ LED on

‘ Tone from speaker


(Note: don’t try to copy and paste from this page – the HTML code will make BASCOM cry.  Instead, use the .BAS file that I have posted here:  Read through the rest of this post first, because this .BAS file contains all of the additional statements as described below.)

This will provide the frame, or skeleton, for our new program.

Now, we need to start the program by counting up for three minutes, when the timer is turned on.  As we covered in the book, you could use the waitms command to wait for a specified number of milliseconds (thousandths of a second.)  Looking through the BASCOM manual (you did download that when you installed BASCOM, right?) we find that there is another command, related to the waitms – the wait.  Looking at this command, we see that this will wait for a specified number of whole seconds.  For longer delays, this is what we need.  Under the comment about pausing for three seconds, type the line:

Wait 180

This will cause the program to pause for 180 seconds, or three minutes.

Next, we need to notify the user that they have been brushing long enough. Under the LED on comment, under Alert the user, type this line:

Set PortB.0

This will cause the LED to turn on, just like the first experiment in the Intro book.  And, now, since we want the user to be notified, even if the kid is not watching the timer, we would add the following line under the tone comment:

Play PortB.1, 500, 125

That is all that we need to meet the initial product requirements for our new timer.  Make sure that the power selection jumper is set to power your 2313ES from the programmer.  Next, take your programmer and connect it up to your 2313ES and plug it into your computer.  Compile the timer program and download it into your ATtiny2313.  Now, unplug the programming cable from the 2313ES, and (with the battery box turned off) switch the power selection jumper back to the battery position.

Now, turn your battery box switch on, and wait.  Remember, that three minutes is a long time, when you are just watching and waiting (remember, “a watched pot never boils.”)  About three minutes after you turn the timer (err, your 2313 Experimenter System) on, the LED will light, and a short tone will come from the speaker.

Well, congratulations on developing your first product!  Of course, this is really the very beginning of your development process.  What you have here is more like your first, rough draft of a term paper; it will still need some clean-up work.  We will cover that in our next blog post.  Until then, play with the program and see what happens when you change things in the program.  Note that the sound statement has three parameters: the first is the pin on which you want the sound pulses to appear; the second is the duration (actually, it is the number of pulses — it will change depending on the tone;) the third parameter is the tone (again, it is not really the tone, but rather the delay between the pin going high and low.)  Take the numbers that I have presented and play with them to get a sound that you like.  Also, since three minutes is a pretty long time when you are experimenting, you will want to change the delay time in the wait statement.  I used five seconds, so that it still seems to be a timer, but it is not a painful wait. Just make sure to put it back to three minutes before we continue next time.

Until, next time – keep on learning.

Another Tutorial – LED Matrix Display

Once again, I put finger to keyboard to post another entry in this blog.  I have really got to do this on a more regular basis – and this is another attempt to get that going.

This post is pretty small, because I have written another tutorial and that is where most of this blog’s efforts went.

A friend of mine is working on a system that has a display board – this used 100 discrete LEDs arranged in a 10X10 matrix.  This got me thinking about how you could build one of these in a rather simple circuit.  Take a look at my new tutorial, at:

Stay tuned for more, coming in the near future.

Introduction to Microcontrollers

I want to introduce you to our newest product: the Introduction to Microcontrollers book and kit.  This set was designed in answer to the question, “how do I get started in microcontrollers?”  This question comes up pretty often in electronics, computer, microcontroller and robotics forums (and off-line, any time that the subjects come up.)  The best way to learn something is to dive right in, and get started; but you will have lots of false starts if you don’t have a guide for the exploration.

You will get a text book, written with total beginners in mind.  The nearly 100 pages include text, sample programs, quizzes and their answers.  You also get a small, simple development system.  This is a 2″ x 2″ Printed Circuit Board (PCB) with an Atmel ATtiny2313 microcontroller, a programming interface, a power connection (able to power the board from the programming interface or a battery, which is included,) and several Input/Output (I/O) devices.  Each I/O pin on the microcontroller, and each I/O device, has a female connector so that you can plug short jumper wires between them.  This allows you to easily connect the I/O devices directly to the microcontroller.

This book starts off by giving a good working description of a microcontroller, and introduces you to the actual controller that you will use for the course.  The second chapter describes programming, and walks you through installing a very powerful programming language for the microcontroller.  In the third chapter, you will actually build the simple development system of your own (all of the parts, including the printed circuit board [PCB] are included in the kit,) as I described above.

The rest of the book (an additional four chapters) are dedicated to getting you started in connecting devices like LED lights and pushbutton switches and programming your microcontroller to do what you want.  I made sure to go over each and every single line in the sample programs, so that you understand what (and how) everything works.  There are many samples included, with directions on how to modify each one to do what you want.

Coming up, we will be presenting a  series of short projects that will expand your knowledge with the Tiny2313 Experimenter System.

We are currently having an introduction sale on this set, for the rest of this month, we are offering the book and kit for only $19.99, that is 33% off the regular price.

Jedi Force Trainer Teardown

Meet the Jedi Knight’s Force Trainer, from Uncle Milton:
I have been working with a friend of mine on trying to find a way for his wife, who has ALS and is paralyzed, to communicate better. He has one of the Force Trainer toys, and his wife has had some success in using this. My friend sent me one of the devices, and I decided to document my work on interfacing this to a computer or a microcontroller.  He found a site where a guy named Zibri gave a lot of info about interfacing the Force Trainer ((  This has been a huge help in converting this “toy” into a useful “handicapped communication tool.”

Step I – First, I took the bottom off. There are four tiny screws (no. 1, Philips head) holding the bottom to the case. After taking this off, the two sides of the plastic body needed to be pried apart. The two arms of the body did not come apart without breaking the plastic inside. Once apart, the device looked like this:

Step II – Next, I completed removing the plastic body of the base unit.

Step III – This is a shot of the 2×6 male header, where we will tap into the serial data stream ( I will probably be sending this to a microcontroller (most likely a Propeller, since Jason – my friend – already has some of these,) and then on to a PC for experimenting.

Step IV – Here I show how the device still works, after being disassembled:

Step V – Below, you can see the LEDs much better – although the rest of the picture is pretty bad, sorry.

Step VI – Here, I have disconnected the LED panel – still working properly (in other words, Yoda still gives his speil when I power the unit up):

Step VII – Next, I removed the power button PCB, here you can see that PCB.  The instructions indicate that the potentiometer is used to calibrate the air flow; since we will not be using the fan, we should be able to do without the pot.

Step VIII – Even with the other components disconnected, I was able to power the system up.  By following the traces on the PCB, I was able to determine that the pushbutton switch was connected to the (on my system, be careful about those) blue and yellow wires. By using a shorting plug to connect the blue and yellow wires on the connector, the system powered up and I heard Yoda’s introduction through the speaker.

Step IX – Next, I unplugged the fan assembly and then, again, powered up the system to make sure that it does not depend on the other circuits.  Yep, it still works, without them.

Step X – Since this may be incorporated into another product, I wanted to check the power requirements.  As you can see, my voltmeter is showing 8.28VDC – no troubles there.  Plus, as a bonus, with the fan removed, the battery (6 AA cells) will last much longer than the original system.Step XI – Next, just to make the thing a bit more portable, I removed the speaker from the bottom of the base station.  Then I was able to place the main PCB onto the speaker mount on the base, and tighten it down with the two brackets which were used to hold the speaker in place.

Step XII – Here is a close-up of the main PCB mounted into the speaker mount.  You can see the curved bracket holding the PCB in place.  The other bracket had to be broken a bit to fit onto the board, but this jury-rigging does hold the PCB nice and tight.

Step XIII – Here is another picture which shows the one bracket a little more clearly.

Well, this is the tear down.  Next, we will build the connector for the serial port, and plug it into the microcontroller.  A simple repeater program on the microcontroller will send the data, from the Force Trainer PCB, on to a PC for initial analysis.


You know how things seem to make more sense as you talk them out?  That is why councilors are trained to have their patients “talk things out”, and why job seekers are told to find some one and “talk it out” after an interview.  Your thoughts and ideas are planted more firmly and you gain better understanding of what you are thinking by talking things out.

Well, that is exactly what happened (quite by accident, I must admit.)  I was discussing my business with [Old Bit Collector] ([OBC]) over on his forum at and found that one of my posts ( expressed some of my thoughts very well.  I would like to copy the main ideas from that post here for your edification (and maybe entertainment, too.)

[OBC] had mentioned that he was starting up a Hackerspace type organization in his local area (about 2 hours west of Pittsburgh) and asked for help from any of his readers in the area (PLUG – if you live in, or near, East/Central Ohio, check it out; it will be pretty cool, working with this.)  I mentioned that I am willing to offer assistance (check out my tag line at the top-right of this page.)  And, [OBC]’s response was:

“You are welcome to participate as much or as little as it suits you.   I know you are working toward some similar goals in your neck of the woods.   Anything I can do to help, don’t hesitate to ask.”  A true gentleman, and smart businessman.

My response to his acceptance and counter-offer was:

“Thanks for the offer – I believe that coopetition, rather than competition, is good for business growth.  That is the idea of coopetitors continually working to provide the best product to their customers, thus raising the level of both sets of products, as well as the customer’s satisfaction.  (Yeah, yeah, I know, I live in a dream world.)

I think that this may have come from my time in the military: Jeff, you are the squadron Commanding Officer (CO) for the Propeller Powered Sqdn, Chris is the CO of the Savage///Circuits Sqdn and I am the CO of Granzeier Consulting Sqdn.  We each provide our own way of supporting the mission (providing the best products that our customers can get.)  Even though we each run our own squadron in our own way, the mission is best served when we provide support for each other’s squadrons.  (Does that make any sense, or are y’all just nodding at what you think are appropriate times? :P)

Anyway, that is why I like to put effort into my colleague’s sites.  I believe that working together, we can both build our income (like I said, sort of like different squadrons of the same Air Force.)  However, I do want to keep in mind that PP is your squadron, and not interfere with your command. That is why I try to check with you on so much (although, as I get to know you better, I can make better judgements about your likes – don’t hesitate to stop me if I over-reach, though.)

“Staff Sergeant Granzeier Looks at Business Through the Eyes of a Vet” – my next book??? ;D

Anyway, what do you think about coopetition, rather than competition?  Let me know in the comments section below.

SAR-Bot Exercise/Contest at Propeller Powered Expo ’14 (deja vue!)

Once again, I have been asked to run another robot contest for OPPE ’14 (guess I must have done something that people liked.)  At the end of the ’13 expo, I briefly talked with Jeff (the proprietor of Propeller Powered and founder of the Propeller Expos) about ideas for next year.  Well, it looks like we will be running a Search-and-Rescue Robot (SAR-Bot) contest.  Only, this time, to interest others, such as the Emergency Responders and medics in our area, we will be running the contest as an Emergency Preparedness Exercise. (I have always been interested in Emergency Response – even earned my Pennsylvania certification as an EMT.)

Also, in order to help build interest, we will be sending a press release to local press, schools and emergency preparedness organizations, inviting them to come see the future of Rescue Technology.

Well, with this upcoming Expo hosting the SARbot ’14 Exercise, I wanted to get an early head start.

Come on down to the contest site at and see what’s going on.  The discussion thread for this coming exercise/contest can be found at:  We would like a lot of feed back, including any ideas, that you may have, for making this a great exercise.

Edited on 16 Oct 2013: We used to have a picture of one of the houses used by Trinity College’s contest, however we received the following demand to remove the picture:

Dear Mr. Granzeier III:

Jessica Jones forwarded your note to me regarding your “borrowing” a copyrighted photo from our website,  Since you did not receive permission in advance to use this photo, it is necessary to remove it from your website immediately.  As an institution, Trinity College is adamant about protecting its copyrighted materials.

In the future, please be sure to ask before using copyrighted material.

David Ahlgren
Contest Director

Therefore, the picture has been removed.  I will post another picture of my own later.

I am envisioning a small “house” made out of plywood with some rooms and maybe a hallway, or two.  However, this house will have a door (doorway?) so that the robot can get in.  In front of the door will (may?) be some bricks and/or other debris.  The robot will need to get around/past/over/through the debris and into the house.  Inside the house, somewhere, will be a baby as the victim.  The baby will have the general shape and size of a human baby for visually-oriented SARbots.  In addition, I am looking into a heating element to keep the baby’s temperature at about human-normal, for thermal-oriented SARbots.  If things work as planned, the baby will also cry for audio-oriented SARbots (my new grand-baby should be born next January; lots of opportunity to get MP3s of a real baby crying to play for the exercise/contest. :P)

In addition, for the visitors who are more emergency/medically oriented than electronics: we will want some medical-/emergency-oriented devices, (since this is for the Propeller Powered Expo) based on the Parallax Propeller (, of course. The Prop can certainly handle that kind of stuff.

Let’s fire up the old irons, and dev kits, and put together some prototypes (and even some finished products to show – and sell. ;D)

Re: Robot Contest(s) at PropellerPowered Expo ’13

Well, it was a long weekend; but it was great.

Here are the results of the two robot contests:

Line Follower –
– In first place, with a best time of 9.7 seconds, was Toadblue, owned by Roger Goff
– In second place, with a best time of 18.2 seconds, was Thing1, owned by Chris and Abby Wardell
– In third place, with a best time of 46.4 seconds, was S2, also owned by Roger Goff

Sumo –
– In first place, with 2 wins and 1 loss, was Thing1, owned by Chris and Abby Wardell
– In second place, with 1 win and 2 losses, was Thing2, owned by Chris and Abby Wardell

Congrats to all of our entrants, and thank you for a most entertaining contest.

For the trivia collector: Chris and Abby’s robots were named after Thing1 and Thing2 from the Cat in the Hat (  Thank you Abby for those imaginative names.

There are several photos (and a video of the Sumo contests) posted in the Official thread (  I have also posted the results of each contest in it’s respective page.
We are already working on the OPPE’14 Robotics Contest(s) – Note: we have been having extreme weather all of this past summer, of 2014.  Eastern Ohio has experienced record amounts of heavy rainfall, and flooding, since early spring ’14, and there have been numerous thunderstorms, microbursts and even several tornadoes sighted in the Orrville area.  I have heard rumors that the Mayor of Orrville is worried that buildings may collapse from the ground being weakened due to being saturated from all the rain.  Jeff, from PropellerPowered has been asked to prepare a team of SAR-Bots (Search-And-Rescue Robots) in case of any major damage.  Stay tuned to OPPE News for further details as they develop.

Updating The Granzeier Consulting Site

In order to be the best engineer that you can be, you need to be the best person that you can be.  Along those lines, I have created a new site:  There will be articles and other things to help you to build your faith there.  In fact, there are already a couple of articles posted there.  Take a look there (just click on the link on the right side of this page,) but, as Bill Cosby used to say: “be careful, or you just might learn something.” 😉

Also, Granzeier Consulting is about trying to help engineering students learn about computers and control systems; our tagline reads: Helping to Build a Better Engineer.  In light of this, I have started updating our store and adding some tutorial pages to this Projects site.

My first update was to the LED Pack product page:  The old description was just the first paragraph.  I have added an entire tutorial on LEDs for beginners.  Soon, I will be adding some specific examples so that you can see exactly how to use an LED in your own circuit.

There is also an entire tutorial page, showing how to set up and use a solderless breadboard.  You can find it here:  You can learn about the history and how the things work there.  I even show you how to put a power indicator on your breadboard, so that you can, easily, tell when power is turned on.