Certainly you’ve ultra-wideband radios in your bins too?

Home Assistant already is aware of which bins (trash cans, for the global readers) are due for assortment. It can inform me it’s bin evening, put the suitable colors on a dashboard, and ship me a reminder. What it will possibly’t inform me is whether or not I’ve really achieved something about it.
I’m fairly positive most folks would simply set a recurring reminder on their telephone. As my spouse will little question let you know, I’m not most individuals. Some would simply keep in mind to place the bins out, like a standard particular person. I’m effectively conscious that I’ve ridiculously over-engineered this. I’m additionally so removed from regular that six radio-equipped bins appeared like an fulfilling strategy to spend my evenings 😉
I had an thought a variety of years in the past to stay low-cost Bluetooth tags on my wheelie bins and use an outside Bluetooth proxy to work out whether or not they have been close by. It was irritating. The batteries drained rapidly, the proximity readings wandered about, and the proxy was unreliable in that individual set up. I wished to know whether or not a bin had moved. I principally acquired one other factor to fiddle with.
AirTags have been what first obtained me intrigued by ultra-wideband radio, or UWB. Reading extra about the way it labored introduced the bin thought again. Over the previous few weeks it’s grow to be BinRange: a set radio anchor, six little battery tags, and a Home Assistant setup that mixes the place the bins have been seen with after they’re due. There’s a printed enclosure, customized firmware, and wi-fi updates as effectively. All of which is a reasonably substantial reply to “have you ever put the bins out?” 😀
I leaned closely on Codex all through the construct. Astra grew to become out there part-way by means of, and I used to be actually curious to see how it might do. What I really like about working with AI is how rapidly I can take an thought, react to the end result, give it some suggestions, and have one thing else to strive. There’s a lot to write down about that in different articles. For now, again to the bins.
There you go, some bins. Beautiful, proper?
Six bins, a number of schedules
We have one basic waste bin, one meals compost bin, one backyard waste bin, two recycling bins, and a glass bin. Six bins. At one home. They’re not even all on the identical assortment schedule. I’m grateful that the Waste Collection Schedule integration for Home Assistant scrapes the council’s schedules and retains monitor of what’s due, as a result of protecting that straight is a job in itself.
With a budget Bluetooth tags, the best way to estimate distance was RSSI – acquired sign energy indication. You measure how robust the acquired sign is and use that to guess how far-off the tag may be. The bother is that signal strength relies on excess of distance. Walls, parked vehicles, reflections, antenna orientation, and variations between the radios and their antennas all have an effect on it. Even battery voltage can have an effect on the transmit power on some hardware, relying on how the gadget is designed. A weaker sign may imply the bin has moved additional away, or it may imply one thing obtained in the best way. It’s a really imprecise strategy to estimate distance, which defined why my unique setup was so irritating.
UWB was attention-grabbing as a result of it measures the time taken by radio signals to travel between devices. That provides a distance measurement with out having to guess it from sign energy. It nonetheless has to get a sign by means of the environment, after all. Choosing a distinct radio doesn’t make parked vehicles disappear.
I additionally spent some time detoured into a tutorial query about what number of anchors I’d want so as to add extra dimensions to that consciousness. What if I wished to know the route in addition to the gap from some extent? Or the bin’s exact location – what number of fastened reference factors would I have to triangulate it on a 2D airplane? Totally not price it for this job, however tangential ideas be tangential ideas.
For the bins, I solely wanted to know whether or not each had moved far sufficient from its typical storage space to rely as Out. One anchor was sufficient to start out testing that. I used a ten-metre boundary: inside is Home, past it’s Out, when there’s a recent studying. It’s particular to my set up, but it surely meant I may begin with one powered board moderately than flip the backyard right into a positioning check vary.
Two boards and a stroll outdoors
The first experiment used two Makerfabs ESP32-WROVER/DW3000 boards, each powered over USB. Before doing something intelligent with Home Assistant, I wished to see them measure a distance. An area net view let me separate them and watch what occurred while not having a USB cable stretched between the 2.

