Close
0%
0%

Productivity Timer (a.k.a. Pomodoro Timer)

For people who want to focus on certain task, the Productivity Timer is a simple device that divides your time into well-defined blocks.

Similar projects worth following
You've probably heard of Pomodoro Technique(R) (https://francescocirillo.com/pages/pomodoro-technique). In short, you divide your time into 30 minutes blocks, each of which consists of 25 minutes work time and 5 minutes break time. Work time needs to be 100% focused on selected tasks (no interruptions). More details are on the linked website.I've been using this technique for around 5 years now. It helped me in doing many projects and learning for exams. You don't need a dedicated device for Pomodoro Technique(R) - one can use a timer on smartphone or PC. But I found out, that this types of solutions distract me in some way and reduce my productivity. I wanted a device, that would measure the time, automatically switch between work and pause time chunks and would give me visual and audio cues on how much time is left in certain Pomodoro.

Timers developed so far

So far I've built v0.1 and v0.2 of Pomodoro Timers (described here (v0.1) and here (v0.2)). Version 0.2 is pretty good (I've been using it every day for the last 3 years), but now I want to develop something that other people can use (which means the device has to have a case and built-in battery with a charger).

REQUIREMENTS SPECIFICATION

Outputs
LED bar – shows how much time is left
Status RGB LED (red – work state, green – break state)
Buzzer – beeps indicate time change (and possibly low battery?)

Inputs
Push button – to pause/resume/reset the timer
Bistable switch (slider) – turn the device on and off (cuts the power)
Micro-USB type-B receptacle – used to charge the battery
Light sensor - enable adaptation to ambient light

Mechanical
The timer should be inside a case (probably 3D-printed). Form factor can be similar to current Pomodoro timer.
Approximate outer case dimensions:
width: 70mm
height: 50mm
depth: 15mm
The case should have foldable support on the back side, so that when the support is extended, the device is at around 45deg angle to the desk. Support should have some kind of protruding element that enables the user to easily extend the support. When support is retracted, it should be flush with the back of the case.

Battery and charging
The device should have 20 hours work time (around 2 work days).
Battery should be charged via micro USB type-B receptacle.
When charging, current battery charge should be shown on the LED bar (low intensity).

Power switch
The device should be turned on via bistable switch (slider on the left side).
Ideally, current consumption with switch in OFF position should be 0uA.
Ideally, charging should be possible with switch in OFF position (+ showing charge on LED bar). When USB cable is unplugged, the device turns itself off again.
If power switch is in ON position and USB cable is plugged, then device is charging, but operates as normal (pomodoro timer function).
If power switch is in OFF position and USB cable is plugged, then device is charging and showing current battery charge (no pomodoro timer function).

Work cycle
Pomodoro states: WORK, BREAK.
Timer states: RUNNING, PAUSED.
When the device is powered up, it enters WORK PAUSED state – LED bar is full and status LED is blinking in red.
LED bar ‘progress’ should be proportional to how much time is left in current state.
Short button press changes PAUSED state to RUNNING and RUNNING state to PAUSED.
Status LED color shows current Pomodoro state (WORK – red, BREAK – green) and timer state by blinking (solid – RUNNING, blinking – PAUSED).
Long button press resets the device into WORK PAUSED state (with full time (25min)).

Ambient light adaptation
LEDs brightness should be automatically adjusted to ambient light. In bright ambient light the LEDs should produce more light. In dark room, the LEDs brightness should be lowered.

