The More You Make, the More You End Up Making

Creativity has always been interesting to me, because I don’t see myself as a creative person at all. In building games, I always tended towards making the most efficient rather than the most beautiful structures. Professionally, my greatest strength is reducing the complexity of problems to more solveable issues and helping to guide others to move towards solving them. Artistically, I’ve never been able to do much at all, though I’ve tried calligraphy, playing the violin, drawing, and so on. Language seems to be my best creative skill, though not for fiction but rather for communicating clearly. All in all, I’d describe myself as quite uncreative.

One of my main issues would always be the difficulty of thinking of new ideas out of nowhere. It’s so impressive to me how somebody could look at a blank canvas and just decide what to do there. However, now with electronics, it took me just the one big project to learn the basics of electronics, and I’m starting to get more ideas. I’d run into tiny inconveniences and thought: surely, I can spend way more time solving this miniscule issue than I’d gain by just working through it? And so projects were born. Currently, I have the following ideas clunking around, with no specific timeline for when I’ll actually be working on them:

Hamstercage Lights

My current main project is to install RGB lights in all three levels of our hamstercage build. It’d both simulate a circadian rhythm for whenever we get our new hamster, and would have a manual override for when we need light. My main posts on electronics are all about this, so there’s not much new to report there.

Countdown Timer

This was inspired by the Pomodoro timer, as it’s somewhat related but for a completely different purpose. The Pomodoro timer just counts down in small half-hourish increments, to organize working time and to help remind me to take regular breaks. The Countdown Timer was born because there’d be several moments where Tracy and I are working towards a larger goal with a set deadline, such as when we originally moved over here; conversely, there’s also smaller deadlines, like deciding how much time we have until our groceries get delivered. Again, why use just a mobile phone timer when you can massively overengineer a large LED display or 7-Seg display and program it to display days, hours, minutes, and seconds?

Binary, Hexadecimal, Decimal Converter

While I was programming the Pomodoro Timer in C rather than Arduino, I started using binary and hexadecimal numbers more often to directly address memory. In particular, I’d want to set a whole register to specific bits in one go, and using hexadecimal just seems cleaner to me for some reason. What I’d end up doing is going through a datasheet, checking all the right pins for an 8-bit register, and then using a converter online to figure out what the hexademical is for that binary number. Why accept anybody else’s very convenient solution to a self-created problem when I can make it entirely more complex by spending more time? I could just make a small device that shows the same number in decimal, binary, and hexadecimal, and have several knobs or buttons so that I could change each number and the others would automatically change with it.

Bonus: Taglines For the Blog

As I was writing this, I just kept coming up with additional taglines for the blog (huh, additional task: figure out if I can have rotating taglines). Here’s a selection of my favorites:

  • Answering questions nobody asked;
  • Solving problems I created myself;
  • Solving problems nobody has;
  • Creating problems, then solving them by creating two new problems;
  • Breaking things by fixing them;
  • Fixing things by breaking them;
  • Finding out things nobody cares about;
  • Championing pointless causes;
  • Finding a problem to every solution;
  • Putting the “me” in “meaningless”.

Links on the Blog

WordPress can be somewhat obtuse at times. Or, at the least, its interface is opaque, to me. All I’m trying to do is to add a link to the right-hand menu to my GitHub page, so I can store project files on there without having to do that directly on the blog. If I were to do it on the blog, I’d have to edit some files to allow multiple types of uploads to the blog, including C-code. Considering I don’t fully know what kind of weaknesses that opens up, I’d much rather have GitHub be a place where I make these things public rather than on this server. However, despite clicking back and forth through the settings, I haven’t yet found a place to just easily add a link to the sidebar. Well, more searching online it is!

Learning About Flux