One of the event boards. This is the DW3000 mannequin used within the experiment. Hardware reference.
The antenna orientation made a surprisingly giant distinction. At about ten metres, altering the boards from flat to upright took the noticed success fee from 37% to 100% in that check. A slower radio setting with an extended preamble additionally labored the place the preliminary quick setting struggled. These have been helpful discoveries to make earlier than designing something across the first end result.
The first time I calibrated it with a tape measure and watched the reported distance differ from my measurement by lower than two centimetres, my thoughts was completely blown. Two little boards have been exchanging radio indicators and agreeing with a tape measure to that diploma.
In the later recorded check, a measured hole of 10.1 metres produced a mean studying of about 10.09 metres, with a regular deviation of three centimetres. That was encouraging for a venture which solely wanted to recognise a bin leaving a storage space. The under-two-centimetre end result was what I noticed in that first calibration, moderately than a promise of that accuracy for each tag, orientation, or outside place.
The outside stroll was extra revealing. Readings have been dependable to roughly thirty metres, then intermittent additional out. The furthest recorded studying was 37.28 metres, with gaps. A automotive may block the trail fully. Holding a board upright within the open and mounting slightly tag beneath a bin rim have been clearly going to be totally different assessments.

The two-board stroll check. It established a helpful place to begin; it doesn’t set up protection for the put in bins. Recorded findings.
The anchor publishes its readings over MQTT, and Home Assistant discovers a separate gadget for every tag. I thought of an ESPHome element, but it surely wasn’t including a lot to the association I wished. There’s no further BinRange server or cloud service, and the radios can maintain ranging whereas Home Assistant or the MQTT connection is unavailable.
Something sufficiently small to placed on a bin
The improvement boards have been helpful for proving the hyperlink. I didn’t need one hanging off each bin, with a battery and an improvised field hooked up. The bin-side {hardware} wanted to be a small, self-contained puck.
I explored customized tags and business ones, with the necessary query being whether or not I may run my very own firmware and use them with my very own anchor. A small UWB tag isn’t mechanically suitable with one other UWB product. The packaged tags I finally purchased have been KKM K4Ws, with an nRF52833 processor, a DW3110 radio and a LIS3DH accelerometer. They take detachable CR2477 coin cells (which, btw, are some chonky boy coin cells! I’ve not seen them earlier than, thems fats).
The two Makerfabs boards got here to US$123.64 together with transport. Ten pattern tags at US$25 every, a programming jig and transport got here to a different US$330. Those are what the experiment value on the time, moderately than a present purchasing checklist or the price of a completed six-bin equipment. I believe I ought to keep away from calculating a payback interval.
The provider mentioned the tags may run my firmware and provided a jig to succeed in the programming connections. I used to be much more within the {hardware} they have been supplying and understanding that programming entry wasn’t locked out indirectly. None of their current software program options mattered to me. Claims about battery life have been meaningless for my use as soon as I used to be going to be the one deciding when the CPU slept and what woke it up.
I’m fairly aware of nRF52 gadgets. I’ve used them for years, going again to my time at rlab. They make sensible little low-power microprocessors, glad to spend most of their lives asleep. If you’re intelligent along with your scheduling and interrupts, you’ll be able to drag this stuff out for years on a small battery in the suitable utility. That was far more attention-grabbing to me than regardless of the provided firmware occurred to do.
I used a spare Nesso gadget as a programming probe for the pogo-pin jig. I began with a improvement tag, then commissioned the packaged ones separately: programme it, set up its id, pair it, label it, assign it to a bin, and put it again collectively. There are a number of identities concerned, together with the printed label, the chip id, and the addresses utilized by the radios.
Side be aware: the instances the tags have been provided in had seemingly distinctive serial numbers printed on them, with QR codes containing these serials. Presumably they serve some objective within the provider’s inventory firmware and software program. I couldn’t discover any affiliation with the embedded gadgets’ MAC addresses or comparable identifiers, so that they have been basically ineffective to me. Which is a disgrace actually – in the event that they’d been the radio MAC addresses, for instance, that may have been helpful!


