IMPLEMENTING A DIGITAL STOPWATCH USING BASIC STAMP IIMAE 576 [MECHATRONICS] LAB-1University at Buffalo, Mechatronics, Spring 2010Chembrammel Elavunkal	 SrinivasanVishwajeetGROUP E
INTRODUCTIONImplement a digital stopwatch on Liquid Crystal Display (LCD) The components used and their functioning areThe circuit used for the implementation is drawnThe code controlling the hardware is included to complement the understanding of the functioning of the stopwatchThe accuracy of the stopwatch is discussedSolution to improve the accuracy is proposed.University at Buffalo, Mechatronics, Spring 20102
OBJECTIVESGain familiarity with BS2 programming environment.Implement digital inputs from a keypadPerform digital outputs to a seven-segment displayInterface a LCD display as a digital stopwatch.University at Buffalo, Mechatronics, Spring 20103
HARDWARE OVERVIEWBasic Stamp 2 (Rev. J) ModuleProfessional Development Board2 x 16 Parallel LCDUniversity at Buffalo, Mechatronics, Spring 20104
HARDWARE OVERVIEWProfessional Development Board (PDB)University at Buffalo, Mechatronics, Spring 20105
HARDWARE OVERVIEWUniversity at Buffalo, Mechatronics, Spring 20106Basic Stamp 2 (Rev. J) Module
HARDWARE OVERVIEW7[i] http://www.parallax.com/tabid/134/List/1/ProductID/1/Default.aspxBasic Stamp 2 (Rev. J) ModuleEEPROMRegulatorInterpreterPIC16F57University at Buffalo, Mechatronics, Spring 2010
HARDWARE USEDUniversity at Buffalo, Mechatronics, Spring 20108
HYPOTHESISUniversity at Buffalo, Mechatronics, Spring 20109When 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.
PROPOSED SOLUTIONIntegrate part A-D of experiments to obtain functionality of stopwatchDevelop a flow chart to get better understanding of processCreate circuit layout to integrate all necessary hardwareProgram code to ensure full operation spectrumImplement finished digital systemUniversity at Buffalo, Mechatronics, Spring 201010
CONSTRAINTS [Self Imposed]University at Buffalo, Mechatronics, Spring 201011Ensure clean hardware implementationReduce use of hardware resourcesStreamline coding to achieve optimal functionalityTest and achieve maximum timer accuracyAdditional GoalsWelcome Message
Status gesture to indicate operationPROCEDUREExperiments A - DUniversity at Buffalo, Mechatronics, Spring 201012
PROCEDURE [Flow Chart]Flow ChartUniversity at Buffalo, Mechatronics, Spring 201013
PROCEDURE [Circuit]CircuitUniversity at Buffalo, Mechatronics, Spring 201014
PROCEDURE [Pin Layout]Pin LayoutUniversity at Buffalo, Mechatronics, Spring 201015
PROCEDURE [Source Code]University at Buffalo, Mechatronics, Spring 201016Source 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
PROCEDURE [Special Connections]*These connections should always be ensured for proper operation of the systemUniversity at Buffalo, Mechatronics, Spring 201017
IMPLEMENTATIONPower Switch/Light7-segment DisplayLED718LCDPiezo BeeperS1S2S3University at Buffalo, Mechatronics, Spring 2010
CALIBRATIONCoarse delay and Fine delay tuning mechanism to be able to manually adjust the timing operationUniversity at Buffalo, Mechatronics, Spring 201019
TESTING1 second every 3 hoursUniversity at Buffalo, Mechatronics, Spring 201020
ERRORSUniversity at Buffalo, Mechatronics, Spring 201021
ERROR ESTIMATION22In simple terms there is an error of 0.333s introduced every 60 minutes operation of the stopwatch timingUniversity at Buffalo, Mechatronics, Spring 2010
CONCLUSIONUniversity at Buffalo, Mechatronics, Spring 201023Able to implement the digital stopwatch using BS2 microcontrollerFamiliarized aspects of integrating multiple electronic components and program themImplemented the digital stopwatch with accuracy using minimum number of electronic componentsLaid emphasis compact design38% of the total EEPROM due to good programming practiceCalibration process yielded combined “Coarse & Fine” delay of 844msAccuracy and precision of ±0.5 seconds
REFERENCEShttp://www.parallax.com/Store/Education/KitsandBoards/tabid/182/CategoryID/67/List/0/SortField/0/Level/a/ProductID/320/Default.aspxhttp://www.parallax.com/tabid/441/Default.aspxBASIC Stamp Syntax and Reference Manualhttp://www.parallax.com/tabid/214/Default.aspxhttp://www.parallax.com/tabid/134/List/1/ProductID/1/Default.aspxhttp://www.parallax.com/Portals/0/Downloads/docs/prod/audiovis/lcd2x16par.pdfUniversity at Buffalo, Mechatronics, Spring 201024

