Point-to-Point Pomodoro

Today I tried laying out the pomodoro timer on a small breadboard I had lying around.In the end, I could fit everything on the board, so that was good news. There are two major drawbacks to this, however: firstly, as you may notice, there’s no power laid out here yet; and, secondly, I’m going to have to solder this point-to-point.

Components of the pomodoro circuit on a breadboard
The initial layout for my pomodoro timer. At least, this seemed like a decent way to have everything on a breadboard I had lying around. It looks reasonably functional, though the downside will be that I’ll have to do a point-to-point soldering, as there’s too little room to properly place the wires on the board.

As far as power is concerned, I’m planning to use a 3.3V coin battery, which I was hoping to mount somewhere on the back. However, given how tight everything is mounted, that may not be an option. I’ll pretty much be using every little bit of real estate there. Firstly, of course, for the leads of the components, but as they’re all placed so close to each other, I’ll have to do point-to-point soldering, I’m assuming right now. That will also imply I won’t have a surface left to glue a coin battery mount to. I may have to resort to leaving that just trailing on a side.

Either way, I’m looking forward to soldering these components on soon, now that I have a basic layout going.

Pomodoro Breadboard

Yesterday, I liberated the Atmega328p from the Arduino Uno, and installed it in the breadboard. I rewired the full thing to fit on the one board, changed the resistances for the LEDs around to 220Ohm (as I moved from the 9V to a 3V power source), and had to fiddle with the code a bit to get the ports correct. I’m pretty pleased with a fully working breadboard prototype. The next step is to solder it to some perfboard, and have a mobile prototype ready. Perhaps if I enjoy it enough, I’ll actually make some PCBs for this.

This photo shows all the components of the pomodoro timer on a breadboard, with a long ISP-6 cable in the middle leading off-screen.
The finished prototype on my breadboard. As I wired this up, I discovered that some of the ports on my schematic were off. Fortunately, now that I have an ISP in there (that wide cable in the middle there), I could just adjust the code slighlty to match the ports that I had on the schematic.

One thing that I might consider to add is a small switch near the buzzer to turn the audio off or on if needed.

This image shows the electrical schematic of the pomodoro timer.
I adjusted the schematic based on the redesign, and also cleaned it up a little more from the last iteration. The only thing I can see that would make it neater is to adjust that reset connection between the ISP and the ATmega328P so that the reset line is at the top, to clean up the resistor. However, I didn’t feel like editing up the schematic in KiCad, save it to a new library, and so on.

Pomodoro Timer r2

As I mentioned yesterday, I learned a little bit more about ISP, and so I learned not only how to run the Atmega328P without an external crystal timer, but also how to flash it on the fly. I’m pretty happy with this redesign right now, and don’t see it changing significantly. Possibly, another revision might replace the IC with a version of ATtiny, seeing as how eight ports are not used in this design. As far as the actual schematic is concerned, I’m pretty pleased with how orderly it came out, though I’m less pleased with how the ISP module connects to the Atmega328P: there are 11 crossing cables in there, due to the positioning of the AVR-ISP-6.

If I were to clean this up, I’d have to basically make a new symbol for the Atmega328p that would fit that general principle. PB0, PB3, PB4, PB5, and PC6 are better suited to be placed on the left side of the Atmega328p, considering they’re all set as inputs. That would make the whole image much cleaner as a result. I guess if I ever do end up making a fourth revision, I’ll clean that image up for a more final result.

The third revision of the Pomodoro timer, which is likely to be a final version for the time being.

Yesterday, I also managed to run my first succesful test of uploading an Arduino sketch using the USB programmer. I haven’t tried uploading directly through AVRDude just yet, because that would involve compiling my own code, which would be the next step. First, I wanted to see whether uploading itself would work. So, I hooked up my USB programmer to the Arduino Uno, and used the Arduino IDE to flash the Atmega328P via the programmer (for which it uses AVRDude in the background anyway). It went off without a hitch! I also tried setting the lfuse to 0xF2 to have it run on its internal clock, which results in the program running half as slow (as the internal clock is 8Mhz versus the 16Mhz external crystal). So, I did have to adjust some timers to have it run correctly again.

AVR ISP

I’m trying to learn a bit about in-system programming of microchips, and specifically some of the Atmel chips. I have an Arduino Uno lying around, on which I programmed a simple Pomodoro timer, as well as an ATtiny that I wanted to use to experiment more with.

That Pomodoro timer idea was a lot of fun to make, and taught me a bit about bit masking and so on, but I never got to putting it on some perf board, because that would either require getting a 16Mhz crystal in (something I’d just not gotten around to) or otherwise setting some fuses in the Atmega328P (something I had no idea how to do). Recently, I found this tutorial on Assembly programming microchips that seemed quite fun, and it require the purchase of an AVR programmer. Fortunately, you can pick one up for about €5 if you go off-brand, so I just got one. As luck would have it, that’s exactly what I need for both purposes.