Close-up of the bin tags caught to the bins. You can see how chonky they’re, these batteries are large! They match properly underneath the rim although, which can maintain rain principally off.
The producer had related the accelerometer’s interrupt output to a GPIO pin on the nRF, which is extremely helpful. It means I can let the nRF sleep for very lengthy durations, ship no radio visitors throughout that sleep, and wake it up when a bodily occasion occurs. Once issues calm down, it returns to occasional check-ins, with the UWB radio sleeping between makes an attempt. The firmware default is ten minutes when stationary; I’ve since modified the put in fleet to thirty minutes utilizing controls in Home Assistant, whereas protecting the five-second shifting studies.
That ought to keep away from spending the battery repeatedly reporting {that a} bin remains to be sitting the place it was. How a lot life it really buys is one thing I nonetheless have to measure. I’m gathering voltage and exercise data, however a brief, pretty flat voltage hint doesn’t give me a defensible estimate in months or years. I’m undoubtedly not thinking about utilizing nearly all of the battery’s life reporting its personal voltage. That appears low worth 😉
Updating six bins with out taking them aside
Once a tag is mounted, opening it up and placing it again on the programming jig each time I modify the software program turns into moderately unappealing. The anchor can now ship signed firmware updates to paired tags over Bluetooth. The earlier utility is retained so a foul replace can roll again, and the system solely studies success as soon as the tag is operating the precise anticipated picture and has confirmed its personal well being.
Testing and iterating on this kind of factor is one other implausible use of AI. Codex helped me generate and simulate a complete vary of check circumstances and failure modes, then work by means of them to make deploying firmware to one in every of this stuff over the air as secure as attainable. I examined corrupt photos, interrupted transfers, chosen power-loss factors, and watchdog restoration. I additionally examined what occurred when the anchor wasn’t there: the tag wants to substantiate that it’s wholesome with no radio reply, moderately than abandon working firmware as a result of it will possibly’t attain the anchor.
Going from one tag to a number of discovered a distinct kind of drawback. A document within the Bluetooth library had been sized for the variety of simultaneous connections moderately than the variety of paired gadgets. Adding an extra tag may fail regardless that its keys had been saved. Fixing that meant a brand new bodily tag may pair with out clearing the present ones. Six bins gave the software program a greater interrogation than one agreeable demo tag.
I’ve since up to date the put in anchor and all six tags wirelessly with out re-pairing them or reaching for the jig. I’m happy about that. Some earlier connection makes an attempt wanted retries, although, so I nonetheless need extra proof earlier than calling the entire course of reliably unattended. The programming probe stays the rescue route.
The field took a number of goes
The anchor wanted a case, which grew to become its personal little venture. It began as an OpenSCAD design with screws. The first match test was promising, however small nuts and bolts, PLA tolerances, and a board that would nonetheless rattle made the meeting extra annoying than I wished.
I wished a case made fully from printed PLA, with no screws: tapered finding pins for the board, printed springs to carry it down, and a lid that stayed on. The pins and is derived labored. The lid may transfer round far and wide.
An inner lip improved the match. Deeper catches improved the retention, however I may nonetheless pull the lid off too simply. Making these catches as deep because the wall appeared like the apparent subsequent try, till each roots broke throughout insertion. That model was glorious at turning into two items of damaged plastic.
The higher change was to overlap the bottom and lid partitions and use a number of shallow catches. A few tweaks to the finding pins and vents later, I had a case that held the board correctly and stayed shut. I used to be more than happy with it, which most likely says one thing about what number of lids I’d pulled off by then.


The screwless case, rendered from its print meshes. The colors and end are illustrative. You can print it from MakerWorld; the design files and history of the less successful attempts are on GitHub.
That fast loop with Codex was significantly fulfilling for the case: I may refine the design, examine it, and print it. I nonetheless needed to decide up the end result and discover out whether or not the lid fell off. A geometry test can set up that two shapes ought to match collectively; it doesn’t inform me whether or not a catch will survive being pushed into place.
The anchor is now wall mounted, with the printed case inside a bigger outside electrical field alongside its energy elements. That concerned one other Amazon order. The related bits have been:
- A transparent-cover outside electrical field, listed as IP67 and eight.7 × 6.7 × 4.3 inches (£27.99).
- A DIN-mounted 12V DC energy provide (£11.09).
- A DC-to-USB-C PD module to show the 12V provide into USB-C energy.
- A Type A RCBO, listed as 10A with 30mA residual-current safety (£14.00).
- Three metres of two.5mm² twin-and-earth cable (£11.99).
- A right-angle USB-C energy pigtail with a 25cm lead. I solely wanted one, however they got here in a six-pack (£5.99).
That little USB-C PD module is a fairly cool, uncommon gadget. It takes the 12V feed and supplies USB-C Power Delivery. I can see myself ordering one other.
Those are the costs on my order, moderately than present quotes. A weatherproof field, energy provide, USB-C energy module, safety, cable, and USB leads for a reminder to place the bins out. I do know.
All six bins have their tags fitted. At that time I used to be feeling pretty optimistic that it was all working.