Low battery alarm
The device should inform the user in some way that the battery is running low. If battery charge is below certain threshold (e.g. 10%), the device should go into low power mode – one red LED blinking with very low light intensity. When battery charge is really low (e.g. 5%), the device should power itself off.

  • First timer assembled! Electronics, firmware and mechanical design update

    Luke12/02/2018 at 17:30 0 comments

    Some time has gone by since my last log update.

    ELECTRONICS

    During that period the PCBs and parts arrived and I assembled one timer :) 

    The assembly process went smooth. The smallest parts are LED driver and battery charger (0.5mm pitch QFNs) and I used microscope when soldering them down. Rest of the components went easy (passives are in 0805). On hiccup I encountered was swaped (misplaced) labels of two resistors (R21 and R22), but I spotted it pretty quickly, since voltage converter was not working properly with these resistors swapped (they provide feedback voltage to the converter).

    Closeup on small QFNs
    Back of the PCB
    Front of PCB with LEDs turned on
    Front of PCB with LEDs turned on

    FIRMWARE

    After timer was assembled, I moved on to initial firmware development. I tested two toolchains/compilers: SDCC and ST Visual Develop (with Cosmic toolchain).

    As far as I can see, there's no straightforward way to use debugger with SDCC toolchain (I may be mistaken). STVD+Cosmic has debugging capability built-in the IDE, which was a big plus for me. Also libraries provided by ST (called SPL - Standard Peripheral Library) were better suited for Cosmic compiler.

    I created 'blinky' projects for both SDCC and STVD and after that decided, that I'll use STVD+Cosmic combo.

    So far I've implemented 'millis' timer (using Timer2) and LED driver (using SPI and DMA).

    Code is available on GitHub.

    MECHANICAL

    Case elements were 3D printed to see how they fit. The result is not bad, but I had to make a few changes in the design. Next week I'll probably print improved design.

  • PCB layout finished

    Luke08/20/2018 at 20:18 0 comments

    So today I finished layout of the PCB :) Together with components placement it took around 7 hours to finish. I had a small problem with ground plane - during routing I was not connecting GND pads of the components, so after creating GND plane pours on both layers I had to move some tracks around to create proper planes (also I added a few GND vias here and there).

    PCB with filled areas display off:

    PCB with filled areas display on:

    Next step is generating production files (gerber files) and sending it to manufacturing :)

  • Case design & components placement

    Luke08/15/2018 at 12:25 0 comments

    As mentioned in previous log entry, I had to export 3D PCB model (with all major components), so that initial case design can be created. To do that, I used kicad StepUp plugin for FreeCAD. Exported STEP file was then loaded into Autodesk Inventor and I could start designing the case elements.

    After a few hours of work, I had initial case design:

    During the process I made small changes to components placement on PCB (like moving a switch a bit, etc.).

    Now I could move on to PCB layout. I started with placement of all smaller components (like passives). The result is shown below (I'll take care of silkscreen later):

    Next step is routing all the tracks :)

  • Initial components placement

    Luke08/01/2018 at 21:13 0 comments

    So I spent a few hours on creating footprints and 3D models for buzzer, slide switch, push button and other minor components. I wanted to have STEP models associated with WRL files, so that full 3D model can be exported. The 3D model will then be imported into Inventor, so that I can design a nice enclosure for the whole project.

    When footprints were ready, I carried out initial components placement:

    3D models are also visible in KiCad:

    Next step is generating 3D model of the whole board (I use kicad StepUp plugin for FreeCAD - https://sourceforge.net/projects/kicadstepup/), which will be imported into Inventor. After that, I'll design initial enclosure and check if components placement is ok. When all main components placement is settled, I'll move on to PCB layout :)

  • MCP73833 NTC resistors calculations

    Luke07/01/2018 at 10:13 1 comment

    The MCP73833 cell charger has THERM input, which enables the chip to monitor the temperature of a battery:

    By choosing appropriate R_T1 and R_T2 values (depending on NTC thermistor parameters), the designer can adjust allowed operating temperatures (e.g. from 0C to 50C), which is described in the datasheet:

    So far, so good. But solving above equations for R_T1 and R_T2 requires calculating NTC resistance two times, then calculating quadratic equation parameters (A,B,C), then calculating R_T2 and finally calculating R_T1. It gets really annoying after second iteration (since you chose wrong thermistor R_0 and R_T1 is negative...):

    So I quickly created a spreadsheet document that calculates all that stuff automatically - just put in the thermistor parameters (R_0 and B) and T_cold and T_hot.

    Now choosing the right NTC and resistors should be easy :)

  • LED driver added, working on BOM

    Luke06/30/2018 at 09:58 0 comments

    Last time I mentioned, that I may add AS1122 LED driver to test it. In final version I would decide which metod I'd use to drive the LEDs: dedicated IC or PWM generated by the microcontroller.

    Right now the schematic looks like this:

    I started working on BOM by adding 'Link' fields to schematic components, so that generated BOM is automatically populated with links to distributor websites (I use Mouser and TME).

    Exported BOM (to CSV format) opened in Calc:

    All the BOM stuff is work in progress (not all fields are populated)!

  • Preliminary schematic

    Luke06/24/2018 at 12:46 0 comments

    Currently I've finished working on initial schematic:

    Now I will create AS1122 (LED driver) symbol and add it to the schematic. After that footprints will have to be assigned.

  • Components selection

    Luke06/23/2018 at 15:22 0 comments

    My first step was creating requirements document (you can see it in DETAILS section). After that was done, I moved to components selection stage. I treated this task as a engineering exercise and decided to keep the parts cost as low as possible (while maintaining required functionality).

    Microcontroller

    Some time ago I stumbled upon STM8 family, which can be viewed as AVR competitor. So far I've only used AVR and STM32 microcontrollers and I wanted to try something new. I did some research in terms of peripherals (I needed around 20 I/O pins, at least two ADC channels and two timers) and memory.

    Eventually I decided to go with STM8L151C2T6, which can be bought for $1.20 @100qty from Mouser. This MCU has 4kB of flash, 1kB of RAM and can run at 16MHz.

    Battery charger

    I want to charge the battery via USB port. The battery will probably have a capacity of around 500mAh. I looked for a linear charger that would automatically handle the charging process (CC-CV cycle, overtemperature protection etc.) with max current of around 500mA.

    I found that MCP73833 fits my needs and it costs around $0.70 @100qty, which is nice.

    Voltage regulator

    Maximum battery voltage exceeds allowed MCU input voltage (3.6V), so I had to use some form of voltage regulation. I decided to go with buck converter to step down battery voltage to around +3.0V. My main requirement is good efficiency at low currents (a few milliamperes) and TPS62260DDC has great efficiency curve. Also, it's not that expensive: $1.08 @100qty.

    LEDs driving

    I did a bit of research on LED drivers. The LED bar will consist of 10 LEDs. I've found one promising chip: AS1122, but the price is pretty high ($1.73 @100qty).

    One important note here: only one LED from LED bar has to be dimmed at certain moment (other LEDs are either on or off). Global brightness control (to accommodate to ambient light) of all LEDs can be done using one transistor. Individual LED control can be achieved by using software PWM and only PWMing the output of currently dimmed LED from LED bar.

    Currently I decided to control the LEDs simply using MCU pins and one NPN transistor to control the brightness (see schematic in next log), but now I think that I may add AS1122 to the schematic, just to test the chip and compare the results.

View all 8 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates