Making a chronometer with ESP32 board and TM1637 display

ESP32 04-01-24
701 0

Tutorial plan

Introduction

1- Operation of the chronometer controlled by the ESP32 board

2- The components needed to build a chronometer controlled by the ESP32 board

3- Mounting the ESP32 board board with the TM1637 display and push buttons

4- Programming the ESP32 board with MicroPython to display the chronometer on TM1637 display

 

 

Introduction

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 the ESP32 board is a fun and educational project. You can create a simple chronometer using the ESP32 board and some additional components like buttons and the TM1637 display.

Operation of the chronometer controlled by the ESP32 board

A chronometer controlled by an ESP32 board typically involves using the ESP32's GPIO (General Purpose Input/Output) pins to interface with buttons for control and potentially a display for visual feedback. Here's a step-by-step breakdown of how it could work:

1- Hardware Setup:

- ESP32 Connections: Connect buttons to specific GPIO pins on the ESP32. Ensure you use pull-up or pull-down resistors to prevent floating states when buttons aren't pressed.

- TM1637 Display: If using a TM1637 display to visualize the timer, wire it up according to its specifications, usually through GPIO pins.

2- Software Implementation:

- Initialization: Set up your programming environment and libraries required to program the ESP32, such as the Arduino IDE with ESP32 support or using MicroPython.

- GPIO Configuration: Configure GPIO pins connected to buttons as inputs and other pins for the display (if used) as outputs.

- Main Loop: In the main loop of your code, continuously check the status of the buttons using functions like digitalRead()in Arduino or corresponding methods in MicroPython.

- Chronometer Logic: When the start button is pressed, initiate the timer. Use a variable to keep track of time.

- Display (if used): If you're using a display, update it with the elapsed time.

- Pause/Stop/Reset: Implement functionality for pausing, stopping, or resetting the timer based on button presses.

The components needed to build a chronometer controlled by the ESP32 board

To build a chronometer controlled by the ESP32 board, you'll need several components to create the necessary functionalities. Here's a list of components required:

ESP32 Board:

ESP32 card

The ESP32 is a powerful microcontroller developed by Espressif Systems. It's renowned for its integrated Wi-Fi and Bluetooth capabilities, making it a popular choice for various IoT (Internet of Things) applications.

TM1637 display

The TM1637 is a popular four-digit seven-segment LED display driver. It's commonly used with ESP32 board and other microcontrollers to interface with 7-segment displays and show numerical information.

Pushbuttons:

push button

These will serve as controls for starting, stopping, and resetting the chronometer.

Breadboard:

Test plate

A breadboard is a useful tool for creating temporary electronic circuits. It allows you to connect components without soldering.

Jumper Wires:

Jumper wires

For making temporary connections and wiring between components.

These are the basic components required to build a chronometer using the ESP32 board. The specific values and quantities might vary based on your design preferences and the exact functionality you wish to implement.

Mounting the ESP32 board with the TM1637 display and push buttons

Mounting the ESP32 board with the TM1637 display and push buttonsMounting the ESP32 board with the TM1637 display and push buttons

Mounting the ESP32 board with the TM1637 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 TM1637 Display:

- Connect the GND pin of the TM1637 display to the GND pin of the ESP32 board

- Connect the VCC pin of the TM1637 display to the 3.3V pin  of the ESP32 board

- Connect the DIO pin of the TM1637 display to the GPIO 4 pin of the ESP32 board

- Connect the CLK pin of the TM1637 display to the GPIO 2 pin of the ESP32 board

Connect Start Push Button:

- Connect the one of the legs of the push button to GPIO 23 pin of the ESP32 board

- Connect another pleg of the push button to the GND pin of the ESP32 board

Connect Reset Push Button:

- Connect the one of the legs of the push button to GPIO 22 pin of the ESP32 board

- Connect another leg of the push button to the GND pin of the ESP32 board

Programming the ESP32 board with MicroPython to display the chronometer on TM1637 display

To program an ESP32 board using MicroPython to display a chronometer on a TM1637 display, you'll need to set up MicroPython on the ESP32 and utilize the tm1637.py for MicroPython.

Here's an example code that demonstrates a simple chronometer displayed on a TM1637 display using MicroPython:

This code assumes that the TM1637 display is connected to GPIO pins GPIO 2 (CLK) and GPIO 4 (DIO) of the ESP32. Adjust these pins according to your actual wiring configuration.

The buttons (start, reset) are connected to GPIO pins GPIO 23 and GPIO 22 respectively.

This program continuously checks the state of the buttons. When the start button is pressed, the chronometer begins counting. When the start button is pressed again, the chronometer stops, and the reset button sets the time back to zero. The current elapsed time is displayed on the TM1637 display in the format of "mm:ss".

0 comment

Leave a comment

Veuillez noter s'il vous plaît*

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Purpose of this website

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.

Contact details

Zaouiet Kontech-Jemmel-Monastir-Tunisia

+216 92 886 231

medaliprof@gmail.com

Pictures of the articles

Robotic site created by MedAli-Teacher info