
2009-10-11
2009-09-26
Site Updates
I did some cleaning up on jonikahara.com and removed useless stuff. Now there's only the blog page and the contact info page. The blog part shows the latest post in full. A list of earlier posts can be revealed by pressing the "Archive" button below that. In the archive listing, a given post can be revealed by clicking its title; post content will be loaded inline with a little help from jQuery $.ajax(). Check out the script if you're into that kind of stuff. (Note: there was a bug in jQuery 1.3.2 that made IE fail when using the :contains() selector – a patch was necessary.)
I also changed my DOCTYPE to HTML5.
And because I got a Typekit invitation (page me if you want one) and as their introductory price of $24.99 per year for personal use seemed quite reasonable I decided to check it out. The thing worked like a charm, at least after I had sorted out some funky bits in my CSS. I'm using Coolvetica (Larabie) in the "JONIKAHARA.COM" part at the top, DDT (Typodermic) in post titles and Legendum (Rogier van Dalen) for the rest. Typekit requires @font-face to work, so you won't be seeing these fancy fonts if your browser does not support it.
2009-09-22
LED Display Hacking (Part 3)
First, here's a more readable view of one seventh of the circuit between the demultiplexer and the LED array, this time with an additional current-limiting resistor between the transistors:

Speaking of current, the whole circuit draws quite a bit of it, and it may be too much for a single 7805 to handle. Proper heat sink attached to the regulator is at least required, or a different power supply arrangement if that fails to provide enough cooling.
I got some of the LEDs to actually light up, but the addressing appears not to be as straightforward as I had naïvely assumed. More tinkering needed.
2009-09-06
LED Display Hacking (Part 2)
Did some "reverse engineering" on the driver part of the device introduced in a recent post and "designed" (ahem…) a new driver circuit based on my findings. See some amazingly craptastic ASCII art below.
Q1..Q7 BC327 Q8..Q14 TIP32C IC1 74LS138 R1..R7 220 OHMS IC1 ·-------· ·---------· ! ! ! ! ! Q8 ! Q1 ! ! b e ! ! ARRAY 0 --c e-· b-----|R1|------ O0 Vcc ----- +5V ! c !(15) (16)! ! ! ! ! +5V GND ! ! ! ! ·-------· ! ! ! ! ! ! ! Q9 ! Q2 ! ! b e ! ! ARRAY 1 --c e-· b-----|R2|------ O1 GND ----- GND ! c !(14) (8) ! ! ! ! ! +5V GND ! ! ! ! ·-------· ! ! ! ! ! ! ! Q10 ! Q3 ! ! b e ! ! ARRAY 2 --c e-· b-----|R3|------ O2 E1 ----- GND ! c !(13) (4) ! ! ! ! ! +5V GND ! ! ! ! ·-------· ! ! ! ! ! ! ! Q11 ! Q4 ! ! b e ! ! ARRAY 3 --c e-· b-----|R4|------ O3 E2 ----- GND ! c !(12) (5) ! ! ! ! ! +5V GND ! ! ! ! ·-------· ! ! ! ! ! ! ! Q12 ! Q5 ! ! b e ! ! ARRAY 4 --c e-· b-----|R5|------ O4 E3 ----- ARDUINO PIN 2 ! c !(11) (6) ! ! ! ! ! +5V GND ! ! ! ! ·-------· ! ! ! ! ! ! ! Q13 ! Q6 ! ! b e ! ! ARRAY 5 --c e-· b-----|R6|------ O5 A0 ----- ARDUINO PIN 5 ! c !(10) (1) ! ! ! ! ! +5V GND ! ! ! ! ·-------· ! ! ! ! ! ! ! Q14 ! Q7 ! ! b e ! ! ARRAY 6 --c e-· b-----|R7|------ O6 A1 ----- ARDUINO PIN 6 ! c !(9) (2) ! ! ! ! ! +5V GND ! ! ! ! ! ! ! ! ! ! ! A2 ----- ARDUINO PIN 7 ! (3) ! ! ! ! ! ! ! ··--------· DATA ------------------------------------------ ARDUINO PIN 4 CLOCK ------------------------------------------ ARDUINO PIN 3
On the right side is the part that connects to Arduino: pins 5…7 select which one of the LED arrays will be lit and pin 2 enables the 74138 output. Arduino pin 4 feeds data to shift registers in the display part; pin 3 clocks them. (Note to self: check that clock part; how much current will 74164's draw?)
Note to self: add resistors between BC327 emitter and TIP32C base.
74138 truth table is as follows:
I N P U T S O U T P U T S ------+-------+---------------- E E E ! A A A ! O O O O O O O O 1 2 3 ! 0 1 2 ! 0 1 2 3 4 5 6 7 - - - + - - - + - - - - - - - - H X X ! X X X ! H H H H H H H H X H X ! X X X ! H H H H H H H H X X L ! X X X ! H H H H H H H H L L H ! L L L ! L H H H H H H H L L H ! H L L ! H L H H H H H H L L H ! L H L ! H H L H H H H H L L H ! H H L ! H H H L H H H H L L H ! L L H ! H H H H L H H H L L H ! H L H ! H H H H H L H H L L H ! L H H ! H H H H H H L H L L H ! H H H ! H H H H H H H L
As can be seen the 74138 outputs (pins 9…15) are active-low. The outputs drive BC327 (PNP) transistors, which then drive TIP32C (PNP) transistors. TIP32C's drive the display modules.
2009-07-23
Shadowbox.js (It Works)
At last, a Lightbox script that actually seems to work mostly as advertised. The author requires commercial customers to pay for the script, but the fee is more than reasonable. It works with many Javascript libraries (jQuery, MooTools, Prototype, …).
You can use the usual attributes to group images together (rel
), give images a caption (title
) et cetera.
The only thing I had to figure out to make the script work was that it uses document.write()
to load its' dependencies, so you can't initialize Shadowbox in jQuery's $(document).ready()
(at least not easily). The initialization script must be put in HTML document body, as in:
<script type="text/javascript"> Shadowbox.init(); </script>
See my simple test of Shadowbox.
2009-05-26
Note to Self (Streamer/FFmpeg time lapse movie creation)
Grab nine hundred frames, one frame per second:
streamer -t 900 -i composite1 -s 640x480 -r 1 -o frame-00000.jpeg
Encode a time lapse movie from those frames:
ffmpeg -r 25 -i aa/frame-%05d.jpeg -vcodec mjpeg -sameq aa.avi
2009-02-25
LED Display Hacking
Update: Hmm… just had a bit of a revelation. It all seems obvious now: the display isn't driven one column at a time as I assumed (you may have heard that old saying about assuming); instead it's driven one row at a time, that is, the whole row is fed in to the register after which it is lit through one of the TIP32C's. I updated the text below accordingly. Note: the LED modules are marked "MM-300HD 3 Z 6".
Some years ago I got a somewhat old scrolling LED display as a gift from a friend. It's got 15 19 5x7 LED modules (95x7=665 pixels) and an integrated keyboard with which it can be programmed. Because it has no serial link or anything, I took it apart in order to figure out how it works (sorry about that, K). As expected, the device isn't too complicated. There are two PCB's: one that has a microprocessor (or ASIC, not sure), keyboard and display driver circuitry; the other has the actual display modules and a bunch of 7400-series IC's. Connecting the two boards is an 11-way ribbon cable. A bit of reverse engineering revealed the wires' functions:
- Clock
- Data
- Supply voltage
- Ground
- Display data
- Display data
- Display data
- Display data
- Display data
- Display data
- Display data

The driver part on the first board has seven BC308B's switching seven TIP32C's each driving one row of LED's. As you may know, in order to keep the circuit simple (and to conserve energy, I suppose), not all the LED's are lit at the same time. Instead they're lit one row at a time, in rapid succession. This has to happen fast enough to beat persistence of vision or we'll observe flickering.

The display part consists of the already mentioned 5x7 LED modules, 75492 hex inverters (16 total), 74164 serial in/parallel out shift registers (12 total) and a number of resistor (mostly pull-up, I suppose).
At least, that's the theory. I have not actually tested any of this.
TBC
2009-01-27
Embedding Google Maps in Web Pages Served as application/xhtml+xml
I ran into trouble while trying to embed a Google Map into a page with Content-Type
of application/xhtml+xml
. I tried a few different ways of loading the script and initializing the GMap2
object, but they all ended up with Mozilla giving a somewhat cryptic error message (quotemarks exactly as below):
Object cannot be created in this context" code: "9
Turns out that Google's code uses the document.write()
method and that that does not work with documents served as application/xhtml+xml
. Which means that the pages must be served as text/html
. I hope I could find a better solution but for now, that'll have to do.