background img
Nov 17, 2017
100 Views
0 0

DIY IoT

Written by

Introduction

There is something magical about a once dormant object, suddenly springing to life and “knowing” something about it’s universe. The magic of the Internet of Things (IoT) doesn’t come from its technical prowess, but from its creative applications and endless possibilities. The term “Internet of Things” generally refers to the integration and proliferation of networked computer systems into the physical world. An IoT device is a physical object with any number of sensors and/or actuators accessed across a network. Read more about IoT, Home Automation & Intelligent Personal Assistants.

Initially, we were not that enamoured with the technology itself. Smart devices are nothing new (remember the bluetooth craze?) and many of them are superfluous marketing ploys. Although the gimmicks aren’t going anywhere, the technology is definitely changing. In accordance with Moore’s Law, IoT devices are now small, efficient and cheap enough to be integrated into common industrial & household electronics. The hobbyist and physical computing movements have exploded, and thus so has IoT’s proliferation into experiential advertising.

The purpose of this R&D cycle was: to gain a greater understanding of the IoT ecosystem; build a foundation for future IoT projects & experiments; increase the department’s knowledge of physical computing; and to raise the company’s awareness of experiential advertising. At the end of the cycle we aimed to have: an infrastructure for IoT devices & office automations; a functional IoT prototype for the office; a couple office automations; and a bot integration. Fortunately we don’t have to build all this from the ground up. Source Code

Connected Conference Room

We wanted to build something simple and practical. When working in the office, it isn’t uncommon to start a conversation which then leads to an ad hoc meeting in one of the board rooms. We thought it would be useful if we could immediately know: a) which rooms are available just by glancing around the room and; b) if the boardroom does have people in it, is it booked in the Google calendar? Our solution was the “Boardroom Beacon”.

The Boardroom Beacon is small physical device mounted to the exterior wall of a boardroom with a motion sensor mounted inside. It has 3 lights indicating the room’s availability for the next hour and a half. Each light represents a half hour meeting allotment in chronological order: current, next and last with statuses: available (green), booked (red) and illegal (yellow). An illegal status is triggered if the room is not booked but the motion sensor detects someone in the room (illegal!). The idea is that anyone in the office can take a quick look at a given boardroom and quickly see if it is booked or not.

There are two main components: an automation server to manage and store state, and an MCU with actuators to display said state. The IoT device itself is a Particle Photon, 3 LED lights, an IR motion sensor, a 3D printed enclosure & a power source. For automation, we decided to go with Home Assistant (HA) python server, hosted on a Raspberry Pi. Home Assistant is fairly robust and comes with ample out of the box IoT integrations. It also has a nice GUI where we can view and trigger state changes, to cross reference with actual physical devices. To allow the two to communicate we used Mosquitto MQTT server. MQTT is a lightweight publish subscribe based messaging protocol, designed for low-bandwidth, high-latency networks. Each boardroom has its own Google Calendar so we used the Google Calendar API to fetch the room’s event data.

How it works:

  • The Boardroom Beacon subscribes to its topic on the MQTT server hosted on the Raspberry Pi.
  • The home automation server queries the Google Calendar API for the status of available time slots for a given boardroom.
  • The home automation server then publishes the results to the MQTT server.
  • The Boardroom Beacon receives the update and displays the results as three coloured LED lights, the light representing the time slot and the colour representing its status.
  • If the motion sensor inside the boardroom detects motion, it notifies the Photon and, if the room is not booked, the LED light representing the current time slot turns yellow.

We started by installing our Home Assistant and Mosquitto (MQTT) servers on a dedicated Raspberry Pi . We then wrote a custom component (based offGoogle Calendar Event) to communicate with the Google Calendar API. Our component subscribes to a room’s calendar, polls for upcoming events and cross references those events with the relevant time slots for the room.

The code for the Boardroom Beacon (IoT device/Photon), is relatively straightforward and is written in arduino language with some custom Photon methods built in (e.g. subscribing & publishing). It simply subscribes to the rooms MQTT topic, listens for updates from the motion sensor and displays the results. Booting, connecting, and malfunction statuses are indicated by specific flashing led colours.

