Made My Own Thermostat

    The thermostat in my apartment was awful, just a bimetallic bar connected to wires. It was so inaccurate and unreliable that essentially it could be used as a manual on/off switch and nothing else. And with the super-inefficient retro-fitted electric heaters that my building has, running 24/7 cost $400/month on my electric bill. On top of that, my 115-year-old building has 16ft ceilings and no insulation in the walls so even when the heaters are running constantly it will only heat up maybe fifteen degrees warmer than outside, meaning precise temperature control is never going to happen regardless of the thermostat. But even considering that, any heaters are better than no heaters and scheduling the heaters to only run when necessary could still save me hundreds of dollars per month so I definitely wanted to get a better thermostat.

    I don't actually have permission from my landlord to do this, so I didn't want to do anything permanent and I didn't want to drill any new holes in the walls or install any new wiring. Also, I don't know why the thermostat closes two parallel sets of contacts with two separate switches. But I knew that closing two parallel sets of contacts was all I needed to do. And then do that on a schedule every day.

    So I looked through my parts bins and grabbed a Rasberry Pi Pico and a moderate-capacity relay board and wrote a little program to turn on the heaters every morning and evening. Morning because the odds of me sleeping through my alarm are very high if it's just too damn cold to get up and evening because it gets much colder in my apartment after sunset. That was easy enough.

    Then I thought there are extra-cold days where I want to manually turn on the heater when it's not scheduled to run and I don't want to have to hook up my computer and reflash the RPico every time. So I added a button to override the schedule, on or off, and an LED to indicate state. Then I printed a box to hold it all. It's pretty neat.

     The override button is hidden on the bottom, the RPico boot select button is on the side, and the LED just shines through the printed cover indicating state. I looked for a way to power the thing from the wall wiring but I don't have a ground, just ins and outs, so it gets power through USB. The final product was just a few mm larger than the relay board. I'm so happy when a project is done in a day. Code is on gitlab.