Stavros' Stuff

On programming and other things.

Poop analytics

The poop analytics I've always wanted

As you may remember from a previous post, I have a blind cat whom I made some eyes for (which, incidentally, were a great success). One of the perennial and enduring problems every couple faces when they have a cat is how to divide the poop scooping. At least, that’s what I imagine, extrapolating from a sample size of 1.

Over the years, I have tried to come up with various equitable solutions that would be fair to both me and my partner. A few days after implementing the first solution, “just leave poop where it is”, we realized that we needed to add “be fair to the cat too” to the above equation, and I went back to the drawing board.

In this post, I will guide you through the various solutions

Continue reading…

Keyyyyyyyys!

The keyboard you never wanted

I have a friend, Josh. Josh is a literal superhero. He’s a boring, minivan-driving programmer by day, paramedic and firefighter by night. That’s already a much more plausible superhero premise than Batman (a billionaire who spends his time fighting street-level crime? Really, Bruce? Is that the best use of your time and billions?).

Josh showed me some notes he had taken while he was paramedicking his paramedic things. I say “showed”, it was more “asked me if I could make out what the hell the notes said”.

I could not.

The conversation then went like this:

  • Why don't you type on a computer?
  • A computer is generally hard to set up in the field, and you need to keep eye contact with the patient, so handwriting is more convenient.
  • Why not have a special keyboard?
  • I don't think that's very con
  • It can be wireless, and one-handed!
  • Yeah but still, how am
  • It can have five keys, one for each finger, and you can chord combinations to type!
  • That sounds slow and
  • JOSH THIS IS HAPPENING STOP FIGHTING IT

After his outpour of encouragement, I was motivated to create a solution, no matter how hard. I had a rough idea in my mind, but it was going to be tough oh who am I kidding, it’s five buttons connected to a microcontroller, it would take two minutes.

It took four hours. Close enough.

Continue reading…

The "do not be alarmed" clock

An alarm clock for the rest of us

It’s a brand new year, which means I should really start writing a new post. I’ve been wanting to for a while, but we’ve been in lockdown for two months now and Google Analytics is the only indication that I’m not alone on the planet, and most of that is bots anyway. I’ve decided to take a page out of the book of my friend, James Stanley, who both does cool things and actually writes about them, so I’m starting to document all my projects again.

Given my non-frenetic, slow-paced lifestyle, I’ve long had a non-burning need. I don’t use an alarm to wake up, as I start work late, but I still want to know what time it is when I wake up, just to see if it’s way too early and I can go to sleep again. A few days a week I have tennis and need to get up early, but if it’s windy or rainy or very cold, the practice gets canceled and I want to know before I’m awake enough to not be able to go to sleep again.

To accommodate this lifestyle, I’ve traditionally turned to my mobile phone, but that has some disadvantages. Namely, the screen is too bright and wakes me up when I check the time, and I’m too obsessive to not check all my messages instead of falling asleep when I see the notifications on the screen. I’ve long thought that a bedside alarm clock would be perfect for me, but I couldn’t find one that fulfilled all my requirements:

Continue reading…

Make your own PCBs with a 3D printer

More PCBs, less hassle

Listen, anyone can make a PCB at home, it’s easy. PCBs (printed circuit boards) are those flat things with all the components that are inside all electronic devices, you’ve seen them. All you need is a laser printer, some glossy magazine pages, print your circuit onto the page, use a clothes iron to transfer the toner onto your copper clad, if that doesn’t work use some water and some lacquer or something, I don’t know, I stopped reading at that point because the last time I saw a laser printer, a magazine and a clothes iron was in the nineties.

Until recently, the only ways I knew to make PCBs was to practice the dark art above, to pay $10 and wait three weeks to get professional-looking PCBs from China, or to pay $60 and wait three days to get professional-looking PCBs from Europe. It was “cheap, fast, actually doable by a human person, choose two”.