For the Boardroom Beacon’s circuit, we prototyped with a breadboard and diagramed the schematic with Fritzing.

Once the schematic was finalized, we soldered the circuit to a proto-board and hardwired everything together.

The enclosure design was probably the most time consuming aspect of the project. We’ve had some questionable results with 3D printing in the past, so we decided to go with a wood enclosure, designed in Easel (gcode) and milled by an X-Carve CNC machine. After a couple of designs we realized it was not the right material for the job and not having the X-Carve on site meant longer design iterations.

We did some research and found some handy techniques on getting a nice finish for 3D prints. We used Sketchup for our 3D modelling and a Lulzbot 3D printer for the prints.

When designing enclosures, form factor and materials are key considerations. It is recommended to mockup your design on paper and iterate with cardboard cutouts before going through the lengthy printing process. Measure twice, cut once!

As touched on earlier, we never felt that the finish on 3D prints was good enough for public facing parts. By following these steps I managed to get a reasonably smooth surface with no step lines, dips or cracks:

  1. With a putty knife spread bondo putty all over the surface of the print, filling step line gaps.
  2. After it has cured, sand with 220 grit sand paper to get rid of bumps.
  3. Sand with briefly with 400 grit, then 600 to polish off.
  4. Apply 3 coats of acrylic primer and let dry.
  5. Assemble the parts with their screws to make sure sanding & priming hasn’t changed the form factor too much.
  6. Sand any primer globs down or poorly aligned parts with 220 grit and apply one layer of primer again
  7. Apply 3 coats of acrylic paint
  8. Apply 1 coat of acrylic varnish

The final assembly involved soldering & screwing every together and mounting the device on a wall.

We wanted to go through the entire production cycle from prototype, to product design, to assembly, within less than 3 weeks, so we had to keep it simple. We focused on implementing the key features of most IoT devices and establishing a foundation for more ambitious projects in the future.

Challenges

Code

Most of our challenges related to the physical device. Single physical devices don’t demand a lot of state management and the code to make them work can usually be maintained in a single file. With the exception of writing code in languages that we don’t professionally use (Photon’s version of Arduino Language/C/C++ & Python), the code was relatively straightforward.

Product Design Iterations

If you can’t fabricate on site, a design iteration will usually be more than a day. If you are lucky enough to have an onsite 3D printer, CNC machine or laser cutter, you can probably fit a few in per a day. Our 3D prints took on average of around 2–3 hours per component (base, faceplate & mount). I tried to keep all the tricky bits in one print to minimize the number of iterations. You should have all your measurements and know how things can fit together before you start fabrication. Clean lines, dimensions, screw specs, mount and power are important considerations.

Power

For a power source, we tried using a cell phone charger/battery with a capacity of 2200mAh. It only lasted around 6 hours so we decided to hardwire it to a wall socket. Figure out what kind of capacity you need as it will dictate how and where you can place or mount your device.

Parts

Ordering parts takes time. Verify that your local maker shops have what you need. Mock up your circuit and figure out what you will need well ahead of time. Parts cost money and your budget will obviously impact your shopping list.

Next Steps

Part of our R&D cycle experience is about how we can bring new ways of doing things into our process. We decided to set up a ‘makerspace’ where we could prototype pitch ideas and encourage team members to experiment. Below are some offshoot projects that we did and some future (for fun) projects that we have lined up.

Future Projects

  • Birthday Notifier with Slackbot Notification & Sonos track.
  • Do Not Disturb button — Light mounted outside of an office indicating someone is on a call.
  • LED Matrix Lounge — DMX controller & api for office lounge ceiling lights ( led matrix)
  • shh! Meter — When office volume exceeds a given level a prerecorded Sonos track plays
  • QA Device tracker — Load QA devices with presence detection software to track location with iBeacons

Conclusion

IoT devices aren’t just products; they’ve become vehicles for companies to create more personal relationships with their customers and teams. They often engage people in ways that encourage active participation, rather than being passively bombarded by irrelevant content. IoT is integral to the growth of experiential advertising and in finding new creative ways to connect with people. You can find the project source code here.

 

By Brendan Neufeld

Article Tags:
· ·
Article Categories:
DIY