## ECEN 1400 - Introduction to Digital and Analog Electronics

### Lab 10: The Digital Clock Project

#### Goals of this Lab

• Design and build your own digital clock.
• Learn what it takes to convert an idea into an actual design.
• Learn how to deal with real life constraints like time, money, availability of components, etc.
• Use data sheets to learn and underststand what different components do, what their limits are, and how they can be connected to each other.
• Learn how to select and order components from electronics distributors.
• Learn how to plan and implement the layout of a prototype circuit.
• Learn how to debug and measure a complete circuit.
• Be creative!

The digital clock project is an individual effort. Each student has to design and implement their own clock, demo the working of the clock, and turn in an individual final project report. Feel free to discuss your plans with others and help others or get help from them. But you will not get credit for a design that is just a copy of someone else's design.

#### Milestones

Milestone M1: Functional Block Diagram (2 points, 0.5 point extra for being on time). In labs 7, 8 and 9 you built basic versions of all the essential pieces needed for a digital clock. To start on the design of your clock, break the whole system down into functional blocks such as the seconds, minutes, and hours counter, the timing oscillator, the display, the set logic, the power supply, etc. Specify how the functional blocks interface with each other, e.g., the counters represent minutes and hours as binary coded decimals (BCD), the counters all run from a common clock and are enabled and disabled using a separate signal generated by the preceding stage, the power supply delivers 5Vdc with a maximum current of 1A, etc. Start from a sketch of how the functional blocks will be interconnected and then use Multisim to draw a schematic. You may want to verify the correct operation of some crucial functional blocks by setting up a simulation for individual blocks in Multisim. Some points to consider are:

• You have to decide how to display hours and minutes and, optionally, seconds. There are many ways that could be used to display time, e.g., using a standard BCD hours and minutes format, a binary display, or a simulated analog clock. Be creative, but keep in mind that the power supply that you will build delivers only 1A of current at 5V. Consider making the brightness of the display adjustable for day and night use.
• You have to decide what oscillator to use for the timing. Choices include the use of a RC oscillator (e.g., using the 555 timer chip) or a quartz crystal oscillator like the one you built in lab 9. Both types of oscillators can be made adjustable (using a variable R or C) to improve the long-term timing accuracy. The minimum requirement for accuracy is that your clock keeps track of time within plus/minus 0.5% (that is still very crude and translates into plus/minus 7.2 minutes per day!)
• Another issue is how to keep track of the hours, e.g., using 12 hour format and an am/pm indicator, or using 24 hour military time. Note that the usual display for 12 hour format starts at 12 then goes to 1, 2, 3, etc. You could also contemplate making the display switchable between the two formats.
• If you decide to display seconds, you caould either use 6 digits, or you could make a 4 digit display that is switchable between HH:MM and MM:SS formats.
• What happens to your clock when there is a power outage? Unless you add a (optional) battery backup feature, it will loose current time and will need to be set again.
• To set your clock, either when you first power it up, or after a power out, you need some buttons and/or switches for setting the time. The minimum expectation is that you can set the minutes and the hours independently.

Milestone M2: Complete Design and Bill of Materials (2 points, 0.5 point extra for being on time). At this point you should have a completed design with a full schematic in Multisim. Now you need to decide how to implement the design, either using WireWrap, soldering on a general purpose PCB, soldering on a custom designed PCB, or using a combination of implementation methods. Use the reporting tool in Multisim to create a bill of materials (BOM) and check this with your TA to make sure you have the right parts (so you can order them) and in the right form factors (so they will fit on the circuit board).

After you complete this milestone, start getting all of your parts, either from the EE store, another local source like RadioShack or J.B. Saunders, or by ordering them. Consider combining orders with other students to cut down on shipping costs and take advantage of higher volume discounts. If you make your own PCB get it designed, checked, and ordered. Keep in mind that the turnaround time for a custom PCB is about 1 week.

Milestone M3: Parts in Hand, Started Building and Testing Modules (2 points, 0.5 point extra for being on time). At this point you should have all parts purchased and in-hand, including either a general purpose or a custom designed printed circuit board, and you should have started the process of building and testing parts of your clock design. A good approach is to build each of your functional blocks from milestone M1 and test them independently. For example, use a function generator as input signal for a block and look at the output of the block using the oscilloscope. Compare the output of each block to your simulated or calculated results. Test for special conditions such as the rollover from 11:59 to 12:00. Test the function of input and output devices (switches and LEDs). Test aggressively to try to find problems, not meekly in the hopes of not finding any.

Demonstration of Working Clock. You must demonstrate your working clock to your TA in the lab (or by special arrangement) on or before the last day of classes. The TA will instruct you to demonstrate specific features of the clock and/or make measurements, e.g., of the timing frequency.

#### Timeline

• Milestone M1 Functional Block Diagram: Fri. Apr. 4 during regular lab time.
• Milestone M2 Complete Design and Bill of Materials: Fri. Apr. 11 during regular lab time.
• Milestone M3 Parts in Hand, Started Building and Testing Modules: Fri. Apr. 18 during regular lab time.
• Design Expo: Thu. May 1, 9:30 am - 12:00 pm, demonstrate and/or exhibit your clock design as part of the Senior Design Expo. Works in progress are welcome too!
• Demo of Working Clock: Fri. May 2 during regular lab time.
• Final Report: Fri. May 2, 11:59 pm in D2L dropbox.

