In this first project I build the basics of a computer clock. A clock is a signal that oscilates between a high and a low states and its used to keep everything in sync depending on how fast the clock speed it. This is part of a project to build an 8 bit computer from scratch, click here to learn more.
- 1X NE555 Timer
- 1X 1microfarad Capacitor
- 1x 0.1microfarad Capacitor (104)
- 1X 0.01microfarad Capacitor (103)
- 3X 22Ohm Resistor (Red-Red-Brown)
- 1x 1MOhm Potentiometer
- 1x Yellow LED
- 1x Breadboard
- 1x Wireset
- 1x Power Supply 5V
The NE 555 Timer is an integral part of thus project so I shall cover the connection bit part.
This classic 555 timer has 8 pins. PIN 1 is top left.
- PIN 1: Negative
- PIN 2: Negative of capacior, PIN 6
- PIN 3: Diode
- PIN 4: Positive
- PIN 5: PIN 2
- PIN 6: Resistor
- PIN 7:
- PIN 8: Positive
Principle of Operation
The objective for this circuit is to be able to produce a pulsating signal that is going to be our clock signal. Thats where the 555 timer comes in. Before you go further please remember to consoult the datasheet(555) which can be found here.
When the circuit above is turned ON, there exists a voltage divider starting from +5V to 0V accross the 3 resistors. When you go through the first resistor, the voltage drop is 1/3 of 5V which is 3.33V. Going through the second resistor, the drop is also by 1/3 and it becomes 1.667V. Finally the last resistor drops the voltage further to 0V.
Now we have 2 comparators which are connected as per the diagram above. In the top comparator if the +ve input is above the -ve input, the comparator turns ON. The output becomes 5V. If the +ve input is below the -ve input the comparator turns OFF and the output is 0V.
What will happen is that the bottom comparator will turn ON since 1.33V is higher than 0V. When it turns ON, it shall pass a signal to the S(Set) pin of the SR Latch which is going to turn ON Q which in turn turns on the LED. Remember all this time the top comparator since the voltage going at its -ve terminal is 3.33V while the positive is 0V. So it cannot turn ON.
Since the output Q is ON, therefore Q(Not) is OFF so the transistor cannot turn ON. Therefore nothing will happen at PIN 7.
Wile this is happening, there is going to be a current flowing through the 1kOhm resistor, then 100kOhm, resistor and finally to the capacitor. At this point the voltage on the line (esp. at point 2)is minimal. The capacitor starts to charge. The charge at the capacitor is equal to the voltage at PIN 2. As the capacitor starts to charge so does the voltage. This rise in voltage continues until it crosses the 1.67V which was at the +ve PIN of the bottom comparator. This change in potential difference turns the comparator OFF, this means we are not asserting the Set signal anymore. However the SR Latch is still latches and remains ON.
So the voltage continues to rise and soon arrives at 3.33V and crosses it which causes the upper comparator to turn ON since the +ve is higher that the -ve terminal. When this comparator turns ON, it then has an output which now turns the SR Latch OFF. When the latch is OFF the Inverted Q turns ON and has an output which causes the Discharge transistor to come ON. At this point curret now has a different flow path, it now flows through the 1K Ohm reiststor through the transistor via terminal 7 to the ground. Also the discharging capacitor now discharges through this same path to the transistor until ground. The capacitor continues to discharge until below 3.33 which causes the comparator to turn OFF. This will not affect anything since its the Reset pin.
Onnce the voltage falls below 1.66V, the second comparator is now turned ON. At this point the latch is set again and there is a output at the LED. Also the Inverted Q is turned OFF, turning OFF the transistor. The capacitor stops discharging and starts charging again.
The capacitor is charging and discharging using curve waves but output is a square wave. This output is what is displayed the the LED and it happens very very fast. The ON/OFF is Charging/Discharging. To control the rate of charging and discharging, we need to understand what components are used in both states. In charging state, the current flows through the 1k Ohm, 100K Ohm resistors. If the resistance is large, the capacitor will take a longer time to charge and vice versa. Also the size of the capacitor affects the charging time. If the capacitor is large, it shall charge slower, and if its small it shall charge faster. So by varying the two resistors & capacitor sizes we can control the charging time. When it comes to discharging, the capacitor discharges via the 100KOhm resistor. Again, if its large, the capacitor discharge time will be longer.
The charging and discharging stages have a common resistor (100 KOhm). The 1KOhm is about 1% of the 100 KOhm resistor. Reason being that this will ensure a uniform duty cyle square wave.
The circuit now has a constant pulsating signal which shall be our clock cycle for our computer. In the next step I will find a way to control this pulse. If I ever need to pulsate the clock at will(manually).