You are using an Outdated Browser. For a better experience, keep your browser upto date. Check here for latest versions.

When engineers need a bathroom

RASPBERRY PI / SENSORS / POWERLINE / OFFICE AUTOMATION

XERit — behind the screens!

blog_xerit

On the first Premium Minds Creative Day, our team had an idea to work on in order to solve a problem we had: when at our desks many of us could not see if the bathrooms were occupied or not.

Until now, people frequently walked their way to the toilet and had to turn back without accomplishing their mission.

So naturally, we discussed the best way to get a site or widget where everybody could see the availability of the bathrooms before they stood up from their chairs.

We would call it “XERit — your shared resources status”!

When the idea came up, we had the desire to experiment with a device called Raspberry Pi. The idea was simple: the Raspberry Pi would be connected to some sensors attached to the door and send a message to a server application in another machine, which would then process the changes of state.

In our vision, XERit can monitor many more resources other than just the toilet. With this setup, we can have multiple Raspberries around the office and do everything we want with the data.

We started with the electrical part of our system. After buying all the puzzle pieces, we spent some time testing the connection with the Raspberry Pi.

Foto_001

The first challenge was to find the best way to detect whether the toilet is available or not.

The choice was not as easy as it might seem. Even when toilets are available, the doors stay closed most of the time. So, detecting a closed door was not enough. Thus, we chose to place reflective optical sensors on the door’s latch. A toilet is busy as long as the door is locked.

These sensors made it necessary to use an interface circuit to the Raspberry Pi, in order to read and process the sensors’ status. We hid the Raspberry Pi under the sink, and installed wire from the sensors to the Raspberry. But how do we connect it to our network? We needed wired access to our LAN, and since there are no network sockets in the bathrooms, we decided to use a PowerLine. With a drill, hot glue and solder, we could finish the carpentry stage of the project!

Foto_003

While part of the team got the electrical work done, the other members made the kick off on developing the code. The Raspberry Pi detects changes in the state of the toilet latches and sends a message to the server, along with the toilet ID, informing it if toilets are locked or not. We call our Raspberry Pi a minion. From time to time, the minion sends a “keepalive” message just to make us sure it’s still working.

Foto_004

Our server application has two components. The first component, which we call the master, is responsible for the communication with the minions. It processes messages and saves the state of each toilet. The second component, which we call the monitor, is responsible for answering requests about the state of the toilets. The monitor provides a REST API so that all our developers can build clients on top of it.

For now, we’ve got a little web site made by the XERit team (as a release offer) and a plug-in for Sublime Text built by another developer from our company!

Foto_005

Foto_006

XERit has very few hours of development. There is a lot of stuff to improve, but we are proud that XERit has already become part of our office life, a huge success!

We have expanded the office to another floor, so the next thing to do is to install XERit in the new bathrooms.

Our current focus is to find the best way to connect the sensors and the Raspberry wirelessly. This is the first step towards simplifying the installation of XERit. We would also love to get rid of the PowerLine. It is cool, but it needs to be manually synchronized from time to time.

On a programming level, the team is working on the system configuration. Right now, every new device needs to be hardcoded into the application and every sensor needs to be manually matched to its toillet. We want the system to be fully configurable by any user, so anyone can add a new device or manage an existing one.

Regarding the Design…, well… we are hoping that someone in our cool design team will come to our rescue! Guys, we really need your magic!!!

Working on XERit was so much fun and turned out to be so useful that we can’t stop thinking of what’s coming next. We can only say that it will be big! Stay tuned!

Xerit Team - Filipe Roxo, Joana Fernandes, Paulo Oliveira

comments powered by Disqus