I’ve read that flux is a useful thing to use when soldering, but I never really knew what it does or what the real uses were. I was aware that it helps solder stick, and that the usual soldering tin I used contained flux, but I just wasn’t sure exactly what it was or when to use additional Flux. The advice I read most often was when you try to solder an SMD chip, flux is really handy to drag solder pins. However, that just tells me when to use it, but not what it does. However, I saw a simple video that really drove the point home to me. It simply shows examples of soldering with and without flux, and changes some variables around so you can directly see the effect. Now that’s some educational material!

Fraud Convention

Yesterday, I attended a convention on fraud in higher education (digitally, of course, thanks to COVID-19), and it was a fascinating experience. Two of the four speakers approach fraud from a legal perspective, discussing jurisprudence, recent developments and, of course, fraud in online digital assessment. They were very well-versed in the topics, and fielded a lot of questions with skill and ease. It’s always a joy to see somebody who knows what they’re talking about do their job well.

On top of that, we got so much information on multiple types of challenges that we’re facing at work. Particularly the past year of online assessment has proven to complicate matters quite rapidly. Digital assessment was never applied this widely, let alone digital assessment at a distance. As a result, we quite suddenly faced a host of new challenges, such as faulty internet connections invalidating an assessment (what do you do about that? What measures can you take?) or strong suspicions of fraud without evidence (Is that sound in the background somebody else reading a book, or the student checking a textbook during an assessment?).

I do think that the digital format allowed me to get out of my shell a little easier than normal. In the conventions I’ve been to so far, you’d of course have to speak up in a room of strangers to ask a question, whereas here it was just as simple as typing a comment in a chatbox. I could have even adopted some semi-anonymity, as I could fill in my own username to ask questions (though I just used my own name in any case). Certainly an encouraging experience that should remind me to participate more actively in future face-to-face conventions.

Housing Challenges

Tracy and I have been looking into buying a house, and boy is it a tricky proposition. On the one hand, it shouldn’t be that hard of a deal: I have a permanent contract, a good salary, and a solid record of paying rent for over a decade. However, there’s also a huge snag: I also have a massive student debt. When I started studying, the rules were that student debt would not be factored into considerations regarding buying a house. These days, however, those rules have changed, and they’re crippling us.

Without going too much into detail, what we did was figure out how high a mortgage we could cover if we payed the same amount we currently do into rent into a mortage instead. As it turns out, that was a decent chunk of money that could get us into quite an acceptable home. In fact, we’d found some homes that we’d like to explore (and one that we absolutely fell in love with) and for those, we’d even be paying less in mortgage than we would do in rent. On top of that, buying a first house comes with all sorts of advantages, such as municipal subsidies to make it more sustainable, and tax breaks based on your mortage interest rates, to name two. So, we figured, all of this is great – we can totally afford buying a house.

The banks, however, have a different idea. Despite us already paying the effective mortage (in fact, our net rent is higher than the gross mortgage!), the banks, in short, argue that we can’t carry that payment. The problem is, as I mentioned, my massive student debt. Banks are required to factor that into the mortgage, and to deduct a percentage of the student debt from the maximum mortgage. So, despite us demonstrably carrying this financial load, as well as the fact that we’d in fact be living cheaper with the mortgage than without, according to the rules, this is irrelevant. We’ve spoken to a mortgage advisor, and he as well basically said it’s a case of it making no sense but they have to follow those rules.

Now, to me, this already seems somewhat off. It gets even more absurd, however. You see, if I had decided to buy a house right after I graduated, this wouldn’t have been a problem. In the Netherlands, you only start paying off your student debt a year after graduation. Since I wouldn’t have been paying off my student debt that first year, they wouldn’t have to factor it. So, despite the situation being functionally and practically the same, it wouldn’t have mattered. However, who on earth would buy a house right after graduation? At that point, no company here will have given you a permanent contract (the standard usually is two fixed-term contracts before issuing a permanent contract for first jobs).

Moreover, the rules were changed during my time as a student, and again after my graduation. So, again, had I bought a house earlier, I wouldn’t have had any of these issues. However, at that time, I was still being bounced between fixed-term contracts and payroll constructions. I didn’t actually get a permanent contract until 2018, despite working in the same program since 2012. Still, the fun doesn’t end there!