You can start a functional block diagram in Multisim by making use of hierarchical blocks, see Section 4.2 of the Multisim User Guide. An example for a 4-digit clock display is shown in this schematic which was saved as ClockDesign001.

The block labeled BCDto7Seg is a separate design that is used as a functional block in ClockDesign001. Initially, this design may be empty except for the connection pins as shown below.

The detailed circuitry can then be added later to the BCDto7Seg design and will automatically be incorporated through the hierarchical block feature in the ClockDesign001 design. In this way you can start with a high level design and fill in more details later on.

Grading Rubric. The clock project is worth 25 points (25% of 100 points for the semester). After completing the milestones you will have 6 points already (7.5 points with extra credit). The remaining 19 points are split up as follows:

1. 9 pts: Hours and Minutes Display. Your clock has to display hours and minutes in some fashion. Each digit should roll over at the appropriate time if you are using a digital display.
2. 3 pts: Accurate Oscillator. We will measure the frequency of your oscillator to determine if the timing frequency is accurate to within a factor of 0.995 to 1.005.
3. 3 pts: Time Set. You must be able to set the time of your clock. There are various ways to achieve this and grading will reflect the sophistication of the method you choose.
4. 4 pts: Working Power Supply. Your power supply must supply the required voltage(s) and current(s) for your clock.
5. -3 (minus 3!) pts: Breadboard Only. You don't wire-wrap, solder, and/or create your own circuit board, but the clock still works on one or more breadboards.
6. -5 pts (minus 1...5!): Project Report Problems. Points will be subtracted for incomplete or inadequate project reports.

The basic clock must display hours and minutes and accept a time (i.e., you can set the clock) to moderate accuracy. Full credit also includes:

• Demonstrated on or before the final day of classes.
• Not in a case.

Extra Credit. Extra credit is available, up to a total maximum score of 35 points (out of 25). If you have other good ideas than the ones listed below, ask and we'll include them in the list.

• 1 pt (bumped up from 0.5 pts): Show the clock off on Expo Day (Thursday before last day of classes). If you finish early and have a presentable clock, we'll ask you to show it off to the executives from industry that make up the department's industrial advisory board and other visitors of the Senior Design Expo.
• 1 pt: Finish early. You demo your clock before the last regular lab period (i.e., before the last day of classes).
• 1 pt: AM/PM indicator. Your 12 hour clock shows AM versus PM, e.g., with a LED that is lit for one but not the other.
• 1 pt: Seconds display. Your clock displays seconds in addition to minutes and hours, e.g., by using six 7-segment displays or by having the option to switch between HH:MM and MM:SS display modes.
• 2 pts: Clock keeps time during power outage. The clock has a provision, e.g., using batteries or a supercapacitor, to keep counting time (but not necessarily displaying it) during power outages of a few minutes or more.
• 1 pt: Display brightness adjustable. The clock has a provision adjust the brightness of the display, e.g., in the form of a day and night setting.
• 1-2 pts: Cool circuit implementation. You implement your own transistor-based regulator, do the logic entirely using NAND gates or something else neat and unusual.
• 0-1 pts: Cool design, not implemented. You design a day/month/year calendar or your own up/down counter or something fairly difficult but you don't implement it. You are responsible for proving that this really works and for documenting the level of difficulty. This category is entirely at the discretion of the TAs.
• 1-2 pts: Cool display. Nixie tubes, a multi-digit seven segment display, a creative use of individual LEDs, etc.
• 1-2 pts: Cool case. Low end - a creatively decorated shoe box, high end - a professional looking custom designed enclosure made from something durable like plastic, metal or wood.
• 1-2 pts: Cool time set function. You can go faster by holding the button down, or ...
• 2 pts: 12/24 hour select. You can switch between 12 hour and 24 hour dipslay mode (without having to reset the clock).
• 2 pts: Printed circuit board. You designed your own printed circuit board for the clock, got it manufactured, and actually built your clock using it.
• 1-3 pts: Sound. Your clock has some meaningful sound capabilities, e.g., it beeps on the full hour or a bell rings as many times as the current hour.
• 3 pts: Date. Your clock has some form of date display.
• 5 pts: Alarm. You can set an alarm time, activate/disable the alarm and the alarm does something significant (e.g., makes noise) when the clock time reaches the alarm time.

#### Project Report

Each student needs to write his or her own project report. This should be a concise document that describes the design process and contains the schematics of all parts with an explanation of how each part works. You also need to state how well each part of the design worked and what measurements you took to judge the success of your project. If some part is not working as expected, describe what changes you would propose to correct the problem. In the conclusion state what you learned from the project and what you would do different next time.

Specific Project Report Requirements:

2. Full schematic with labeled blocks.
3. Complete parts list.
4. Answers to design issue questions.
5. Important simulation results.
6. Debugging problems and solutions.
7. Characterization of the overall performance of your project implementation.
8. What did you learn and what would you do different next time.