That always bugged me, it shouldn’t be like that, I have always been of the opinion that there shouldn’t be things you can’t make when you have a 3D printer, but PCBs have consistently eluded me. I yearned for them, I wanted to be able to make them at home, but it seemed impossible.

One day, everything changed.

Continue reading…

The Bus Stop Bus

The wheels on the bus get cut off to make room for a USB port.

A few years ago, I came across a post by John Graham-Cumming, in which he had used a router to run a bus arrival time display that basically showed the time that the next bus would be arriving at the bus stop closest to his house.

I thought that was a fantastic idea, and I especially liked the unorthodox choice of a router as a controller. The project stayed in the back of my mind, and it resurfaced recently, as I started dabbling in hardware. Since I’ve been looking for fun little projects to do, this one was quick and easy enough, so I started looking into it.

(By the way, this post uses Expounder, so if you want an explanation on words with a dashed underline, click on them)

Of course, if you’ve been reading my posts, you’ll know that my microcontroller of choice tends to be the ESP8266, and usually not a router. The ESP8266 is a microcontroller (basically a tiny computer with CPU, RAM, storage, the works) that includes a comfortable amount of memory and storage, is tiny, doesn’t need much power and has built-in wifi, which is extremely useful.</span> This was the obvious choice for this project as well, so I bought a small OLED screen from eBay and started

Continue reading…

Turning everything into a mobile phone: Redemption

Just puttin' phones in things that don't have phones in them.

If you have been following my erudite writings, you will know that I find great pleasure in taking things that don’t have computers in them and putting computers in them. I put a computer in a doorbell so I can order food, in a LED strip so I can play games better, an RC car so I can map out my living room, a room fragrance sprayer so… I can spray my room with fragrance, etc.

You will, of course, remember the iRotary, an old rotary phone that I turned into an amazing rotary mobile phone. You don’t? Well here it is:


You will also remember the irrigation controller that has the potential to revolutionize agriculture more than the Mesopotamian dude who said “I wonder what will happen if I put a bunch of seeds into the ground” 20,000 years ago but then was too lazy to do it. It probably won’t revolutionize it as much as his brother, who actually did it, but I’ll take what I can get.

Anyway, the problem with those two projects is that they use an Arduino, which is ancient 2014 technology, so they might as well be using a piece of flint on a stick. The iRotary prototype, more specifically, is a bunch of wires that I literally duct-taped on the Arduino because I figured I might want to use the GSM shield again (possibly to make an irrigation controller), so I’ve always wanted to improve on the two.

The obvious improvement would be to design a custom, extensible GSM PCB that I can program and easily solder to other things to make GSM-enabled devices, but who has the will, knowledge or time to do something huge like this? Well, I do, damnit, because I went and learned all these things while somehow managing to trick my girlfriend into believing that yes, I am spending enough time with her.

After the long and excessively meandering introduction, I am ready to take you through the detailed journey of how I made just that: A custom-built, programmable, GSM-enabled PCB, wrote the software for it and now make it available to you for free so you can make your own crap.

Let’s start!

The requirements

Continue reading…

A WiFi-enabled RGB LED strip controller

Ever wish your house lights could flash along with your game? Now they can.

A while ago, two unrelated things happened: I got one of those cheap RGB LED strips from Ebay, and I became interested in hardware hacking. If you aren’t familiar with the LED strips, they’re basically a long string of LEDs connected to a controller that usually supports an infrared remote control, which can be used to set the color and intensity of the lights.

When I started tinkering with hardware, I noticed a change: I started looking at common, everyday things around the house and thinking “I bet I could put a controller in that and write an API for it”. This led to a button that orders food when pressed, a rotary mobile phone, a wifi-enabled room fragrance sprayer (I haven’t written that one up, it was too simple), a self-driving RC car

Continue reading…

Building a cheap home sensor/controller

Sense light and motion in every room!

