Introduction: 2 Digit 7 Segment Display With 8 Pins
I got a 2 digit 7 segment display from a washing machine that shot craps. Of course I took it apart and saved all electronics and wiring :). The display only had 8 pins to control all the segments. After some experimenting I finally got it to work. 3 of the pins were cathode and 5 pins were anode. I had made an 8x10 led matrix that was on Instructables. I started using that code to help me with the code for this instructable.
Step 1: Parts Needed:
1 - 2 digit 7 segment display with 8 pins
1 - Arduino board
1- 74HC595 shift register
1 - CD4017BE decade counter
3 - 2N3904 transistors
Step 2: The Layout
I am not an expert with Fritzing but attached is the layout. At the top right of the diagram are the 8 wires that are connected to the display. I could not find a Fritz symbol for the display I have so use your imagination.
I took out all resisters. The numbers were not as bright with resisters in the layout. I also do not have any capacitors. I am not sure where these should go but I am open to suggestions.
Step 3: Step 2 - Understanding the Layout and How to Set Up the Arrays
It is a little hard to explain how I set up the arrays but if you look at the attached hopefully you can understand what I did. The program scans 3 rows at a time.
1st scan will scan the 3 rows and the first column
2nd scan will scan the 3 rows and the 2nd column
5th scan will scan the 3 rows and the 5th column
All together the program will scan 15 values. These values will determine which number gets lit up.
If I don't want that segment to light up I put a zero in the array. If I want a segment to light up then I have to put in the correct value.
To light up any segment in the 1st column I would enter a 1 in the array in the appropriate row.
To light up any segment in the 2nd column I would enter a 2 in the array in the appropriate row.
To light up any segment in the 3rd column I would enter a 4 in the array in the appropriate row.
To light up any segment in the 4th column I would enter a 8 in the array in the appropriate row.
To light up any segment in the 5th column I would enter a 16 in the array in the appropriate row.
Step 4: The Code
Code is attached.