The tutorial on Assembly I’m intending to follow is written for Windows, and so includes plenty of references to Atmel Studio. As is usual in these cases, Atmel Studio is not available on Linux, so I had to explore alternatives. After a lot of hits and misses (usually involving using an Arduino Uno as a programmer), I end up finding a YouTube channel where somebody made a helpful tutorial series on moving from using an Arduino to going as close to “bare metal” (i.e. using little software) as possible. So, not only do I learn I can use AVRDude on Linux to achieve my goal of following the Assembly tutorial, I also learn that I can flash my Atmega328P with this thing so that I can break that out of the Uno board and use it standalone. Score!

I look forward to being able to complete that Pomodoro project in its first iteration soon, and thereby picking up some relevant skills for the later tutorial as well.

Happy about a silly little thing

I’m trying to learn a little bit about microchip programming for fun, and bought an ATtiny and a USB programmer to follow along with a tutorial. Sadly, it seemed that I lacked a necessary plug to interface the two. A grab through my components and some sloppy soldering later, I have a little adapter that I’m happy enough with. Yay!

The soldering is a little sloppy, but it works! It was quite tricky, since the perf board I had was without copper islands, but we do what we can with what we have.

Quest for new headphones

So, a while back my old headphones, a decent pair of ATH-M50X broke. They’ve served me well for over seven or eight years or so, though they did need some work. I ended up replacing the earpads with some velour ones, as the regular ones ended up making my ears really uncomfortable. I also ran into the standard problem with ATH-M50Xs, which is the broken hinge for which I had to insert a paperclip to keep it going. And, as they all tend to do in the end, the headband started flaking off, so I had to replace that with a cover. So, now that these have broken, I have been looking around for a new pair.

One thing that’s rather important for me in headphones is easy of replacing each part. I used to buy Sennheiser headphones before I had my ATH-M50X, and invariably the cable would break, rendering the otherwise fine headphones useless. With the ATH-M50X, however, I could replace the cables twice over its lifespan, and it still worked fine, up until the actual right speaker died on me. So, my first requirement is for parts of the headphones to be replaceable, and most importantly the cable. Secondary to that would be having non-proprietary parts; one downside to the ATH-M50X is that the cable has a proprietary hinge, meaning that you heavily limit the cables you can buy.

Back when I bought my other headphones, they were pretty top-of-the-line as far as budget headphones went. Now, of course, we’re almost a decade further on, and the market has apparently moved on quite a bit as well. I’m very tempted by the AKG K702, a set of open headphones that get rather good reviews (which, incidentally, is much cheaper in the Netherlands). The advantage of open headphones, apparently, is that they have a much larger soundstage than closed headphones, resulting in much more authentic sound. The downside of this is sound bleed: because the headphones are open, you will hear more outside noises, and the outside will hear what you’re listening to as well. So, these are generally recommended for indoor use.

Before, I used headphones quite a lot while out and about, because I had a four-hour commute daily. Now that I have moved, my travel time to work is reduced to only a couple of minutes. The main use for headphones while traveling now would be for airplanes, for which open headphones are decidedly unsuitable. During COVID-19, this isn’t so much of a concern, but once this apocalypse is over, Tracy and I would like to visit her family in America again on a regular basis, so it’s a serious consideration to make.

It looks like the AKG K371s are a decent compromise to make, or possibly a pair of AKG K271 for a similar form factor to the K702 (which I do appreciate quite a lot). I’m struggling with the question whether I should sacrifice the audio quality of an open-back set of headphones for a situation which, frankly, probably isn’t happening often anymore. Before COVID-19, I would likely travel by plane two or three times per year which, added to the several hours of commute per day, did necessitate the closed-back headphones. Now, though, I may just settle for a really good pair of headphones for around the apartment, and perhaps a much cheaper set for once we start traveling again.

Incidentally, right now, I’m using a set of Bose QuietComfort 35 II and they are just awful headphones. They are not comfortable to wear for longer periods at all, and the sound quality is surprisingly low. It’s overly bassy, and sounds quite boxy, with an extremely narrow soundstage (then again, what else to expect from Bluetooth headphones?). When Tracy tried them on, she described the experience as claustrophobic. The one thing that these headphones do much better than any other set I have ever used is active noise cancelling – without a doubt they are the king in that respect. If they weren’t so expensive, I would buy a pair of these just for plane travel.

Excel is not a database

At work, I constantly see people use Excel for things other than spreadsheets. In fact, it’s main use at my job is as a database program; there’s lists of students, lists of grades, group lists, staff addresses, and even tables of standard e-mail responses. One annual task of the committee I chair is that we formally appoint staff members as examiners (giving them the legal right to issue grades to students), and—I kid you not—the standard format for that is a Word .docx file. A list in Word of over 150 colleagues, listing a limited and standardized set of data.