The Netherlands actually had a pretty lenient student debt program at my time, still. Not as lenient as the generation before me, but better than what came after. The interest rate on my student debt is incredibly low (and I think at the moment it’s actually 0%). On top of that, after fifteen years of paying as much as I can each month, the entire debt is forgiven. I have six years and eight months left on that, with a debt that’s so high that I almost couldn’t pay it off. I mean, sure, if Tracy and I moved into a shoebox, ate rice and beans daily, I got a second job, and so on, I could chip away at it and have it paid off it, say, a little over six years. See what I’m getting at? At this point, the system is encouraging me, rather, to save up my money so I could buy a house when my student debt is done. Surely, that’s completely wrong? Surely, the system should be set up to encourage me to buy a house? That would mean that a highly-educated citizen settles down in the country that paid for his education, and contributes more to the economy by owning a house. Let alone that owning a house will benefit the economy by the time I retire, because my costs will be far lower, leaving me more financially stable and less dependent on government money.

What is most likely for us right now is to see if we can wrangle a semi-decent place to live with what mortgage we could get. However, the large problem we have is that most places in the Netherlands are multi-story, which is difficult for Tracy. With the mortgage we can get, it’ll also be a small house, with most of the ones we’ve seen in our range having tight, narrow stairwells. So, again, we’re almost encouraged to not buy through this emergent property of the system.

I’d be lying if I said it hadn’t gotten us down. Particularly given the amazing house that we’d found for the full mortgage that we can’t get. It was all ground floor. Close to my work yet in a smaller town to suit Tracy’s needs. It had a large garden, allowing us to save on money by growing crops. It pretty much suited us exactly. But unless the owners decide to sell the house for about 75% of its current asking price, or some mysterious distant relative leaves us enough to pay off a huge student debt, the boat’s sailed on that one.

So, for now, we’re scouring housing sites for that diamond in the rough. That tiny little house that’s just at the right distance away from work to be affordable. That little place that has enough promise to have us survive there for at least 7 years, at which point we can sell it for a good house. Or, perhaps that one mystery house, that magic little spot that’s good enough to be this cheap, yet offers enough to make us want to live there.

Either way, tear down capitalism and stomp on its ashes.

Testing Out RGB Manual Control

I’ve been thinking about how to control the hamstercage light project, and what is really needed. My first idea was to see if I could control the project via WiFi, perhaps by using an app (via Blynk, likely). However, seeing as Blynk uses a freemium model, I felt reticent to go ahead with it. After all, what if Blynk changes its terms of service? What if what I need takes a monthly payment? What if adding a second user isn’t possible? I don’t like trading ownership for convenience, so I’ve decided to abandon that idea. That did mean I had to thoroughly consider alternative controls.

As I’d considered before, I quickly settled on manual controls. After all, the idea is to automate the hamstercage lights nearly all of the time, with exceptions for when we want to see more clearly into the cage (for cleaning, or finding the hamster). Clearly, we’d be next to the hamstercage when we’d want to have direct control of the lights, ergo having manual controls makes the most sense. Doing a quick read online made me conclude that the usual means of controlling RGB leds manually is using potentiometers. Fortunately, I had a few ones lying around, so I quickly wired something up to test:

Figure 1: The breadboard test of controlling RGB lights with potentiometers

I’m breaking a bit with my usual color conventions here, as I’m using black as ground and orange as 3.3V. The WS2812B take 5V but I figured this would work well for the time being. You may notice that I also don’t have a resistor between the powerline and the WS2812B LEDs right now; that’s firstly because the setup wasn’t working when I started, so I reduced components to see when it would work, and secondly because the 3.3V certainly wouldn’t exceed it’s Vmax of 5.5V in any case.

