My Automatic Heater Controller (Thermostat)

2020-02-05 21:03 - Making

Lots of New York apartments are actually too hot in the winter. Steam radiators are common, and they don't offer much control. There's strict laws about lower temperature bounds, but none for upper bounds. And most significant: the building usually shares one control everywhere, but the heat reaches different parts of it differently, and the cold seeps in differently.

In my current place, it's also too hot in the winter. I think that uneven-across-the-building issue is the real one for me. I've heard that other parts of the building are too cold. My heat comes from a forced hot water system, which the building controls. I suppose I'm closer to the feed than other apartments. I've only got standard plumbing style cut-off valves. I can totally disable the heat, but then it often gets too cold. I can enable it, but then it often gets too hot. For a few years I've been hoping to make something to help fix this. The video above is my solution!

I actually got a "test valve" some time ago to play with, when starting this project. My test valve didn't work at all for the project, but I lucked out: the test valve's handle is permanently attached, but my real valve's handle is attached with a hex nut, it's removable. The first part of the project was the handle replacement. It's the round smoky plastic bit. It has a hole in the center that's just the right shape (an eight millimeter hole, but with two sides squared off at six millimeters) to turn the valve. It's got eight small holes around the edges and one late addition hole for a screw to hit the valve's end stops.

Those eight holes are for screws, to attach to the large black 3D printed gear. This is a 180-tooth monster built to fit a GT2 timing belt, as are commonly used in 3D printers. It's big for mechanical advantage. I started with a 30 and 60 tooth pulley (for three and six times advantage). They weren't enough so I got a 20 and a 16 tooth gear, and ended up with the 16 tooth gear, for a slightly greater than ten times mechanical advantage. A straight GT2 belt section was cut to the right length, and belt clamps and tensioner springs turn that into exactly the right size belt for this contraption. The big gear is these two parts screwed together for two reasons. First, it would take a long time to 3D print the whole thing as one part. More importantly: the quarter-inch acrylic plastic is strong enough to turn the valve, but a 3D printed part is not!

That's all connecting my big gear to the small pulley on the end of a stepper motor. This is the first real motorized project I've put together myself, and I was not at all confident. When I spotted the uStepper S product on Kickstarter, I knew it was perfect for this. It's a clever combination of stepper driver, Arduino, and hall effect sensor (which uses a simple magnet stuck to the stepper motor's shaft!) to give it closed-loop control abilities.

The stepper is screwed into another acrylic sheet. It's in slotted holes, which gives me some room to adjust the length. This mounting sheet is mostly zip-tied to the copper heating pipes. But it's also screwed down into the floor, through a brace piece of scrap plywood, to keep it in place left/right. Otherwise the tension of the belt would pull it loose!

So there's a simple control loop running on the uStepper, which accepts commands over serial. It's wired into an ESP8266, which has WiFi connectivity. It monitors the temperature sensors I've already got, and sends commands to open and close the valve based on the current temperature. Simple, now that the mechanicals are all there to support it!

I've gotten this working reliably only recently. My problem is the end stops. Even though I have closed loop control, that only gives me relative data about motion, none about absolute position. The uStepper libraries have a convenient "move to end" feature, but it turns out my system is too mushy. I've got tensioner springs on the belt, which can thus stretch a bit. And worse (I think!) the end stop I've got is just a screw in some plastic, and it's longer than the original steel handle part. It flexes a bit when it reaches the end stop, before it pushes hard enough to actually stop the stepper. When it closes (clockwise motion), you can see a big jump backwards as it stops. (There's a smaller one when it stops going the other direction, I believe this to just be the slack from the springs. I never actually open the valve all the way, it's not necessary and why stress the system more than necessary?) The built in "move to end" feature sees that as constant motion: some of it forwards, some of it backwards, but it doesn't distinguish! I had to write my own routine to detect both a lack of forward motion or backwards motion as the end condition, and then the stepper stops turning.

Now I should finally be able to keep myself comfy over the winter! But even more so in the late fall and early spring, when the building has the heat on, but it's not nearly as necessary.

Comments:

No comments!

Post a comment:

Username
Password
  If you do not have an account to log in to yet, register your own account. You will not enter any personal info and need not supply an email address.
Subject:
Comment:

You may use Markdown syntax in the comment, but no HTML. Hints:

If you are attempting to contact me, ask me a question, etc, please send me a message through the contact form rather than posting a comment here. Thank you. (If you post a comment anyway when it should be a message to me, I'll probably just delete your comment. I don't like clutter.)