In these past few months, I've developed several digital modules: 7 segment display, switch de-bounce, a 7-segmnt decoder, a count-up state machine and an oscillator. Later, I will put them together and create a counting up digital system, as shown in the system diagram at end of this writing up.
The 7 segment display was the first project that I accomplished. It included a DIP switch, a 7 segment LED display, and a handful of resistors and IC sockets. The goal in this basic project was to have a number appear on the display when all seven of the switches on the DIP switch were flipped in a certain pattern. The layout of this project (made by yours truly) is displayed at the bottom.
As a part of my new project, I mounted a switch onto the wire wrap board to generate the logic High and Low. However, the switch pins were too big for the wire wrap so I could not wire the switch to the circuit directly. As an alternative, I soldered 3 wire wrap pins onto the board and then soldered 3 wires between the switch and these 3 pins. An LED, as you can see in the pictures, was attached as well. It will soon be programmed to blink every second. The back of the board, where wires are attached, is displayed in the right hand picture. One resistor was put in as well. This will later play a significant role in the operation of this project. A CD74AC00E IC (integrated circuit) was attached as well (see middle image). This is technically the debouncer, the circuit that makes sure that the result is efficient and accurate.
The second problem is the switch bounce. The switch that controls the circuit does not always open or shut in a clean way. Instead of a smooth off or on, it has glitches, a series of opening and shutting, as shown below.
The next module is a 7-segment decoder. It decodes the 2-bit binary (00, 01, 10 and 11) to 7-segment codes that can display “0”, “1”, “2” and “3” on the LED digit display. This circuit is a combination circuit. In the following table, we use negative logic.
b1 b0 a b c d e f g dp
1 1 0 0 0 0 0 0 1 1 0
1 0 1 0 0 1 1 1 1 1 1
0 1 0 0 1 0 0 1 0 1 2
0 0 0 0 0 0 1 1 0 1 3
This is the decoder circuit:
At the start of the project, I attached a DIP switch into an IC socket. This would control the 7 segment LED display. After the decoder was accomplished, I moved this DIP switch to other socket to test 7 segment decoder's function by flipping 2 bits switches on the DIP switch.
During the first stage of my project (see 7 segment display), I needed all 7 switches be flipped in order to light a number to appear on the 7 segment LED display. Now with the decoder ( after the DIP switch was moved to other IC socket), a number can be formed when only 2 switches were flipped.
When I was sure that the decoder worked well, I went to the next step, which was the state machine. The state machine will generate these two bits and will show the numbers on the 7 segment LED display.
I attached four ICs onto IC sockets and connected the ICs together. They now all share the same 5v and ground. These four ICs stood for four different designators: U1, U2, U3, and U4. These make up a state machine, which is a sequential circuit that, in this case, will be the counter.
The state machine is a circuit that remembers previous state with two D flip flops and is able to make the state transient from previous state to current state based on a combination circuit. In this case, I wanted the state machine to count up to 3 and start over again. The combination circuit is just to “add 1” to the previous state number. If the state machine started at 0, it would know that in it’s next output, it should be 0+1. When it went to 3, it would automatically return to 0.
To test this state machine, I used the manual switch with the debouncer to drive the state machine clock, and used the 7-segment decoder + 7-segment LED display to monitor the state transition. Each time when switch is off and on, the number on the LED digit is increased by 1. The schematic of the state machine circuit is shown below.
The next step to this series of projects is to switch out the manual switch and replace it with something called an oscillator ("a device for generating oscillatory electric currents or voltages by non-mechanical means"). This will make the 7 segment LED display count automatically. Before, whenever the switch was flipped, a number was counted. Now with an oscillator, the numbers automatically increase every two seconds.
Personally, I feel that the oscillator was one of the hardest parts of this project. While wiring the oscillator, many mistakes occurred. Some minor ones occurred in the beginning, but the major problem was that I had successfully completed (or so I thought) the oscillator, but when I ran electricity through the board, the numbers were all messed up.
Sometimes the 7 segment display randomized the order of the numbers. Instead of going “0, 1, 2, 3” repeatedly, it began a sort of complex series of numbers, “3, 0, 2, 1, 2, 1, 1, 2, 2, 0” etc. Sometimes it would pause on a number for three seconds or so and sometimes it would glitch and only display a number for a few milliseconds.
This was quite a problem for a while. Finally, the solution was found. I had to connect several decoupling capacitors between the 5V and ground, to remove the glitches on the rising edge of the oscillator output signal. After this troubleshooting session, which was the last problem, the circuit flowed smoothly.
The schematic for the oscillator circuit is shown below:
From these projects, I have learned a lot.
One earlier problem I had on the 7-segment LED display is a wrong placement of the IC socket. I had attached IC pins to the wrong holes which were already connected on the board. The result of this mistake was that all the pins in a certain row were connected together.
At the start, I was only able to wire five or so wires correctly in a span of one hour. Towards the end of this project, I was able to do twenty correctly in one hour. My work has obviously grown throughout these projects. At the start, I used breadboards, an extremely unstable electrical board that is only good for small circuits and did not guarantee success. The wires were ones in which you were to stick into the small holes in the breadboard. Sometimes, if the wires weren’t attached to the board correctly, the circuit would not work. After this, I soon evolved to a wire wrap board - it is said wire wrap boards are especially stable and are a military grade board.
Troubleshooting seems to be the process that any circuit design has to experience. A circuit always makes a mistake, no matter what you do. Troubleshooting skills are essential for this kind of design.
I also learned how to recognize and sketch schematics and layouts for digital design. I also learned how to use certain software to draw a more professional looking schematic or design. Learning about each logic gates’ truth table was also a critical point in my study. Learning about the basic concept of LEDs was also interesting. Learning and practicing soldering was one of the most fun parts of these projects. Burning my fingers and frying my hair, however, was not.
Basic circuit elements: AND, OR, NOT, Truth Table and D flip flop; voltage, current, resistor, capacitor.
Removing ground noise with a decoupling capacitor is also important to make a circuit stable. In the future, I will add one decoupling capacitor on each IC to reduce the noise.
The completed circuit and schematic are above this final report.