The ESP32 has a really nice number of ADC pins (which I’ve learned stands for Analogue to Digital Convertor), so I had a bevy of choice to connect the potentiometer to. Essentially, the ESP32 compares the voltage from the middle pin of a potentiometer to 3.3V, and then outputs a value between 0 (for 0V) and 4095 (for 3.3V). Since the WS2812B takes a value between o and 255, it’s a simple case of dividing the value from the ADC pin by 4096/256=16 (The off-by-one programming mistake isn’t catching me here!). That gives me three 8-bit values to put into the RGB LED.

After some uploading problems (I had not connected the ground pin, which apparently was a problem for uploading to the chip), I had a working prototype. This setup managed to control the color decently, though I didn’t seem to get as much color variation as the FastLED library demo gave me. Moreover, the results were a little inconsistent. The cause of both issues would be the potentiometers. Firstly, the values aren’t precise, which of course the FastLED library demo does have, seeing as the values are specified in code rather than by analogue input devices. So, when I’m turning a potentiometer, the numbers go up in rather large jumps. One challenge to overcome, then, is to get a better resolution (for lack of a better word). The second problem I ran in to was that the color seemed to flicker a little, which again I attribute to the potentiometers. The potentiometers I’m using are not quite a comfortable fit in the breadboard, and I suspect that the connection they make is shoddy. I noticed that there was quite some wobble to them, and if I’d touch them, the hue would change.

All in all, then, I’d call this quite a succesful test. I have a proof of concept, in that I know I can control the colors of the LED strip using potentiometers. The follow-up is to get better control. The next test I want to do, however, is to work on the WiFi-side of things, and test out getting the current time from an NTP server. Once I’ve tested that, I’ve established all the ground principles I need to create the hamstercage light project, and I know I can start working on refining all the individual elements of it.

First Experiments with RGB and ESP32

The past few days, I’ve been experimenting with both RGB LEDs and ESP32. I’ve never worked with either before, so I wanted to get some experience with the basic functions before I dove into the more complex task of building the hamstercage lighting.

My first experiment was trying to get the RGB LEDs working. I have a strip of 60 WS2812 RGB LEDs, which are one of the apparently two common types of RGBs. The WS2812 distinguish themselves by having some manner of IC included in the strip, so that there’s a single data line in along with the power and ground, making coding quite easy. The other most common RGB strip also includes a clock signal, so that still seems fairly elementary. To get this working, I hooked it up to my Arduino Uno clone, added the FastLED library, and loaded up the first couple of examples. Everything pretty much worked without a hitch, which was great. About the most complex part was that the examples mostly used pre-defined colors (::red, for example) whereas I potentially want to use a whole host of RGB values. However, one quick online search and that was already solved.

ESP32, however, was a little more tricky than that. My first very practical problem is that the breakout board is just slightly too big for my breadboard. I can only just about fit it on one, leaving a single row of headers for additional pins. Nevertheless, that’s all we need to test the single RGB strip. The bigger issue was trying to figure out the pin-outs of this board. There seemed to be a number of potential pinouts provided online, and they just didn’t seem to work for me. In fact, nothing worked until I switched to a different example – I guess I must have messed something up in the example, causing all my other issues! Once I fixed that, the pin-out diagrams seemed to make sense again, so that was one hurdle taken.

However, somewhere in this testing, I seemed to have messed up one of my ESP32-WROOMs. I’m not too sure what’s going on, but it’s no longer registering on the USB port. However, I’d bought three of the chips (potentially for three separate parts of the cage, though I appear to not need that), so a secondary one took its place. I’m noticing that the problematic ESP32 has a rapidly blinking LED, which may be a hint to its condition. If I press the boot and enable buttons at the same time, I can upload a program again, but as soon as it’s reset, the chip seems stuck again and the LED is back to blinking rapidly. It’s possible that while I was probing the board with my multimeter, I may have shorted something, I’m assuming. However, for now this will remain a mystery.