This habit, in my opinion, is a typical example of the saying “to a person with a hammer, every problem looks like a nail.” In this case, people know Excel, and have used it before, so that’s what they use to keep these lists. Now, in the previous academies I’ve worked for, this approach was serviceable. Don’t get me wrong: you can absolutely make Excel do this for you. You can adjust formats, and with a little coding or clever use of Excel validation and HLOOKUP/VLOOKUP functions you can get quite a bit done. However, I see many of my colleagues who have limited knowledge of Excel (and why should they? Often, they don’t need anything beyond a table), so without using this workarounds to have Excel function as a database, I frequently see lots of copy-pasting, manual re-entry of data, or manual formatting to reach the desired result. I can’t tell you how often I’ve seen people copy pasting Excel data from one workbook to another, so that they can manually reformat the data to fit something that they wanted to print.

I myself have worked like this as well. When I just started working as an English lecturer during my MA degree, I saw that my fellow lecturers were all sending grades in a different way to the coordinator. One was making an Excel list using period a comma for the decimal marker (the correct way in Dutch number formatting), while others used commas periods. Yet another just mailed a little list to the coordinator, based on the grades they’d scribbled down on a piece of paper. You can imagine how many mistakes would be made transcribing one to the other, not to mention the work the coordinator had manually reformatting this. So, I made a simple spreadsheet that everybody could access, which had some basic data validation to ensure everybody filled in their grades in the same way. It also solved another issue, because it required everybody to fill in the points students scored, so we weren’t having the usual issue where people rounded grades differently, or changed the way they applied guess corrections for multiple choice, and so on.

Swiftly, this spreadsheet started being used for more things. Random colors started appearing as people marked status changes for students, and comments would start appearing after columns. Also, the spreadsheat kept breaking—colleagues would want to manually adjust this or that, because “it wasn’t calculating the average correctly”, or they would insert columns or new students (despite the groups being generated from those students registered correctly). In short, I learned through experience what people trained in software development already know: your design works until its first encounter with a user. So, I learned about locking cells and password protecting sheets. The last important lesson I learned from that sheet, was that I couldn’t assume people were willing to learn. I’d set it up with the intention that this was a relatively simple sheet, that with around thirty minutes of looking it through could be used and maintained by anybody; after all, it was just a little Excel sheet—not so difficult, right? That’s when I learned that making the sheet had made me into the admin of it, year after year. My colleagues weren’t particularly interested in learning how to better use the programs they were using, because they could already get the output they needed from it. Plus, the urgent matters of the day were so distracting, that they didn’t feel like they could spend the time to learn a new skill, despite that new skill potentially saving them hours and hours down the line.

Now, in some of my old positions, using Excel in ways it was not designed to be used didn’t cause that many issues (nor does it do to this day). A person typing up a quick list in Excel still reaches their end goal. An administrative support worker copy-pasting things from one list to another to edit something doesn’t spend too much time if the whole program has only around 500 students. My new academy, however, has over 3000 students, and when I review the Excel files that people use as databases, it’s just slow. Scrolling down it takes time, and with that number of students, it’s also not handy trying to filter out certain things.

So, fortunately, being the Chair of my committee (and a stubborn one at that), I’m moving us over to an actual database for registration. Much like Excel, when I was a starting lecturer, I don’t actually know how to use Access right now. To me, that’s a good thing—I just love learning, and this is a good opportunity to learn a new thing that will have a practical and positive effect on work. I’m also excited to implement this change, and to help my colleagues save time. I’m convinced this will make processes move more quickly, and I can’t wait to measure the improvement.

Linux Milestone?

I feel like I’ve passed some kind of Linux milestone today. I was reading up on i3wm configurations, and the unique situation that I have where I want to share a single configuration between a desktop environment with two screens, and a laptop which may be plugged into an external screen. I’ve been meaning to further configure this situation, and make it a little more flexible. I managed to get that working in an XMonad install, since you program that in Haskell and so have some more flexibility than i3wm’s configuration gives you, but doing the same in i3wm is still a little tricky.

The key difference is that i3wm is configured via its own configuration syntax. That makes it easier to configure for somebody who isn’t familiar or comfortable with programming, so it becomes more accessible. The natural trade-off, however, is that it becomes less flexible in what it can do for the user. XMonad, however, essentially is just a framework for a window manager, and you, the user, have to code everything you want in Haskell. Great for customization, but not so good for accessibility for new users. This is also the main reason I didn’t go far in it, because I also don’t know how to program in Haskell!

