A chronometer is a timekeeping device used to measure the amount of time elapsed between its activation and deactivation. It typically consists of a digital or analog display and buttons to start, stop, and reset the timer. chronometer functions are commonly used in sports, fitness activities, scientific experiments, and various timed events where precise timing is essential.
Using a chronometer with an Arduino Uno is a fun and educational project. You can create a simple chronometer using the Arduino Uno board and some additional components like buttons and an LCD display.
The operation of the chronometer controlled by the Arduino UNO with an I2C LCD display and push buttons can be described as follows:
Initial Startup: When you power the Arduino UNO, the timer begins to display Press START on the LCD display.
Start Button: By pressing the Start button, the chronometer starts measuring the time from 00:00 until you press the Stop button.
When the chronometer is running, the LCD display shows the elapsed time in minutes and seconds, for example, 00:15 (15 seconds elapsed), 01:30 (1 minute and 30 seconds), etc.
Pressing the stop button again causes the chronometer to freeze, recording the time elapsed up to that point, without setting it to zero.
Reset Button: By pressing the reset button, the timer returns to 00:00, thereby resetting the elapsed time to zero, regardless of its previous state (running or stopped).
This operation allows you to control the chronometer using the push buttons: start to start measuring time, stop to freeze the current time and reset to reset the chronometer to zero. The I2C LCD display shows real-time elapsed time in minutes:seconds format while the chronometer is running.
To build a chronometer controlled by an Arduino Uno board, you'll need several components to create the necessary functionalities. Here's a list of components required:
Arduino Uno Board:
The Arduino Uno board is a microcontroller board based on the ATmega328P microcontroller. It's one of the most popular and widely used boards in the Arduino family due to its simplicity and versatility.
It is the central control unit for your project.
I2C LCD Display:
A 16x2 or similar character LCD display that communicates using the I2C protocol. Using an I2C module simplifies the connections.
Pushbuttons:
These will serve as controls for starting, stopping, and resetting the chronometer.
Resistors:
You might need resistors (usually around 10k ohms) for pull-up or pull-down purposes when interfacing the pushbuttons to prevent floating values.
Breadboard:
A breadboard is a useful tool for creating temporary electronic circuits. It allows you to connect components without soldering.
Jumper Wires:
For making temporary connections and wiring between components.
These are the basic components required to build a chronometer using an Arduino Uno. The specific values and quantities might vary based on your design preferences and the exact functionality you wish to implement.
Mounting the Arduino Uno board with an I2C LCD display and push buttons involves physically setting up these components on a breadboard or a prototyping board and wiring them together. Here's a step-by-step guide to mounting these components:
Mount the I2C LCD Display:
- Connect the GND pin of the I2C LCD display to the GND pin of the Arduino UNO board
- Connect the VCC pin of the I2C LCD display to the 5V pin of the Arduino UNO board
- Connect the SDA pin of the I2C LCD display to the A4 pin of the Arduino UNO board
- Connect the SCL pin of the I2C LCD display to the A5 pin of the Arduino UNO board
Connect Start Push Button:
- Put a resistor (10 kohm) between one of the legs of the push button and the GND pin of the Arduino UNO
- Connect the same pin of the push button to pin 2 of the Arduino UNO board
- Connect another pin of the push button to the 5V pin of the Arduino UNO board
Connect Reset Push Button:
- Put a resistor (10 kohm) between one of the legs of the push button and the GND pin of the Arduino UNO
- Connect the same pin of the push button to pin 3 of the Arduino UNO board
- Connect another pin of the push button to the 5V pin of the Arduino UNO board
To create a chronometer display on an I2C LCD with Arduino Uno, you'll need the necessary libraries installed in your Arduino IDE to control the I2C LCD display. The most common library for this purpose is the "LiquidCrystal_I2C" library. Ensure you've installed it before proceeding.
Here's an example code that sets up a simple chronometer on an I2C LCD display with start, stop, and reset functionalities using push buttons:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
#include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27, 16, 2); //16x2 display const int start_pause_pin = 2, resetpin = 3; String stopwatch = "stop", start_pause = "low"; long start_time = 0, seconds = 0; void setup() { pinMode(start_pause_pin, INPUT); pinMode(resetpin, INPUT); lcd.init();// initialize the lcd lcd.backlight();// Backlight ON lcd.setCursor(0, 1); lcd.print("Press START"); } void loop() { if (stopwatch == "run") { lcd.setCursor(0, 0); seconds = (millis() - start_time) / 1000; long centisecond = ((millis() - start_time) / 10) % 100; lcd.print(seconds); lcd.print(" : "); lcd.print(centisecond); } if (digitalRead(resetpin) == HIGH) { //Reset stopwatch stopwatch = "stop"; start_time = 0; lcd.setCursor(0, 1); lcd.print("Press START"); } if (digitalRead(start_pause_pin) == HIGH && stopwatch == "stop") { //Start stopwatch start_time = millis(); lcd.clear(); stopwatch = "run"; start_pause = "high"; } else if (digitalRead(start_pause_pin) == HIGH && stopwatch == "run" && start_pause == "low") { //Pause stopwatch stopwatch = "pause"; start_pause = "high"; } else if (digitalRead(start_pause_pin) == HIGH && stopwatch == "pause" && start_pause == "low") { //Resume stopwatch start_time = millis() - (seconds * 1000); stopwatch = "run"; start_pause = "high"; lcd.clear(); } else if (digitalRead(start_pause_pin) == LOW) { start_pause = "low"; } delay(10); } |
Upload this code to your Arduino Uno and observe the I2C LCD display to see the chronometer functionality when you press the buttons. Adjust the connections if needed and ensure you've set up the I2C address correctly for your display.
Educational robotics refers to the use of robots and robotics technology to promote learning in educational settings. It involves the integration of technology, engineering, and computer science into the classroom, allowing students to engage in hands-on, project-based learning experiences.
In this context, our website represents an excellent resource for parents, teachers and children who wish to discover robotics.
Zaouiet Kontech-Jemmel-Monastir-Tunisia
+216 92 886 231
medaliprof@gmail.com
Robotic site created by MedAli-Teacher info