Having tried out the basics of RGB LEDs and the ESP32, and being able to light the LED strip with any RGB value, I have two of the three fundementals ready to work on my hamster cage project. The last one is a way to control the lights. The most basic option is to provide some physical controls at the cage. This is quite sensible, as there’s no need to control the lights unless we’re at the cage doing something. The second option is to use Blynk. Blynk is some manner of visual app development program that has interface possibilities with ESP32 chips built-in. It seems like an easy way to make an app, but it also comes with a rather limiting fremium model that I’m not a fan of. We have the features that it offers right now, but how long before those become premium features? The last option is to personally write some manner of HTML interface. I’ve looked into it, and making an elementary one doesn’t seem too complex. The most difficult parts (having a slider for the RGB colors, for intance) are already worked out in basic java snippets available on countless forums. I like the home-made aspect of that, though it may make the controls a little less polished.

I’m not too sure what route I’ll end up taking but whichever route it will be, my next step has to be to control the color of the LEDs live in some form or another.

Adjusting my Knowledge of Schematics

A little while ago, I posted about learning new things about schematic design. In short, I followed a tutorial that encouraged clear schematics by using many net labels in the place of drawing out wires. In particular, they connected net labels directly to the PCB, and had everything defined separately from that. However, I’ve come to find out that this is a bit of a debate in the hobbyist electronics world. I was reading the following post on Reddit that shows an example of the discussion in the comments:

A Reddit thread where someone posts their schematic, which makes heavy use of net labels. The discussion about this in the comments was quite educational for me.

The discussion centered around the balance between clean and clear schematics. Separating everything out with net labels will certainly make schematics clean, as there will be a minimum of crossed wires or cramped symbols. However, the downside is that this will reduce clarity. I followed a suggestion in the comments and tried to trace a signal through the schematic. I have to admit, it was pretty tricky – I checked a pin, and then read the net label, followed by having to scan the schematic to find that net label again, only to see that there were two other net labels involved. As a result, it was pretty tricky to see what the internal connections were.

It seems there’s a pretty clear divide on the topic, as evident in the discussion as well. Some people will say that leaving as many wires in the schematic will aid readability, although they’ll also say a schematic should have as few crossed wires as possible. The consensus seems to be that some common sense should be applied in choosing when to use labels. In the case of this schematic, there’s an example of a label being used for no reason at all, apparently, as this person points out:

This user identifies three components that are right next to each other on the schematic, but connected via labels rather than wires.

I can wholly understand their comment here. These components were literally adjacent to each other and nothing else, and connecting them via cables would cause very little trouble at all (one connection to ground would have crossed over a signal wire but that’s it).

In the case of my Pomdoro schematic, I’m thinking that I may have doubled up on methods to clean up my schematic. For instance, I used both buses, wire labels, and global labels. I could have stuck with only wire labels, and perhaps adding buses to still draw a line but collate the five wires into one. Furthermore, it makes sense to me to separate out the power section of the schematic. It’s a functionally separate part from the main schematic. The same goes for the ISP programmer – it’s a side issue to the main function of my device. However, I’d also separated out the LEDs from the microcontroller, even though that’s the main point of my entire Pomodoro timer.

Figure 1: The Pomodoro Schematic

It’s a good lesson for when I make the hamster cage lighting system. I’m not bothering to rework this schematic again, but if I would, I now know what I’d do better.

  1. I’d edit the ATtiny84 symbol to put PB3 on the left side of the symbol. After all, it’s an input to the microcontroller, so it makes sense to me that the signal goes from left to right.
  2. I’d not use net labels for TimerLeds and PomodoroLeds, but rather use the bus wire to connect the LEDs somewhere to the right of the ATtiny84.
  3. I’d use the small versions of the symbols to create a little more space on the schematic.
  4. I’d have the wires on PA5 and PA6 connect directly to the relevant switches. Those are their main functions, after all, whereas the MISO and MOSI are secondary connections and should be branches off that.
  5. Similarly for PB3, where I’d have it connect directly to the RST label, and have the pull-up resistor be a branch upwards.

