This document describes implementing a digital stopwatch using a Basic Stamp II microcontroller. The objectives are to gain familiarity with the BS2 programming environment, interface a LCD display as a digital stopwatch, and implement digital inputs from a keypad and outputs to a display. The hardware used includes a Basic Stamp II module, development board, and LCD. The procedure involves experiments, a flow chart, circuit design, and programming the stopwatch functionality. Testing achieves a timing accuracy of within 0.5 seconds over 3 hours of operation.
A Journey Into the Emotions of Software Developers
Implementing a Digital Stopwatch Using Basic Stamp2
1. IMPLEMENTING A DIGITAL STOPWATCH USING BASIC STAMP II MAE 576 [MECHATRONICS] LAB-1 University at Buffalo, Mechatronics, Spring 2010 Chembrammel Elavunkal SrinivasanVishwajeet GROUP E
2. INTRODUCTION Implement a digital stopwatch on Liquid Crystal Display (LCD) The components used and their functioning are The circuit used for the implementation is drawn The code controlling the hardware is included to complement the understanding of the functioning of the stopwatch The accuracy of the stopwatch is discussed Solution to improve the accuracy is proposed. University at Buffalo, Mechatronics, Spring 2010 2
3. OBJECTIVES Gain familiarity with BS2 programming environment. Implement digital inputs from a keypad Perform digital outputs to a seven-segment display Interface a LCD display as a digital stopwatch. University at Buffalo, Mechatronics, Spring 2010 3
4. HARDWARE OVERVIEW Basic Stamp 2 (Rev. J) Module Professional Development Board 2 x 16 Parallel LCD University at Buffalo, Mechatronics, Spring 2010 4
9. HYPOTHESIS University at Buffalo, Mechatronics, Spring 2010 9 When Switch S1(part M) is pressed, begin flashing the LED (part F) once per second and continuously display and update the time in seconds on the LCD (not a part of PDB) display. When Switch S2 is pressed, stop the clock and display the elapsed time. If Switch S1 is pressed again, continue counting up while waiting for Switch S2 to be pressed. Switch S3 is used to reset the display. The seven segment display (part G) should flash the number of switch being pressed.
10. PROPOSED SOLUTION Integrate part A-D of experiments to obtain functionality of stopwatch Develop a flow chart to get better understanding of process Create circuit layout to integrate all necessary hardware Program code to ensure full operation spectrum Implement finished digital system University at Buffalo, Mechatronics, Spring 2010 10
16. PROCEDURE [Source Code] University at Buffalo, Mechatronics, Spring 2010 16 Source Code (Attached to Webpage) USED: 38% of the EEPROM 5 registers Please note the source code to run the digital stopwatch is attached to this website for your convenience
17. PROCEDURE [Special Connections] *These connections should always be ensured for proper operation of the system University at Buffalo, Mechatronics, Spring 2010 17
18. IMPLEMENTATION Power Switch/Light 7-segment Display LED7 18 LCD Piezo Beeper S1 S2 S3 University at Buffalo, Mechatronics, Spring 2010
19. CALIBRATION Coarse delay and Fine delay tuning mechanism to be able to manually adjust the timing operation University at Buffalo, Mechatronics, Spring 2010 19
20. TESTING 1 second every 3 hours University at Buffalo, Mechatronics, Spring 2010 20
22. ERROR ESTIMATION 22 In simple terms there is an error of 0.333s introduced every 60 minutes operation of the stopwatch timing University at Buffalo, Mechatronics, Spring 2010
23. CONCLUSION University at Buffalo, Mechatronics, Spring 2010 23 Able to implement the digital stopwatch using BS2 microcontroller Familiarized aspects of integrating multiple electronic components and program them Implemented the digital stopwatch with accuracy using minimum number of electronic components Laid emphasis compact design 38% of the total EEPROM due to good programming practice Calibration process yielded combined “Coarse & Fine” delay of 844ms Accuracy and precision of ±0.5 seconds