# Pomodoro on ESP-32 Implementation of the Pomodoro technique on the ESP-32 microcontroller. Each transition between work and rest cycle is indicated by one or multiple physical stimulus (melody and/or color). A display indicates the progression of the timer and double as an NTP clock. ## Table of content * [Pomodoro](#pomodoro) * [Electronic circuit](#electronic-circuit) * [Schematic](#schematic) * [Materials](#materials) * [Note on the seven-segments display and shift-register](#note-on-the-seven-segments-display-and-shift-register) * [Software](#software) * [Design](#design) * [Dependency](#dependency) * [Tool](#tool) * [Seven-segment display value](#seven-segment-display-value) ## Pomodoro Pomodoro is a time management technique that use a timer to break down task and rest period. ## Electronic circuit ### Schematic ![schematic picture](doc/schematic.png) ### Materials |Type|Designation|Quantity| |-|-|-:| |System on a chip|ESP-WROOM-32|1| |4 digit 7 segment display|HS420561K-32|1| |8-bit shift register|SN74HC595N|1| |Transistor|PN2222|4| |Diode||3| |Passive buzzer||1| |Momentary Switch||1| |Resistor|220 Ω|11| |Resistor|4.7 kΩ|4| #### **Note on the seven-display segment and shift-register** You might have notice that it's not the prettiest way to use a 4-digits seven-segments display. Initially I wanted to use one shift-register per digit, but as I found only one SN74HC595N on my parts bins, I ultimately decided to make do. The result is a bit messier but works. ## Software ### Design This software make use of the two core of the ESP-32, and it's FreeRTOS implementation to have two tasks: 1. Display the time remaining on the clock and use interrupt to count each second passed. 2. Alarm the user of a transition between task and rest with the use of melody and visual cue. ### Dependency Ignoring the common library use in almost every project (like `stdint.h`, `Arduino.h`, `esp32-hal-ledc.h` or `HardwareSerial.h`), the code make use of: * [pitches.h from arduino](https://github.com/arduino/arduino-examples/blob/main/examples/02.Digital/toneMelody/pitches.h) to create melody using the piezo speaker. Included in [lib/pitches.h](lib/pitches.h) for ease of deployment. ## Tool ### **Seven-segment display value** To ease the transition between physical segment and binary/hexadecimal code, I created a small HTML tool [tool/SevenSegmentDisplayValue.html](tool/SevenSegmentDisplayValue.html). ![segmentDisplayConverter.html in action](doc/tool_SevenSegmentDisplayValue.png)