In any case, in XMonad I managed to get a simple script working that scanned what my setup was—how many monitors, what resolutions, and so on—and adjusted window sizes based on that. In i3wm, however, that information is loaded up when i3wm starts, and so it’s not a thing you can easily do on the fly. So, I’m searching on DuckDuckGo to see if anybody’s solved this problem (after all, why reinvent the wheel here?). I found a post where somebody hacked together a Python 3 script to edit his configurations (sound familiar?) and I had An Opinion. Before, I tended to read and absorb, assuming that the poster would have a good idea. Now, though, I realized I had solved the problem in a way that I felt was more efficient.

To me, that’s always been a good sign of learning something: realizing that you’ve solved something; recognising a moment where you can help somebody else make things better. I’ve never considered myself a very technical person (a consequence, I believe, of knowing people who work in IT professions, and comparing myself to what they know and can do), but this was the first time I felt like an amateur versus a person just hoping not to screw up their install whenever they do something.

Linux Upskill Challenge

A week ago, I started with something called the Linux Upskill Challenge. It’s a monthly set of lessons posted by /u/snori74 (as far as I am aware, not the Icelandic poet come back to life with a passion for Linux). The set of lessons are to teach you about being the administration of a Linux server, with practical challenges. You start off by getting a server online (as suggested by /u/snori74, I chose a $5 server package), and weekday-by-weekday, there are short lessons on how commandline administration of the server.

I figure that, by now, I can call myself an average Linux user: I know enough to solve quite a few problems by myself and I know enough to search for the right solutions to my issues; however, I’m also clearly not to the level of the Linux users who will program their own widget to create an alternative to this or that program that they have an issue with. This program has really worked for me so far. I know enough to easily progress through the first couple of lessons, and yet each had really new information for me in the extensions.

I can really recommend it to anyone that wants to learn a little more about Linux.

Stoneshard

I recently purchased Stoneshard over at GoG, and I have been thoroughly enjoying it. It’s an isometric RPG game that reminds me of Rogue, Nethack, and more modern interpretations like Dungeons of Dredmor. In case you’re not familiar, these type of games have you explore an enviroment (usually a dungeon) in a turn-based way. Every action—be it moving, inventory management, healing, or so on—is a single turn, and you alternate turns with the world around you. You do an action, everything else in the world takes an action, then it’s your turn again, and so on. Along the way, your character gains experience from killing enemies, which allows you to level up its skills and abilities, so you can deal with more things.

Stoneshard intends to be a harsh game in the genre. In many games, your character will be heroic; in some way or another, the protagonist is more powerful than anything around it, and can deal with much more than a regular human. Stoneshard very much goes against the grain and intends to feature realism in the sense that your character is about as powerful as everything around you, and your character suffers greatly from injuries, status effects, and hunger and thirst. The interaction of all these mechanics mean that you spend time managing and balancing many statistics. Your character is hurt, so you have to bandage the wound and splint the leg. Then, to deal with the pain your character is experiencing (giving you negative effects to your stats), you’ll have to use pain relieving methods (such as alcohols). That will increase your inebriation, however. You can see where I’m going: it’s constantly a balancing of effects.

More than other games I’ve played so far, where healing just involves downing a potion and moving it, recovery management seems to be at the forefront of my early experience with the game. Any fight with an opponent so far is a major fight. A single wolf is deadly; a pack of wolves is sure to kill my character. I can deal with a bandit, but I should heal after; if I run into two bandits, I should probably withdraw to town after. In each of these encounters, the chance of death is quite real.

That brings me to the next design choice of the game, which is quite controversial if you look at reviews: the save system. You can only save the game while sleeping at the inn (perhaps in other places, but I haven’t discovered that yet). This leads many people to complain that the save system is “broken”. It’s commonplace nowadays that games have quicksaves and autosaves, and you can basically exit the game at any time and pick up where you left off later. Stoneshard goes against the grain here. If you go out of town, you commit to an adventure that may last quite a while. So far, I’ve stuck close to town, and that’s kept me out half an hour to an hour. I’ve also died every time I’ve went out, because I haven’t learned the game well so far. Often, I can see in retrospect that it’s my poor choices that ended in my character’s death. I can see, however, that if you haven’t bought in to that risk, that it can be frustrating. For me, however, it brings an enjoyable tension to the game. The stakes are high whenever I venture out, and there’s no quick F5-F8 to recover from my mistakes.

The natural effect of this to my style of gameplay is that I also play the game in spurts. I go out and adventure, and either I die and quit, or return and save and quit. That suits my life fine, so far. I don’t feel comfortable playing for hours on end anymore, and this game seems to fit that. It’s like Darkest Dungeon in that respect. A game that I play in brief spurts, and that I would imagine frustrate me, but somehow, perhaps due to its transparency regarding the difficulty level, doesn’t seem to cause frustration. Rather, it encourages me to learn the game well.