International Waters is Released

A friend of mine, Capybarbarian, has just released his third adventure, called International Waters, for The Sprawl RPG. He was kind enough to run it for me and a few others in a playtest session, and it was a lot of fun.

Figure 1: The cover for International Waters – if you play The Sprawl, I can recommend it. If you like cyberpunk, I can recommend it. Heck, I can just recommend it outright!

It’s a cyberpunk adventure, in which your crew is hired to retrieve a person from a ship that’s been stranded somewhere due to corporate tomfoolery. When we played it, we chose a route of violence – I looked forward to seeing how Capybarbarian would deal with our crazy approach, and he GM’d it quite nicely. The end result for us was an action-packed module that had an enticing background – a setting that hinted at so much more behind it. That was with us doing our best to ignore the plot points, to stress his module and put it through the wringer. There’s a wonderfully intricate world that’s behind it all and, honestly, all of us wanted to replay it right after we finished to find out more about it.

As I’ve gotten used to, his work is thoroughly researched, with a lot of references to real-world events, cultures, and situations. I can thoroughly recommend you give it a try.

Capybarbarian’s three available modules can be found for sale here.

Learning About KiCad and Schematic Design

The next project I’m going to be looking into is the RGB lighting for the hamster cage project (post about the cage; post about the intended design). I’m now back at the usual first stage of my projects: experimentation. This is usually the time where I just hook things up, see how things work, and generally mess around. To give you a rough idea, my experimentation now will be getting the ESP32 to connect to the WiFi; then, I’ll try and get an LED to blink; lastly, I’ll try and get the LED to blink depending on whether I’ve sent a command over WiFi. As you can see, it’s step-by-step increasing the complexity, until I am where I need to be.

The next step, usually, is design. Once I’ve tested out all the individual bits of my final project, and I have a rough idea of how to do it, it’s the time to bring it all together. My first step is always to make a schematic in KiCad. As usual, before I start I try to learn a little bit more and apply at least one new thing before I get started. That’s why I was so happy that I found this video:

A video by Phil’s Lab, showing the full process of hardware design

I’m only about half an hour in so far, and I’ve already learned a tremendous amount about net labels and sectioning off components, as well as just some handy KiCad tricks. Just for that alone it was useful to me, and I still have two more hours of the video to go right now!

Aside from that, I wanted to find a good solution to the mess of wires I had in the Pomodoro design. The outputs for the ATtiny84 were all so close to each other, and some had to move upwards while others moved down – it ended up as a large bowl of spaghetti (a tangled, disordered mess of wires or connections are often informally called spaghetti, for obvious reasons). Yet, there are two clear bundles of data in the Pomodoro timer: the two sets of LEDs. So, I looked up how to do bus wires, leading me to this post. It’s an explanation of how to apply bus wires in KiCad, and using wire labels to connect everything together. That way, you can get a clear schematic, and KiCad can still read it and build a rat’s nest out of it.

When I learned these things, I just had to stop the video and apply this right away. The only schematic I had lying around was the pomodoro one, so I figured to just test out the process:

Figure 1: The original Pomodoro r2 schematic

Now compare the old schematic to this new one that has all the lessons applied:

Figure 2: A revised Pomodoro r2 schematic, applying net labels, bus wires, and outlines for sections

What a difference in clarity! No more crossed wires, and several subsystems are clearly separated out to their own space. I greatly prefer this schematic. The only downside I found was that the labels are later on also used in the PCBNew program to label the actual traces. Now, that may be quite a useful feature later on, but it also causes a little confusion. Take a look, for instance, at pin 7 (PA6): it’s both MOSI as well as the Pause/Reset switch. Now, since I applied the MOSI label to it to connect it to the ISP, the whole trace was called “MOSI”. However, I’d much rather apply that label only to the trace leading to the ISP, and Pause/Reset only to the trace leading to the button. Maybe that’ll be possible, maybe it won’t. More to learn!