Monthly Archives: March 2010

Back to the grind

Welp, I’m back from my vacation. Actually I got back over a week ago, things have just been really busy.

Some cool photos if you are into Mayan ruins or caves (this pic links to the whole gallery):

Anyway, easing my self back into things I finally finished up a long time (non-technical) project:
Paper Craft – Mad Cat (BattleTech)

You can see the full build log here

(I’m a big BattleTech fan, just started reading the Blood of Kerensky series, any BattleTech fans here?)

I also finished up my encryption project, so I will have a postmortem on that soon, as well as progress on my Arduino hardware project. So keep reading! 😀

Arduino Adventures :: Day 7

So on my last post, benryves pointed out that I might be able to use some of the Analog input pins as Digital I/O pins. And as it turns out, he’s right. I could swear I read some where that you couldn’t, but I was wrong.

Well this put my design in a bit of jeopardy, not because it was wrong or wouldn’t work, but just because it might be unnecessary, which would make it kinda silly.

And for a 64 LED circuit, its actually a bit overkill. Because I could hook up four 4×16 demux’s and address them just fine with only 16 pins. But if I wanted anything more than 64, I would be out of luck. Since I have had plans for larger arrays all along, this made me feel a bit better about my design. But to make my self feel even better, I made my self a bunch of graphs on how my design is superior to straight demultiplexing 😛

(Efficiency in terms of LEDs per Input Pins increases as you add more pins)

So, being softly reassured by my graphs, I turned my attention to the build.

I still needed quite a few things to manufacture the circuit board. I needed a way to drill the holes in the board. I needed a way to get the circuit design onto the board precisely, and so on. So I did some research and bought some tools! (Who doesn’t love power tools!!)

I had read that high RPMs (around 30,000) was key to getting clean precise holes on your boards, and the Dremel 4000 has variable RPM control that can go up to 35,000 RPMs, so I should be good 😀

Also, the printable Acid Resist allows me to design my circuit on the computer, and just print it out, and apply it to the board, very precisely, so that’s nice.

For drill bits, all the reading I did mentioned that I would need Solid Carbide Drill bits to really drill precision holes, but they were $5 a bit! So after some quick searching I found a few on E-Bay selling military surplus ones for mmuucchh cheaper:

With all my new tools, I finally got around to designing the actual circuit board. And wow… I under estimated this. It was not trivial. And it’s still not perfect.

First thing is, I have these two 3″x5″ blank PCBs that I want to use as practice before I etch the much larger 9″x12″ blank that I have. So I wanted to design a paired down version of the circuit that would fit on the smaller one. So here it is. This is the actual circuit, but it only has half the outputs that the final one will have (32 instead of 64, there will be two more 4×16 demux’s in the final one). And on this one I have all the LED leads on the edge of the board since this is only for testing purposes:

Well that’s all from me for a bit. On Wednesday I’m heading to Belize for a week! Gonna romp around in the jungle for a few days 😛

Arduino Adventures :: Day 6

I had been thinking about how to achieve individual addressing using demultiplexers even before I gave Charlieplexing a shot. But during my preliminary research the stumbling block was that the largest demux I could find was only a 4 to 16. If I wanted to individually address 64 LEDs I would need four of these, thats 16 I/O pins required to drive them all (I only have 14 on the Arduino).

So that wouldn’t work. I continued to mull about this because there was an itch in the back of my skull telling me it could still work. And then it hit me! As you may or may not know, demultiplexers have a given number of inputs to select which output pin to activate. But they also have an enable pin that can disable the entire demux (so no output pins are active).

My idea was to hook up all of the four demux inputs up in parallel with each other. So pin 1 for each demux would be hooked up in parallel together to one I/O pin on the Arduino, and same for pin 2, 3, and 4. So to drive all four demux’s you only need 4 I/O pins on the Arduino. Now the problem with this of course is that if you select pin 8 for output, then pin 8 on every demux will go active.

My solution is to use a smaller 2 to 4 demux, and hook these outputs up to the enable pins on each 4 to 16 demux. So with only 2 I/O pins on the Arduino I can select which Demux is active, and only that one will have an output pin going active.

When all is said and done, I only need 4 pins to drive the 4×16 inputs, and 2 to drive the 2×4 inputs. Thats 6 I/O pins to individually address 64 LEDs 😀

Now my previous exploration of Charlieplexing was far from a waste of time because it got me thinking about Persistence of Visionas a valid way of presenting a static image. Using this demux method for individual addressing of the LEDs, and Persistence of Vision to present a static image, I have a perfect method for engineering my display! Some bonuses of this method over Charlieplexing are:

  1. The circuit complexity increases linearly as you add more LEDs
  2. LEDs always get the same amount of current
  3. The layout lends itself very well to being in a grid!

So with this rough sketch I set forth! It’s a real shame that “The Shack” (Formerly known as Radio Shack, they re-branded them selves, seriously) doesn’t carry the stuff they used too. They have just a single cabinet of fairly worthless components. It’s a real let down. So finding ICs and other small electronics is a real pain these days. Ordering them from sites is an option, but it took some research to find sites that sell in small quantities. I did find a few good ones finally. Shipping time and cost kinda suck, but what can you do.

The first issue I ran into was that nearly every demux was active LOW. Meaning, all unactive output pins were putting out 5V (HIGH), and when you activated one, it would go to 0V (LOW). Thats fine if you have a logic circuit that is all active LOW. But in my case, that would mean that every LED would always be on, and when I addressed one of them, it would actually turn OFF… Not what I wanted 😛

So the only one I found that was active HIGH had a 4bit transparent latch for the input. Not a big deal, kinda cool actually, but it means I need an extra I/O pin for the latch strobe. That puts me at 5 pins rather then 4 for the 4×16 demux’s (since i will be hooking all the strobes up in parallel as well), which makes it 7 pins total, well within bounds. The inputs were active HIGH as well, but oddly the enable was active LOW. So if I’m pushing 5V (HIGH) into the enable pins, it DISABLES the demux, and if I drop that to 0V (LOW) it ENABLES the demux.

This actually worked to my advantage because every 2×4 demux i could find (whos output would feed into the 4×16 demux’s enable pin) were active LOW logic, so every output pin would propagate HIGH until I activated one, which itself would then go LOW.

2 to 4 Demultiplexer : CD74HC139E

4bit Transparent Latch/4 to 16 Demultiplexer : MC14514BCP

As I was saying, the thing that sucks with Radio Shack and every other small eletronics outfit going the way of the Dinosaurs, is the shipping time. If i got a dead IC, or burned one out my self, I’d have to wait another two weeks for a replacement. So i ordered double of everything I needed. (Each IC was only like $0.75, so not a big deal). And to be extra careful, I’m ordering IC sockets, so I won’t be soldering the ICs directly.

Now I ordered and received the demultiplexers already. And hooked one of the 2x4s up to my Arduino to test it all out. I haven’t worked with ICs let alone demux’s in years, so I wanted to test out my self as well as the hardware, to know for sure they all work:

This is being controlled by my computer via serial input, so i can flip the inputs manually, and see the output state instantly. I plan on modifying the program to run through each state automatically and verify the output for each input state. Sort of unit testing the ICs. Then I will do the same for my 4×16’s.

Still quite a bit to do before I’m ready to begin the build, but it feels good to have a solid design finally.