Arduino Leonardo Stopwatch

by tedchou in Circuits > Arduino

386 Views, 0 Favorites, 0 Comments

Arduino Leonardo Stopwatch

wires.jpg
Arduino leonardo stopwatch

Credit: https://www.instructables.com/id/Arduino-Stopwatch...

This stopwatch design originated from the link above, which is a stopwatch that counts from 1, whereas this one counts down from 60 seconds. Most of the code i've used follows the original creator's, so i must give where credit is due. The final product of this project would have a LCD screen counting down from 60 seconds, and two buttons that can pause the time, and reset the timer.

Supplies

Supplies needed:

1. Arduino Leonardo

2. Arduino Breadboard

3. Several jumper wires

4. Two push buttons

5. 4 330k resistors

6. LCD display with 12C module

Connect the LCD/controls

LCL1.jpg
LCL2.jpg
LCL3.jpg
completewires.jpg

For the LCD, the first two wires (yellow and orange ) should be connected to the top left of the breadboard, as shown in the picture. The other two wires (red and brown) should be connected to the SDA and SCL respectively.

Connect two of the push buttons to the Arduino. Connect the first wire to the first button, this will be the start/reset button. Connect the other side of the cable to the 8 pin on the board. Do the same for the other button but connect the other wire to pin 9 on the Arduino. Next connect both buttons to ground making sure to use 2 of the 4 resistors to prevent too much voltage. (use the pictures as a guide)

Design the Code

Screen Shot 2020-04-21 at 6.43.21 PM.png
Screen Shot 2020-04-21 at 6.43.28 PM.png

You can get the code from the link provided too:

https://create.arduino.cc/editor/tedchou621/b9c77352-5700-447e-96b5-3329fbf25f4b/preview

Yeah I Think You're Done

The cardboard box is optional, and if you've done everything correctly, the left button should function as the start/reset button, and the right button should function as the pause button.

hhha hahhaaaa