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.