Naturally, we want our pets to be as healthy and happy as possible, and just as with humans, one valuable metric to know is their weight. Knowing the weight of our four-legged friends, not only helps us to verify that they have a healthy amount of body fat, but can also can be used to detect things early on that may need medical attention. As they cannot speak to us and tell us when don’t feel well, it is our duty to listen to all of the different signals we have to understand their wellbeing.
That’s why I wanted to know the weight of my cat, Ellie. Unfortunately, she really dislikes being picked up or handled, even by people she trusts. This means, it’s not possible to weigh her on a bathroom scale, and the only datapoint I have is her yearly examination at the vets.
I wanted to build something that would fit into her life to track her weight automatically, without any intervention. I decided to modify her litter box, so that on each visit it records her weight.
But WHY, Andy?
Okay I get it; you think it’s weird. So here are the main goals of the project:
Track Ellie’s weight because I want to know how heavy she is without going to the vet
Learn something about how load cells work
Have fun building a new project
(Hopefully) Inspire others to try out new ideas and projects by sharing what I learned.
Track the weight of poops because I thought that was funny.
The Hardware
Rather than build the whole litter tray from scratch, I decided to build a platform that her existing litter tray would rest on. This platform would contain all the equipment necessary to detect when Ellie was using the litter and start taking measurements.
Before the pandemic, when we started working from home, I used to make coffee a number of different ways, depending how I felt. I liked to experiment – sometimes I would use a V60, others a French Press, coffee syphon or espresso machine. This worked well on the weekends when I had time to experiment a little. However, when you need to grab a quick coffee between meetings, it turned into a real faff; there’s just no matching the convenience (if not the quality) of the office coffee machine.
My solution here was to pick up a Morphy Richards Verve filter coffee maker that I could leave running while I went about my work and come back to when it was done. I was really surprised with this machine, I was expecting to sacrifice a lot of quality for convenience, but with a little fine tuning on ground size and water quantity, its capable of producing some very drinkable coffee.
Occasionally, though, I would get it brewing and forget to go back to collect the drink, leaving it going stale on the hot plate so I decided to see if I could connect it to my network for notifications and control.
My kitchen has some pretty bright spotlights in it, but they’re only in use when you’re working in there – once you turn them off and leave, the room can be very dark and its kind of depressing when you walk past it. I wanted to add some warmth by putting some soft under cabinet lighting.
I started in the Amazon end of summer sale by picking up the cheapest RGB strip lights on offer. I was a little worried that some of the reviews mentioned that the power pack was a a bit suspect and had exploded for a few people, so I decided to use an old generic laptop adapter I had lying around. I measured the power draw of the full 10m of lights to make sure it was powerful enough for the job.
The lights I bought came with an IR remote to control the brightness and colour, but I wanted to be able to control them though Home Assistant. I connected them up to a Shelly RGBW2 controller.
Because of the layout of the cupboards, I needed to fit the lights in several strips, so I bought some strip connectors from eBay, as well as an RGB strip extension cable, that I used to connect the sections together in series.
When I moved into my house, it came with this and old fan in the bathroom to keep the moisture down when you’ve had a shower, the bathroom itself is in the inside of the building and doesn’t have any external walls / windows, so the fan is really important to keeping it dry and non-moldy.
The original extractor worked well enough, but I’ve never really been that happy with it; it’s kind of noisy when running at full speed and has a trickle mode that runs it at low speed all the time – ostensibly this is to keep the room fresh, but in reality, means that the room Is always cold in the winter. It’s also not very well installed – is the case not fully closed on the fan focusing, and when I tried to close it up tightly the fan scraped the inside of the case and made an awful noise.
More recently the humidistat that makes it speed up automatically stopped working, meaning that after a shower the room would stay damp for hours afterwards. I’ve tried taking the fan apart and cleaning it in case it was just dust and grime of the sensor. But that didn’t help, so I set about replacing it. This being 2021 with nothing better to do, I decided to make it smart and control it from software.
After some research, I used a Manrose MF 100T inline fan, looking down the spec sheets, it is quieter, more electricity efferent and moves more air than the existing solution so seems like a great fit.
To control the fan, I used a Shelly 1 relay – I’ve used some Shelly 1 PM relays in a couple of other places that I’ll write about soon, and I’ve so far been super happy with their ease of use and reliability.
Like a lot of people, I’ve found that my TV viewing habits have moved away from broadcast TV and towards streaming services such as Netflix and Amazon Prime. I decided it was time to have a cold hard look at how much I was spending on my TV subscription and take the brave first step to becoming a cord cutter – I phoned my Inernet Service Provider and cancelled.
My ISP sent me a fantastically designed self-assembly box in the post to mail the set top box back to them. As I packed it away, I thought that I wanted to still have access to live TV – just without being tied down in an expensive contract. I considered a few Freeview (a free DVB-T service in the UK) boxes, but it would be much more fun to build something myself. So that’s what I did.
For my TV, I wanted the following features:
Watch live TV
Watch a live broadcast while recoding another (or record two at once)
Schedule recurring recordings for all episodes in a series
Stream Recordings to an iPad on the same network
Hardware
For the hardware of my TV recorder, I used a 2GB Raspberry Pi 4 – this should be powerful enough to handle recording and playback of video files. Its super small and easily connects to my hifi using HDMI. During early testing, the Raspberry Pi got extremely hot, and while I never observed any stability issues or slowdowns, I installed a passive heat sink on it to help out.
To actually tune to the broadcast, I used a Hauppauge WinTV-dual HD TV tuner connected with a small USB cable. This includes two DVT-T and two DVB-C tuners in a convenient stick form factor. In the box with the tuner, there was a small antenna to use when you’re on the go. I left this in the box and plugged the tuner directly into my roof antenna to get a better signal.
Also included with the WinTV stick was a credit card sized infrared remote control to use with the included WinTV software. As I already had a Logitech Harmony setup, I chose not to add an IR receiver to the Pi – instead I set up the Raspberry Pi as if it were a Windows machine in the Harmony app and connected to it using Bluetooth. This works really well – when I switch to the TV, the Harmony connects as a Bluetooth keyboard and I have full remote control (including text input).
Rather than buying a very expensive SD card to store all the recordings, I wanted to use an external hard drive. As performance was not a massive issue, an SSD was not needed and I already had a spare 500GB mechanical drive spare. I bought an Amazon Basics Hard Drive enclosure and connected this via USB to the Pi. This was problematic though, as both the Raspberry Pi and the external hard drive are quite power hungry and exceeded the total power draw of the power supply. This caused the device to struggle to boot up with the hard drive ticking and the Pi logging a lot of low voltage errors.
To fix this, I added a powered 7 port USB hub, that can supply enough power for the hard drive. I power the Raspberry Pi off this, too, so the whole system only has one power connection in the wall.
Finally, I took this whole arrangement and tied it together as one unit using zip ties. It is currently hidden out of sight behind the TV. Going forwards, I want to build this into a more attractive case. I considered 3D printing something, but it is too large for my print volume, so I’m currently on the lookout for a broken set top box that I can remove the innards and replace with this device. I haven’t found anything that meets my needs yet, but I do have a broken original Xbox in the garage that is a tempting idea.
Software
With the hardware built, it was time to move on to the software. For this project there was no need to custom write anything, as there are already some excellent open source projects in the community.
For the management of the TV side of the device – responsible for tuning to live TV and scheduling & playing recordings – I used Tvheadend. Tvheadend can be installed on any device on the network, as it is controled though a simple API and supplies the live TV or recoding as a video steam. In my case, I installed it on the same Raspberry Pi that I connected to the TV, and accessed it though localhost.
The advantage of Tvheadend working in this way is that you can also make use of the iPad app to stream both live TV and recordings. I use this so I can watch recordings in the kitchen while cooking – which is probably my favorite feature.
As a front end for the system I used Kodi – installed via the LibreELEC Raspberry Pi image.
Previously known as Xbox Media Centre, due to its heritage running on original Xboxs, Kodi provides a friendly and easy to use TV sized interface. From the addon repository, I added the Tvheadend plugin that lets me control the Tvheadend service though Kodi.
Review
Building your own TV recorder this way is not for the faint hearted. While it seems like a simple job of putting all of the pieces together and pressing the power button, it has involved some in-depth configuration and an awful lot of deeply frustrating troubleshooting. Here’s a rundown of some of the headaches along the way:
Tvheadend has a lot of options – Setting up authentication can be a little confusing, as can the DVR configuration. While it does have documentation, I frequently found it to be stale – referring to buttons or options that had moved or no longer available. Often figuring something out can involve some searching and reading forums.
The sound kept breaking – I’d boot up and watch a TV show, no problem – then I’d come back later and there would be no sound until I rebooted. Eventually I tracked this down to a configuration option on the Raspbery Pi, where it does not output a HDMI signal until it detects a connected device. I changed this to force output even if no device is connected (or it is off) and I’ve had no issues since.
The TV kept turning itself on for no reason – I’d be minding my own business, and the TV would turn on all by itself. To resolve this, I disabled the HDMI CEC plugin for Kodi.
Sometimes there would be artifacts at the top of the screen – Some TV shows had a black line at the top of the screen that flickers during playback. I think this is related to how subtitles are encoded on SD TV and subtitles, but to resolve the irritation for me, I set a 1 pixel overscan on the picture so I couldn’t see it.
Live pause doesn’t work – Or more specifically, after pausing when you press play again, playback fails and you have to restart playback. I’m still investigating this; I’ll update ether article if I find a fix.
Tvheadend doesn’t always start on bootup – I ran into a lot of issues where Tvheadend would not boot properly and no TV sources woud be available. I resolved this by adding a delay in the Kodi config before it attempts to start the Tvheadend service – this allows everything to get ready first.
Wrap Up
Generally, I’m pretty happy with my TV recorder – with the streaming options and the apps, it provides features that are only available on much more expensive subscription services. Tinkering with the settings to get it to work, while a little frustrating, provided a few evenings of entertainment during lockdown (although when you sit down to watch a movie and end up fiddling with your config for an hour instead, “entertainment” may be a generous description).
I already had some of the parts available to make this, but if you were to buy everything needed from scratch, this isn’t a cheap way of getting a TV setup – you can get pre-made set top boxes for less. But they don’t have as many features and where is the fun in just plugging it in and watching TV?
Feedback
I hope my little writeup of how I made my TV recorder was interesting, if you have any feedback or have tried something similar, drop me a comment or a tweet on Twitter.
I’ve previously mentioned that I wanted to upgrade my heating system so I could program it with more complex timings or control it form my phone. But there’s a catch: The house is rented, so the whole system must do no damage, be made only of removable parts and be installed without modifying any of the existing infrastructure.
In this post, I’ll talk about how I managed it, how it works and what the current state of the project is.
Background
My electric heating is controlled by a Timeguard RTS113 mechanical timer located awkwardly in a kitchen cupboard; it consists of a large outer ring that rotates once every 24 hours. On this ring, you push in red (on) or blue (off) plastic pegs (called tappets in the user manual) at the time you want the heating to turn on or off. As the peg passes a control spindle (representing the current time in the bottom right) it pushes it around approximately one eighth of a turn. Each eighth of a turn of the control spindle, toggles the heating on or off.
A second inner ring allows you to suppress the morning or afternoon schedule for a given day in the week. For example, you can have the heating come on at 6:00am and 7:00pm every day, except on Saturdays where it does not come on at 6:00am because the morning schedule is suppressed.
This works reasonably well, but it’s not very flexible – you pretty much a to live your life on the same schedule every day – if you deviate from it the heating is either wasting power while you’re out, or you’re freezing and have to reach into the cupboard to press the override button.
I’d love to have a smart thermostat such as Nest or Hive but they don’t support my electric heating and as this is a rental house, I’m not able to modify anything to support them.
What I Wanted To Do
The control spindle that is rotated by the pegs has a small slot on the top that can be turned manually using a screw driver to toggle the heating on an off. I can remove all of the pegs and use a stepper motor to very gently turn the spindle each time I want to change the heating state. I could then connect this to a controller that receives instructions from the internet, and write whatever software I wanted to run the schedule.
This is the first post in a series documenting my attempt to build a smart heating system for a rental house. Further posts will follow as I work on it.
I have electric heating in my house, powered by a central timer from the past. The timer is a masterpiece of engineering, but is incredibly crude by modern standards. I’d love a connected system such as Nest or Hive but these systems only support low voltage trigger systems found with most gas systems, not the high voltage switching I have.
So I want to build my own, It’ll be fun, educational and greatly improve my quality of life in the winter. There’s just one thing though: I don’t own the house, so whatever I do must be easily reverted / removed / undone. Also, I’m a software not an electrician so, in the name of safety, I am not re-wiring anything or changing how it currently works.
The Timer
The timer is a Timeguard RTS113, it supports switching the heating on or off once every 30 mins by inserting a red (on) or blue (off) tappet at the appropriate time. On an inner ring it supports suppressing this schedule for the morning or afternoon for any day in the week. For example, you can have the heating some on at 6:00am, and 7:00pm every day, except on Saturdays where it does not come on at 6am.
The tappets are attached to a rotating dial, which rotates once per 24 hours. Each tappet has a lug, that as it passes a control spindle, pushes it around an 8th of a turn. As the control spindle is rotated it toggles the heating on or off.
The Plan
The control spindle has a plastic screw slot on the top to help you see its current state when programming the timer. So, in theory, I can remove all of the tappets and turn the control spindle manually (and very gently) using a stepper motor each time I want to turn it on or off.
Proof of Concept
I picked up a suitable looking stepper motor and motor controller from The Pi Hut, and hot glued a washer to the end. By holding this in place I was able to turn the heating on an off by rotating the motor with an Arduino. Now to figure our a more permanent arrangement…
Next Steps
I’ve already used Tinkercad and made a driver head to fit over the motor shaft and engage with the timer’s control spindle (replacing the hot glue blob from the proof of concept), I’ll 3D print this and see how it goes. Then I need to design some kind of support to hold the motor in the correct place so I can let go of it.
In my last post I mentioned that I also wanted my info display to show the current indoor temperature, read from the air quality monitor that I made. I built the air quality monitor a couple of years ago – it was my first experience playing with an Arduino and was a lot of fun (interspersed with moments of utterly frustrating confusion). I thought I’d put together a quick intro to what it does and how I made it.
Why Build An Air Quality Monitor?
I saw an advert for an attractive little box that you put on a shelf that monitors the air quality in your room. It has an app to view the data and send you push notifications if it the air was too unhealthy. I loved the idea – I’m a big tracker of data (I once had to log of every single ingredient of every single product I ate for an entire year) and thought it would be really interesting to find out what my environment in my house is like.
I considered buying it… I really did. Then I decided I could totally build my own. I started by buying some sensors:
Like a lot of Londoners, my trip to and from work involves moving between a few different trains, any of which could be delayed and cause me to be late to work. Or worse – late home. As checked the tube status on my phone over breakfast one morning, I realised that it would be super useful to have some kind of display in my living room allowing me to see at a glance how my commute is looking before I set off, so I can go a different way if needed.
There are a few options to create a display like this – I could re-purpose a tablet or phone in the technology graveyard drawer, writing a quick and dirty app to run on it. But where would the fun in that be? Sure, it would work but I wanted to learn something along the way. I decided to use a Raspberry Pi and a display of some kind, but if its going to live in my house, it needs to be pretty.
I ordered the Primoroni Inky wHAT – an eInk display with all the headers to screw it directly onto a Raspberry PI. It even has Python library for displaying stuff. I went for the two-colour red/black model; I thought I could use the red mode to make any tube status issues stand out.
Features
As soon as I’d ordered the screen, I started thinking about what I would use it for. I came up with a few things I wanted to do:
Display the current tube status of the most useful tube lines
Display the current weather / temperature outside from DarkSky
Show the current indoor temperature, pulled from my Air Quality Monitor (I built this a couple of years back, I might cover it in a later post)
Display some kind of indication that central heating is on or off
Show the time
I drew this little diagram to get started:
Implementation
APIs
Ever the software engineering project, the first task was to
investigate the APIs to give me the data I wanted.