Here are some projects I've worked on (non-professionally).

Solar Power Gauge

4/15/2024

    My wife and I got solar this winter and my excitement about our power generation grows with our proximity to the equinox. To keep me from obsessively checking my phone, I build this esp32-powered dial to put on a shelf in our living room. It shows the current kW output for our solar system with a cute rising sun and some numbers.

    Parts

    Files

    Notes

    The stepper gauge does not have a real datasheet nor specify a voltage, so to keep things simple I'm just using the 5v from the USB powering the ESP32 board. I suspect this is not quite high enough because over time, the gauge seems to drift due to skipped steps. I played around with stepper speed, but it always seems to have this problem. My fix is to run the "stepper_init" script every hour, which just turns the dial all the way forward and then all the way backward before going back to the last known value. (I've seen my dashboard gauge cluster dials do this when I start my car).

    Pics

    RFID Cat Feeder

    2/26/2023

    This was a lot more complicated than I thought it would be, but it came out pretty well. I built a feeder to cater to my slow feline eater and not her food-insecure companion. I utilized 3D printing, IR break beam sensors, a custom antenna, and a sketchy high-powered RFID module. What's not to love?

    There is at least one commercial product that satisfies my requirements, but it's over $200, requires a separate $80 device to program, and has some dubious reviews. Plus, where's the fun in that?

    Problem

    I have 2 cats, one of whom (Luna, right) likes to graze, while the other (Fermi, left) has, umm... disordered eating (and will eat until she vomits if not stopped). In a normal feeding situation, Fermi will eat from her silicone mat until she is frustrated or finished, at which point she will push her sister Luna out of the way to gorge ad nauseum (literally).

    Solution

    Since Luna came "chipped" (has a tiny 134.2Khz RFID tag embedded in a capsule in her little grey neck), I figured I should be able to build a feeder that only opens for her, and closes for Fermi. Easy!

    Outcome

    This project took almost 6 months in all. After some training with treats, Luna eventually warmed up to the device. She uses her feeder twice a day and Fermi has not gotten into it once since the last time I tweaked the delays. I spent hundreds of hours more on this project than I would have ever spent just chaperoning during feeding time, but I now only clean up vomit when they eat our houseplants. And I learned Fusion 360 in the process!

    Design

    RFID woes

    The most difficult part of this project was engineering a solution which would reliably energize the RFID tag upon feline approach. A megahertz-based RFID system would have had no trouble traversing several centimeters of air and some cat fur, but the 134.2Khz system was really only designed with one use-case in mind: a reader pressed directly against the neck of the tagged animal (not an option here). I tried various antenna tuning methods, several designs which would have her stick her head through the coil, a ledge for her to step on in order to reorient her neck angle, and much prayer to the RF gods to no avail. The best version ended up being a combo of the following elements:

    • A very powerful RFID transceiver module from aliexpress (I'm no doubt irradiating my cat every time she eats)
    • A 3D printed rounded-rectangular coil bobbin which integrates into the the feeder at a 35° angle
    • Very well grounded circuitry
    • Unending patience (and continually renewed motivation to stop cleaning up cat vomit)

    Safety

    Of course I have no desire to squash little fuzzy cat heads or their attendant bodies, so I employed a thoughtfully placed IR beam block sensor with careful software timing to make sure the lid never closes while a cat is in the way.

    Noise

    While overkill from a torque perspective, a pancake-style stepper motor ended up being by far the quietest solution for raising and lowering the lid. Along with a greased 3D printed partial gear with a springy design, the lid opens and closes easily and does not scare Luna away now that she is used to it.

    Enclosure

    I actually purchased my first 3D printer (a Prusa Mini+) for this project in order to print the bobbin on which to wind the coil, but 3D printing ended up quickly becoming a new passion in its own right and I overengineered the entire feeder in Fusion 360. I am rather proud of the end result which is comprised of a base, main section, lid, bobbin, and interlocking arms. The lid and gear are printed from PETG and everything else is PLA. There are internal channels hiding all the wires which snake throughout the walls, curving to the compartment which holds the brain; a feat not possible without additive manufacturing.

    Brain

    Besides the power supply, illuminated button (indicates state/errors via flashing), and RFID module, the circuitry is modest. An Adafruit ItsyBitsy M4 running CircuitPython has all the smarts and pins needed to listen to the sensors and drive the motor. The microcontroller is soldered to a board along with a motor driver and minimal passive components for the sensors.

    Midi Dudes

    2/23/2021

    Midi in, RGB light strip out! Reacts to "mood" while playing.

    On Air Box

    2/23/2021

    I built a pair of "on air" lights so that my partner and I can signal to each other when not to be interrupted. This solves the problem of one of us (mostly me) barging in on the other while they are in the middle of a work call, zoom meeting etc.

    This project ended up being a pretty good learning experience for me around circuits and specifically driving high-power LEDs.

    Features:
    • Auto-discovery of other boxes on network via bonjour
    • Automatically adjusts brightness of LEDs based on input from lux sensor
    • Chonky buttons
    • What's not to like?

    benkrejci.com

    2/22/2021

    This website. How meta!

    Optimized for
    1. Page speed
    2. Accessibility
    3. Easy content management
    4. Rapid development
    Stack
    • Strapi headless CMS
    • React with Next and Material UI
    • Hosted on EC2 instance running:
      • Strapi
      • The 'deployer' process which receives webhook from Strapi to rebuild Next app
      • Nginx to proxy to various apps running on that server and serve static content

    Could put it on Lambda & S3, but that would take longer to set up. Maybe eventually I'll extend this monorepo with a cdk app that deploys all this stuff without EC2