After designing my first PCB, I went on a designing spree. It turns out that making PCBs (printed circuit boards, basically a piece of plastic that includes all the connections of your components in it. It helps make your project smaller and cut down on the amount of wires floating around) is so enjoyable, I’m PCBing all the things! The next victim for PCBfication is a circuit I had originally built on an Arduino and subsequently migrated to an ESP8266.

The circuit is a home sensor and controller. It can sense light, temperature, humidity and motion, and includes an RF controller (at 433 MHz) and an infrared LED so you can control your TV and other home devices. In this post, I’ll go into some detail about the build and how it connects to other sensors and controllers around the house.

This post is also a test of my new Expounder concept library. Throughout the post, various terms will be underlined like this (with a dashed underline), and you can click on them if you’re unfamiliar with the underlined term. After clicking, some text will expand and explain the term.

Let’s continue to

Continue reading…

Hungry? There's a button for that!

The amazing, the delightful emergency food button!

I recently received my shipment of the ESP8266 and NodeMCUs I had ordered, and I started playing with them. My overall experience is coming soon in another post, but the verdict so far is that it’s fantastic and I love it for ever.

Since the ESP8266 is pretty much a $2, postage-stamp sized powerhouse, it’s usable in a wide variety of projects. I’ve been intrigued by the Amazon dash button ever since I saw it, and I wanted a hackable button like that for my own projects. So, I set out to

Continue reading…

Review: CodeBug

Reviewing today: The CodeBug wearable computer

So, I just received a CodeBug in the mail, graciously provided by Newark element14 for a review. This is that review.

Before I start, I should say that Newark didn’t pay me, they only sent me the devices for free and with the understanding that I would be very truthful in my review, even about things I don’t like. So, hopefully this won’t read like I’m a paid shill, and all biases are my own. Now, we can proceed to the actual thing!

I have to admit that I had never heard of the CodeBug until Newark offered to send me one, but, now that it arrived, I find myself pretty excited about it. In case you are not familiar with it (the default), the CodeBug is an embedded, wearable computer that aims to teach programming to children by being easy and fun to program. It comes with various features that help with that, which I am going to get into more detail about later on.

It started as a Kickstarter project by three guys who aimed to bring programming to everyone in a cute, wearable form factor, and it apparently succeeded in getting funded, because I am holding one right now, which proves it exists! Also, the Kickstarter page says it got funded, so that’s also an indication.

Unfortunately, I’m not great at researching things before tearing open their packages, so I’ll jump directly to the unboxing and hope everything works out for you in the end.

Continue reading…

The iRotary Saga

Wherein the rotary phone acquires electronics to connect to the mobile network and can function wholly unmolested

Welcome to part four of the iRotary trilogy! This is the part where we complete the project, along with the OFFICIAL TRAILER at the very end (spoiler alert!).

The original goal of this post was to complete the project, but I have delayed writing it for so long, that I think it would be better if I just started from the beginning, and produced one, cohesive narrative.

As you may remember from part one, I am a very angry person. Especially when talking on the phone, I get easily pissed off, and nowadays there’s no good way to express my frustration. I miss the olden days, where you had a nice physical handset you could slam into the phone to relieve your tension, but mobile phones just don’t provide the same pleasure. Undeterred, I set out to create a rotary phone that was also a mobile phone.

Thus, the iRotary was born.

Continue reading…

iRotary - Part Three

Phone slam 3: The slammening

In part two of project iRotary, we actually got the phone to make calls, but we couldn’t talk or hear the other person. In this part, I promised you some hardcore microphone-to-headset action, and that’s exactly what I won’t deliver!

Instead, what I did was to procure the gorgeous phone you saw in the previous posts. That’s right! All this series so far has been a ruse! I didn’t have that phone to start with, I didn’t have it at all!

However, I do have it now, and I managed to enclose the Arduino in the actual phone. Let’s see how that happened.

Continue reading…