Automatic Robot Garage

Spring 2021 - Fall 2022



Overview


Automatic Robot Garage (ARG) is a fun project that I started with my father to create a fancy garage to house his Husqvarna Automower. He built the miniature garage and I put together the electronics and software for it.

The garage features a motor-controlled port, facade lighting and a connection to Husqvarna's cloud for live updates of the Automower's state. It also features a web application for controlling the garage.



More details


We started this project with the aim to build a fully automatic garage for the Automower, meaning the garage should have a port that opens and closes troughout the day to let the Automower in to or out of the garage.

The building process began sometime around april 2021 and by the end of summer that year we had the garage completely built. At this time all was working great, except I had not implemented the connection to Husqvarna's cloud yet. This meant that the garage would open once in the morning, stay open all day and then close in the evening. Since this was not what we wanted there was still some work to do. By the end of summer 2022 we were able to let the garage run completely on its own, opening and closing the port automatically throughout the day with the help of live updates from the Automower.



Electronics


For controlling the motorized port and the facade lighting there is a Raspberry Pi Zero W at the core of the electronics. The two main reasons for choosing a Raspberry Pi was rapid prototyping and making the garage standalone. The aim was to build the first prototype as fast and easy as possible, not trying to make it a "real" product just yet. This meant that I did not want to manage any external servers, for example hosting the web application or similarly. For simplicity, I wanted everything to stay on the local network for now. So by choosing a Raspberry Pi which is able to host its own web server and run a lot of software as well as controlling I/O's, I could make a lot of progress rapidly.

For opening and closing the port I chose a regular Nema 17 stepper motor. They are cheap, powerful and easy to control. For driving the stepper motor I went with the TMC2208, which is a silent and efficient stepper driver.
The LEDs used for the facade lighting are WS2812b, also called Neopixel, LEDs. They are digital RGB LEDs that are just bright enough to work as facade lighting for the garage. With correct software these are also really easy to control.
You are also supposed to connect two limit switches so that the software can tell whether the port is opened or closed. Other than this, there is not much else going on with the electronics. I tried to add a speaker driver to be able to play some tunes from small speakers that we were going to put inside the garage, but the sound was too distorted so we abandoned that idea for now.

After seeing that the electronics worked OK the first summer I decided to make a custom PCB that would be more robust than the hand-soldered version. I made it sort of like a HAT for the Raspberry Pi Zero which you can see in the picture below. It has components on both sides, both through-hole and surface mounted.



First prototype to the left and the PCB version to the right.



2D view of the unpopulated PCB.



Installation


Below are some photos of the complete installation.


Top view of the insides of the garage. Image to the right shows lead screw and motor that opens/closes the port, limit switches and lights.



Electronics box.



Software


The software is divided into separate scripts for each of the garage's tasks, e.g port control or lights automation. All of these scripts are then run from the web server/app as subprocesses.

The code that connects the garage to Husqvarna's cloud is made as a kind of add-on module for the garage. The thinking behind this was that anyone with a robotic lawn mower can make use of ARG and then choose to include or exclude that module depending on if they have a connected Husqvarna automower or not.
The connect module and especially its' automation script is the most fun part of the software. The garage really does not do much without it. What it does is basically open the port when the automower wants to come home, then closes it while it is in the garage. When the automower wants to go out again, the port opens and then closes when the mower is mowing.


As mentioned previously, the garage is controlled through a web application (built with Python Flask). The web application is mostly for setting up the garage, so it is not really needed once everything is working as it should. However it features a dashboard which allows the user to manually open/close the port, turn the lights on/off or even view the Automower's latest update. Have a look at the video and images below to see what it looks like.



The video demonstrates what the desktop version of the web app looks like, but it is responsive and works just as good on any phone or tablet. I built it from scratch with vanilla HTML and CSS.
I spent a reasonable amount of time on user experience in the web application, and in my opinion it is not bad but it might not be the best either. However, it does its' job.



Tablet and phone view.



Party mode 🥳



Thank you for reading!



Languages used