Pomodoro r2

I didn’t quite feel settled with my current Pomodoro project. I’d worked up the prototype, and I’m happy it works (despite it being sloppy), but I also think there were several points for improvement left. Or, at the very least, it just didn’t feel done. I figure that the minimal specification to call it a working prototype is to have a battery included, so that it is fully self-sufficient, rather than it is now (which requires either hooking up a battery ad-hoc, or connecting it to USB via the ISP programmer). As I was brainstorming what I wanted to do with it, I came up with the following list:

  • Include a 3v coin cell battery; and
  • Rewrite the program to run off a type of ATtiny; and
  • Rework the program to use timer interrupts.

Now, I thought before of changing the μC around, but at the time, I wasn’t really sure of the what and how. Thankfully, thanks to some helpful YouTube videos, now I do, and it seems reasonable to rework the schematic to not waste the full potential of an ATMega328p on a program which needs about half of the pins. A major thing I learned from the Assembly tutorial is that you can drastically reduce power consumption by working with timer interrupts rather than using a sleep function. Considering I want the project to become more portable, getting the most out of the 3V cell seems like a great idea.

As I was thinking of those, I thought of a few other options that might be interesting. I separated these, however, because the ones in the first list are what I’d consider necessary to call the project done, these would be interesting additional features to add:

  • Change the LEDs to a single LCD screen; and
  • Add a volume control for the beeper; and
  • Add a brightness control for the lights.

The first would be cool, though I’m not sure if it will fit the project. The major issue with it is that a very cursory glance of LCD screens seems to imply that they need a 5V power source, and my intention is to keep the project small, light, and to get as much as I can out of the LEDs. While I want to get an LCD screen and play around to learn about I2C, that may be a thing for a later project.

The other two, however, shouldn’t be too difficult. The beeper I have on there is quite loud, which is good, but I can imagine there’s occasions where I’d want a more subtle notification (plus, my wife will be grateful for less noise too). I could either just install a slide switch to turn it off or on, or perhaps I can put in a potentiometer for more fine-tuned control. The latter will take some experimentation, which will be fun in and of itself.

The brightness control is something that I’d also want to experiment with. Clearly, having a potentiometer for each individual LED would be needlessly complex, let alone that it would result in inconsistent brightness of LEDs. Rather, I would want to handle that directly from the μC. Now, I’ve been reading a bit about PWM signals, and that would seem to fit the bill. Given that my project uses 11 pins (9 LEDs, a buzzer, and a button), adding power and ground, means I have to use a DIP-14 package; i.e. there would be one pin open. What I could explore is if I can use a potentiometer there to control the μC PWM duty cycle. Not only would that mean I can control the brightness, but unlike using resistors to do so, this method would actually also save power and match my original goal of having a low-powered portable device.

I know nothing about PWM aside from the broad concept, so that would be an interesting thing to learn about. That would mean that revising this project would teach me about both timer interrupts and PWM signals – score! On top of that, I do enjoy how that would make the control of the device consistent: a single push button to control pauses and resets, and two potentiometers to control the amplitude of the output (whether soundwaves or lightwaves).

If I only manage to add the battery and have it at that, I think I’ll leave it as a perfboard prototype. If I do the other points as well, I think I’ll see about designing it as a PCB, and having it manufactured somewhere to get a final product. That’d be bonus points for practicing PCB design and soldering!

Leave a Reply

Your email address will not be published.