Motorizing External Blinds, Dry Filament, and Yearning for a Software Scope
Hi!
I'm back to tinkering on some interface-y side-projects, but I need more time to make things legible, and time is hard to find right now.
Surprisingly, I somehow did manage to motorize external blinds in my studio (well, one of them so far) using a car power window motor, a couple of relays, and a bit of 3D printing, enjoy!
Motorizing External Blinds
My basement studio has become a project in itself — there's always something to improve in between other distractions.
One small annoyance is that due to how deep my desks are, and the fact that the windows are behind them, the tape to roll up the external blinds is hard to reach. The room is on the ground level, and I do roll them up and down for extra safety (and the rare occasion when the sun shines directly into my eyes).
I could just buy motorized blinds, but where's the fun in that? Not to mention this being a somewhat larger retrofit, which I didn't want to go through. Instead, I decided to see if I can motorize the current manual system while maximizing the amount of things I repurpose from it. In the end, the plastic housing had to go, but I kept the wall mounts and reused the internal spool, but I'm getting ahead of myself.
The project started by figuring out how heavy the blinds even are. I tied a knot on the tape, attached a portable scale, and pulled until the blinds started rising (~4kg in my case); from this and the radius of the spool I could calculate the torque (~1.2Nm), and from this — find a motor.
Using a wormdrive seemed like a good idea since there's no back-driving — it can stop at any position without supplying any extra power, which is great for this use — the ambition was to be able to not only roll up the blind, but also to keep it up there. Finding a suitable motor wasn't easy (sadly, there's no McMaster ↗ in Poland), and the ones I could find with this sort of torque were getting somewhat expensive. I randomly stumbled upon suggestion online that car window power motors are all three: cheap, worm-driven, and pretty powerful. I found a 5USD one (sic!) with enough torque to easily roll up the blind when connected to 12V/6A power.
Electronics were pretty simple as well. Since I wanted to only control the motor direction (or stop it completely) I didn't need any fancy motor drivers, and instead I could use two relays wired like so:
If one is on and the other off, the motor turns; swapping them around makes it turn in the opposite direction; and if both are off, the motor is off too.
I needed some form of feedback on how far the blind has moved, though. I experimented with using Hall sensor ↗ and some magnets placed on the spool, but couldn't get reliable readings from it. Part of it is that apparently the ADC on ESP32 is not that great, and part is that I was using a 5V module with 3.3V logic on ESP32, and I was too impatient to play around with a level shifter. In any case an IR sensor with some simple alternating black-white pattern glued on the spool works great — I went with 10 steps per revolution, which is more than enough for this use.
Controlling the blinds happens through MQTT. I have a couple of "debug" routes: one where I can manually move the motor forward/backward by a specified number of steps, and another one where I can set the start and stop endpoint based on the current step (these values are stored in flash so they survive device restarts).
With this, it's pretty straight-forward to create the "end-user" routes: one to get the current position (in 0-100%), and one to set the desired position (also in 0-100%). This is all wired up to a simple Node-RED interface (and HomeKit, through Homebridge), which is what I already use for a bunch of other things. I also connected this to my BLE beacon presence detection. Walking into the room in the morning and the blinds automatically opening never gets old.
Even with everything being simple, this project end-to-end took over two months. I mainly didn't have much time to tinker, but also:
- turns out you need proper wire gauge for 6A (I got to see some exciting smoke once!)
- you also need properly graded connectors (a random barrel jack lying around is not gonna cut it; smoke again)
- ESP32 uses one of the two ADCs for Wi-Fi, which was a fun debugging experience when my sensor was working fine in isolation but not when I wanted to read it through MQTT
- a hard-to-see smudge of glue on the black part of the encoder pattern for the IR sensor was tripping it up, which made me waste two days trying to figure out why sometimes I lose a step or two (solved in two minutes: reprint the pattern and glue it again, just more carefully the second time around)
- the design of the various parts can look good in CAD, but always need a bunch of iterations to get everything to fit perfectly — and even with 3D printing we are far from the quick feedback loop of programming
I didn't take you on this whole journey for nothing though (I know the window is dirty, in my defence the building façade is being renovated):
Misc Stuff
A filament dry box is a fun quick project to make your 3D prints less stringy, using a 5USD container from IKEA, a PTFE tube with a coupler, and 15 minutes of your time. I printed this ↗, drilled a small hole in the container, thrown in a bunch of silica gel and a hygrometer, and closed it up. The hygrometer currently shows a sad face with "too dry" text next to it, so I assume the filament is happy.
As I was debugging the hall sensor, I wished for a nice and fast "digital scope" where I could pipe streaming logs of values and get a zoomable and scrollable chart that I could inspect, like one would do with an oscilloscope. Arduino has a Serial Plotter ↗, but it's a bit oversimplified for what I want — I can't even scroll back to see the history, or set a specific vertical and horizontal scale.
Do you know of any tools that fit this description? Or do I have to Zig and OpenGL on my own?
Worth Checking Out
What I've been reading lately:
- my recent readings on category theory somehow brought me back to computers again — I syntopically went through: Homotopy Type Theory ↗, Types and Programming Languages ↗ and Type Theory & Functional Programming ↗; I liked the last one the most, maybe because I red it after the first two ones, so things just looked more familiar
On the web:
- cool prototype combining UI and logic on the same canvas ↗ which reminds me of Yoshiki Schmitz's work (who's sadly not with us anymore), like Data Design Language ↗ or Dango ↗
- "You don’t program by chatting. You program by writing documents." ↗
- a nice little tool to hack into React internals ↗
- Matt Keeter ↗ is at it again (continuously?) with Fidget ↗ (and a great talk ↗)
- we shipped Workflows ↗ at Replit; I wrote a task runner on top of the previous work of Multiplayer Shell ↗, I'm pretty proud of it — it's used not only by end-users but also by the LLM