Transistors that don't transist
Dammit.
Transistors are apparently like soldering irons. I saw a saying that "if your soldering iron cost $10, then you paid too much". If your transistors were thirty-five cents apiece and the others were $1.08, then $3.50 was too much for ten.
After much pain, I have figured out the reason half my test circuit didn't work was that the transistor was fucking conducting all the time, whether the base was grounded or not. Out of ten, only one behaves the way it's supposed to.
So obviously I'm buying more parts. I think probably from a place online this time, get some in chips, easier to deal with.
The thing I am building now is going to hook to a microcontroller, and be an 8x8 LED display. I bought an Arduino microcontroller from Sparkfun, along with some other cool-looking junk. This looks like a nice way to learn how to build computers. It's USB-programmable, will run easily from a battery pack, and costs $35 (the others were like $150). Also, Make Magazine seems to adore it.
The thing is, it has 14 pins for talking to the world. So to control 64 LEDs with it takes some clever. Here's how I plan to do it:
I can't control them all at once, but I can control one column at a time, and refresh the thing fast enough that it looks like I'm controlling them all at once. I use one pin per row, and one pin per column. The + pins for each LED are wired to the ones in the same row, and the - pins are wired to the ones in the same column. So, to turn on a light, I turn on the pin for its row and ground the pin for its column.
To make sure that the column pins are only grounded when I want them to be, I have one transistor per column. In order to ground that column, I turn on the base for the transistor, and that completes the circuit for that lamp: row pin to lamp to column transistor. The other lamps in the row can't get through their transistors, and the other ones in the column are getting nothing from their row pins. Even though each lamp is wired to all the others, I can still change them independently.
Tiny problem left. For anyone counting, I need sixteen pins (one per column, one per row), and the Arduino has fourteen. However, since no two column pins are ever lit at the same time, I can just send three pins to a demultiplexer and turn them into eight. Eight row pins plus three column pins leaves three left over for input. Luxury.
Edit: also, by wiring it up weirdly (just change which demultiplexer pins go to which column) I can make the thing that scans columns scan them in gray code, so I only have to change one pin each cycle as I refresh the "screen" (other that the row pins, of course).
Transistors are apparently like soldering irons. I saw a saying that "if your soldering iron cost $10, then you paid too much". If your transistors were thirty-five cents apiece and the others were $1.08, then $3.50 was too much for ten.
After much pain, I have figured out the reason half my test circuit didn't work was that the transistor was fucking conducting all the time, whether the base was grounded or not. Out of ten, only one behaves the way it's supposed to.
So obviously I'm buying more parts. I think probably from a place online this time, get some in chips, easier to deal with.
The thing I am building now is going to hook to a microcontroller, and be an 8x8 LED display. I bought an Arduino microcontroller from Sparkfun, along with some other cool-looking junk. This looks like a nice way to learn how to build computers. It's USB-programmable, will run easily from a battery pack, and costs $35 (the others were like $150). Also, Make Magazine seems to adore it.
The thing is, it has 14 pins for talking to the world. So to control 64 LEDs with it takes some clever. Here's how I plan to do it:
I can't control them all at once, but I can control one column at a time, and refresh the thing fast enough that it looks like I'm controlling them all at once. I use one pin per row, and one pin per column. The + pins for each LED are wired to the ones in the same row, and the - pins are wired to the ones in the same column. So, to turn on a light, I turn on the pin for its row and ground the pin for its column.
To make sure that the column pins are only grounded when I want them to be, I have one transistor per column. In order to ground that column, I turn on the base for the transistor, and that completes the circuit for that lamp: row pin to lamp to column transistor. The other lamps in the row can't get through their transistors, and the other ones in the column are getting nothing from their row pins. Even though each lamp is wired to all the others, I can still change them independently.
Tiny problem left. For anyone counting, I need sixteen pins (one per column, one per row), and the Arduino has fourteen. However, since no two column pins are ever lit at the same time, I can just send three pins to a demultiplexer and turn them into eight. Eight row pins plus three column pins leaves three left over for input. Luxury.
Edit: also, by wiring it up weirdly (just change which demultiplexer pins go to which column) I can make the thing that scans columns scan them in gray code, so I only have to change one pin each cycle as I refresh the "screen" (other that the row pins, of course).
no subject
no subject
no subject
no subject
Thank you! Now that I'm playing with it, I also realized that I can probably use pulse width modulation to do the column pins automatically as well.