Implementing a Digital Stopwatch Using Basic Stamp2

  • 1.
    IMPLEMENTING A DIGITALSTOPWATCH USING BASIC STAMP IIMAE 576 [MECHATRONICS] LAB-1University at Buffalo, Mechatronics, Spring 2010Chembrammel Elavunkal SrinivasanVishwajeetGROUP E
  • 2.
    INTRODUCTIONImplement a digitalstopwatch on Liquid Crystal Display (LCD) The components used and their functioning areThe circuit used for the implementation is drawnThe code controlling the hardware is included to complement the understanding of the functioning of the stopwatchThe accuracy of the stopwatch is discussedSolution to improve the accuracy is proposed.University at Buffalo, Mechatronics, Spring 20102
  • 3.
    OBJECTIVESGain familiarity withBS2 programming environment.Implement digital inputs from a keypadPerform digital outputs to a seven-segment displayInterface a LCD display as a digital stopwatch.University at Buffalo, Mechatronics, Spring 20103
  • 4.
    HARDWARE OVERVIEWBasic Stamp2 (Rev. J) ModuleProfessional Development Board2 x 16 Parallel LCDUniversity at Buffalo, Mechatronics, Spring 20104
  • 5.
    HARDWARE OVERVIEWProfessional DevelopmentBoard (PDB)University at Buffalo, Mechatronics, Spring 20105
  • 6.
    HARDWARE OVERVIEWUniversity atBuffalo, Mechatronics, Spring 20106Basic Stamp 2 (Rev. J) Module
  • 7.
    HARDWARE OVERVIEW7[i] http://www.parallax.com/tabid/134/List/1/ProductID/1/Default.aspxBasicStamp 2 (Rev. J) ModuleEEPROMRegulatorInterpreterPIC16F57University at Buffalo, Mechatronics, Spring 2010
  • 8.
    HARDWARE USEDUniversity atBuffalo, Mechatronics, Spring 20108
  • 9.
    HYPOTHESISUniversity at Buffalo,Mechatronics, Spring 20109When 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 SOLUTIONIntegrate partA-D of experiments to obtain functionality of stopwatchDevelop a flow chart to get better understanding of processCreate circuit layout to integrate all necessary hardwareProgram code to ensure full operation spectrumImplement finished digital systemUniversity at Buffalo, Mechatronics, Spring 201010
  • 11.
    CONSTRAINTS [Self Imposed]Universityat Buffalo, Mechatronics, Spring 201011Ensure clean hardware implementationReduce use of hardware resourcesStreamline coding to achieve optimal functionalityTest and achieve maximum timer accuracyAdditional GoalsWelcome Message
  • 12.
    Status gesture toindicate operationPROCEDUREExperiments A - DUniversity at Buffalo, Mechatronics, Spring 201012
  • 13.
    PROCEDURE [Flow Chart]FlowChartUniversity at Buffalo, Mechatronics, Spring 201013
  • 14.
    PROCEDURE [Circuit]CircuitUniversity atBuffalo, Mechatronics, Spring 201014
  • 15.
    PROCEDURE [Pin Layout]PinLayoutUniversity at Buffalo, Mechatronics, Spring 201015
  • 16.
    PROCEDURE [Source Code]Universityat Buffalo, Mechatronics, Spring 201016Source 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]*Theseconnections should always be ensured for proper operation of the systemUniversity at Buffalo, Mechatronics, Spring 201017
  • 18.
    IMPLEMENTATIONPower Switch/Light7-segment DisplayLED718LCDPiezoBeeperS1S2S3University at Buffalo, Mechatronics, Spring 2010
  • 19.
    CALIBRATIONCoarse delay andFine delay tuning mechanism to be able to manually adjust the timing operationUniversity at Buffalo, Mechatronics, Spring 201019
  • 20.
    TESTING1 second every3 hoursUniversity at Buffalo, Mechatronics, Spring 201020
  • 21.
    ERRORSUniversity at Buffalo,Mechatronics, Spring 201021
  • 22.
    ERROR ESTIMATION22In simpleterms there is an error of 0.333s introduced every 60 minutes operation of the stopwatch timingUniversity at Buffalo, Mechatronics, Spring 2010
  • 23.
    CONCLUSIONUniversity at Buffalo,Mechatronics, Spring 201023Able to implement the digital stopwatch using BS2 microcontrollerFamiliarized aspects of integrating multiple electronic components and program themImplemented the digital stopwatch with accuracy using minimum number of electronic componentsLaid emphasis compact design38% of the total EEPROM due to good programming practiceCalibration process yielded combined “Coarse & Fine” delay of 844msAccuracy and precision of ±0.5 seconds
  • 24.
    REFERENCEShttp://www.parallax.com/Store/Education/KitsandBoards/tabid/182/CategoryID/67/List/0/SortField/0/Level/a/ProductID/320/Default.aspxhttp://www.parallax.com/tabid/441/Default.aspxBASIC Stamp Syntaxand Reference Manualhttp://www.parallax.com/tabid/214/Default.aspxhttp://www.parallax.com/tabid/134/List/1/ProductID/1/Default.aspxhttp://www.parallax.com/Portals/0/Downloads/docs/prod/audiovis/lcd2x16par.pdfUniversity at Buffalo, Mechatronics, Spring 201024