The anchor put in on the wall. The printed board case is contained in the bigger enclosure. Installation photograph.
Reminders and Notifications
The Waste Collection Schedule integration deserves plenty of credit score right here. Scraping the council’s schedule saves me sustaining a number of recurring dates and remembering which mixture of bins is due. BinRange provides bodily details about the bins, and Home Assistant places the 2 collectively.
The extraordinary dashboard reveals the subsequent assortment, compact bin states, and something needing consideration. The ranges and radio diagnostics have their very own view. I like trying on the technical particulars, however checking tomorrow’s bins shouldn’t require decoding a radio hint.
The reminders are grouped into one message for the related bins: at 6pm and 9pm the night earlier than assortment, then a closing reminder at 6am in the event that they’re nonetheless confidently Home. At 6pm the next day there’s a reminder to carry again bins nonetheless Out. The automation remembers its makes an attempt so a rerun doesn’t maintain sending the identical message.
An unavailable studying shouldn’t end in an accusation that any individual forgot a bin. Likewise, the extraordinary bring-in reminder solely is aware of the gathering was scheduled and the bin remains to be out. It doesn’t know whether or not the crew emptied it.

Home Assistant notification to place some bins out.
I additionally wished a message when the bins had simply been emptied. There was an apparent temptation to have a look at motion, time of day, and the gathering schedule and name that sufficient. Looking again at one assortment confirmed how little these clues may set up when tags stopped reporting for a lot of the day. A wake counter may inform me there had been exercise, but it surely couldn’t inform me who dealt with the bin or why.
The tags already had accelerometers, so I added a extra particular clue. Relative to a calibrated upright place, a sustained tilt past ninety levels information a tip occasion. The tag retains that occasion by means of a reception hole and studies its age when it subsequent reaches the anchor. Home Assistant can deal with a current tip on a due bin identified to be Out as an assumption that it has been emptied.
The first automation checked for pending suggestions each 5 seconds. That felt extreme for one thing that occurs just a few occasions every week, so I modified it to an MQTT occasion circulation with a timer that solely runs whereas there’s a deadline pending. Qualifying bins are grouped for sixty seconds, with saved state to suppress repeats and help restoration after a Home Assistant restart. Scheduled reminders stay the fallback.

Home Assistant notification that the bins have been emptied and could be introduced again in.
First check in prod
On 28 September I had a Garden assortment I may look at correctly. The bin began shifting at about 7:05am and crossed the ten-metre boundary shortly afterwards. Reports then stopped arriving whereas it was away. When it reappeared at about 10:25am, it carried a saved tip from roughly 9:27am, after which crossed again into the Home zone and settled down.
The tag had detected and retained the tip. Departure and return have been seen. But the tip was about fifty-eight minutes outdated by the point Home Assistant acquired it, past the automation’s thirty-minute acceptance restrict. The “simply emptied” message didn’t ship. Other bins had continued reporting, and there wasn’t an MQTT failure on the anchor throughout the hole. I nonetheless don’t have a longtime clarification for that tag’s lack of reception on the assortment place.
That was a helpful correction to my optimism. The radio may produce convincing measurements, the tag may detect a tip, and the dashboard may look proper, whereas the telephone nonetheless missed the emptying notification. Checking an actual assortment gave me a significantly better checklist of what wanted consideration.
It additionally modified how I wished to point out a bin that had gone quiet. Originally, an Out studying grew to become Unknown as soon as it was stale. That was cautious, however after watching the bin go away after which lose contact on the kerb, changing Out with Unknown stopped being very useful.
The stay setup now remembers an noticed departure as presumed Out, even by means of misplaced contact or a Home Assistant restart. Reception well being is proven individually. A recent studying contained in the boundary is required to return the bin Home. If it was final seen Home after which goes silent, it turns into Unknown, as a result of I by no means noticed it go away. Return reminders can use presumed Out; put-out reminders nonetheless want recent proof that the bin is Home.
That makes the show nearer to what I really know.

Waiting for extra bin days
BinRange is put in and in use. (As I sort that, I realise I’ve severely pigeonholed this in any other case general-purpose software 🤔)
There’s nonetheless some pretty extraordinary commentary to do: protection at every storage and assortment place, a number of full cycles with the suitable notifications delivered, battery behaviour over weeks, and the way the mounting and enclosures cope outdoors. I additionally need updates to attach dependably with out me retrying. I’m not actually constructing this for basic consumption by different folks, but when others are impressed and need to strive one thing comparable, or repurpose any of this, they (or their robotic associates) are welcome to.
The repository has the firmware, case information, measured findings, and Home Assistant examples for those who’d like a glance. This is my pastime venture, and I’m nonetheless discovering out how effectively it behaves outdoors.
Of course, now I’ve seen what UWB can do, I’m questioning whether or not I may put tags on the cats’ collars and use 4 anchors round the home to map the place they’re. Could I get centimetre-level cat monitoring? I haven’t examined that, and the bins have already demonstrated how a lot environment and radio protection matter. But I’m very tempted.
Most folks would most likely simply search for the cat.
