Show HN:用ESP32和电子墨水屏制作的物理番茄钟
Show HN: Physical Pomodoro Timer with ESP32 and e-paper screen

原始链接: https://github.com/Rukenshia/pomodoro

这个项目详细介绍了一个基于ESP32的定制番茄钟计时器的制作过程,其设计重点是简洁和最大限度地减少干扰。它使用Waveshare 4.26英寸电子墨水屏(ePaper display),因为它没有背光且分辨率良好;使用旋转拨盘进行直观的输入;并使用单个WS2812 LED提供视觉提示。目标是为朋友制作一个物理设备,帮助他们进行时间管理,在不造成过度干扰的情况下提高专注力。 该计时器具有一个用于设置时间和导航菜单的旋转拨盘,一个在环境光下依然易读的显示屏,以及一个用于状态变化的LED指示灯。3D打印的机壳设计用于容纳所有组件,并通过橡胶脚和配重解决了轻微的设计挑战。软件使用Arduino框架和GxEPD2库用C++编写,管理计时器功能,包括工作间隔、休息时间和可自定义设置。

Hacker News 最新 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Show HN:使用 ESP32 和电子纸屏幕的物理番茄钟计时器 (github.com/rukenshia) 10 分,作者 rukenshia,1 小时前 | 隐藏 | 过去 | 收藏 | 1 评论 johntopia 1 分钟前 [–] 很棒的项目! 回复 加入我们,参加 6 月 16-17 日在旧金山举办的 AI 初创企业学校! 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系我们 搜索:

原文

the finished product from the front

This is the repository for an ESP32 based pomodoro timer. It uses an ePaper display and a rotary dial for input. The code in this repository will not be ready-to-use, as some assets and fonts have been removed. However, if you really want to you should be able to adapt the code to your needs.

  • ESP32 (I used an AZDelivery ESP32 NodeMCU)
  • WaveShare 4.26inch e-Paper display HAT, 800x480 (link)
  • KY-040 rotary encoder with button
  • A single WS2812 LED (could be replaced with a simple RGB LED)A
  • A USB-C connector (like this one)
  • 3d printed case (onshape file)
  • Some resistors and 0.1uF capacitors

I love trying out different productivity techniques - some say that the quest to optimize your productivity is the ultimate procrastination method, so maybe that is what drove me to this project. I also have a habit of committing time (around a month of work outside my normal job) once a year to a project that benefits someone else. Last year, I bought a 3D printer (BambuLab X1C) and wanted to put it to good use. I have previously finished an apprenticeship as an electronics engineer before pivoting to software engineering, so I also wanted to come back to my roots and build something physical. My friend struggles with time management throughout the day sometimes - lots of different tasks to organize, and little focus. So I thought to myself: Why not make them a pomodoro timer? So, I set out with a few goals:

  • It should be a physical device
  • It should be fun
  • It should be intuitive to use

There are some cool projects out there (arguably much cooler than this, for example the Focus Dial by Salim Benbouziyane), but I wanted to build something from scratch. I also never built something with an ePaper display and thought it might be a good fit for something that is mostly idling and doesn't require a backlight.

This was my second dive back into building things with microcontrollers in a long time. I knew ESP32 well enough to feel comfortable diving back in, so that was the main choice here. I did some research before to see what kinds of displays would be supported.

I needed some sort of display, or at least I wanted some sort of display. One of the main motivations for this project was that it should be out of your way - until it is time to finish your current focus and move on. For me, this meant that I wanted a display without any backlight.

The display should also be large enough that you can put the whole device somewhere on your desk and still be able to read it. After ordering and playing around with a few WaveShare ePaper displays, I settled on the 4.26" variant for multiple reasons:

  • Great resolution (which seems to be really hard to find for "hobbyist" displays)
  • The size felt right
  • The display supports partial refreshes (0.3s, no distracting "black and white flashes" while refreshing)

Initially, I really wanted to use a black/white/red display and found one that I liked, but the refresh time was a whopping 16 seconds with no support for partial refreshes which was a dealbreaker for me.

The final bonus feature: it won't work at night. If your desk is not bright enough, you won't be able to read the display. This is a feature, not a bug. Too dark outside? Stop working already!

From the start, I knew that I wanted some sort of dial as an input - it made the most sense to me. This came at the cost of some complexity when designing the menus, and you really need to make sure that you debounce the input correctly. I also added .1uF capacitors to the CLK and DT pins to help with smoothing out the signal.

In the first few iterations, there was no plan for an LED. My genius plan of having a display without backlight came at a cost: it could be too subtle when your current focus time ended. I experimented with a few different ideas:

  • A buzzer: this would just make you jump. A truly horrible experience
  • Speakers: I don't know why, but speakers felt hard. So much noise and whining with the setup I tried, but I will blame this on a skill issue
  • LED: I had some WS2812 LEDs lying around and thought they might be a good fit. You can animate them with the NeoPixel library, and they are really easy to use. The additional benefit of not needing to commit many more output pins was also a big plus

LED shroud screenshot of the CAD model

The LED ended up working great, allowing me to display different states. It might be subtle, but I also added a little shroud to the case and added a diffusion layer in front of the LED to make it look nicer.

The case comes in two parts: the base and a lid. One unfortunate design choice I made is that the display frame is printed as one piece as part of the base, so the top edge tends to warp a little bit during printing. Since CAD (or product design) isn't my strongest suit, there will certainly be better choices to design this for a better final look.

One thing that I wished I learned earlier is that it might not have been the best idea to put the dial in the front: because the print and electronics are so lightweight, pressing the switch on the dial will tend to just slide the whole device back. Luckily, I could solve this by adding some rubber feet and weights (the ones usually used to balance tires) to the bottom of the case. This worked out great, and I am happy with how it turned out.

The software is written in C++ and uses the Arduino framework. I used PlatformIO to manage the project (at least that is what seemed to be a popular choice, but I am not so sure about that anymore). This project relies heavily on the GxEPD2 library for the display. I won't lie, the code in this repository is a bit of a mess - I had to get things done in time, which led to quite a bit of copy and pasting and not revisiting earlier parts of the code. Some parts were generated by AI (Claude, for the most part) to help me finish the project in the deadline I set myself.

a random fact displayed on the screen

Since this was a project for my friend, I also wanted to include some easter eggs and fun. You would think that adding some random facts while you are supposed to be focused would be a bad idea, but I think it is a fun little addition.

When the device starts up, you can either change some settings or go into preset selection mode. From there, you can choose one of three presets:

preset selection

The timer will then start and let you know once the time is up (by flashing the LED and displaying a message on the screen). You can keep working (not recommended, but necessary if you want to finish something) and then start the break.

timer running

During the pause, you can view some statistics. Every few iterations (4 by default), your pause will be longer to give you some time to recover.

pause statistics

ePaper Display (GxEPD2_426_GDEQ0426T82, WaveShare 4.26" b/w)

PIN #
BUSY 4
RST 16
DC 17
CS 5
CLK 18
DIN 23
联系我们 contact @ memedata.com