To see the Slackbot in action there is a short video of it here:
I have included a summary of the project in PDF format here for reference
At this point I was ready to design and build the final Arduino setup. The setup included
- 4 Button switches for each message
- 1 Temperature Sensor
- Arduino Yun Board
I finalised the code and messaging in the Arduino IDE, testing and finalising a good interval for the temperature check. I ran some final tests and was ready to assemble.
To create the Laser cut box I setup and measured the physical components needed to fit in the box unit. I laid out the requirements in Illustrator and printed the file to paper prototype the size and shape. Once I had tweaked the final version I was ready to have laser cut in the workshop. At this stage I also began to think of final finish – gold and black paint were going to add a touch of retro feel.
As covered above I had prototyped all elements of the design solution. At this stage I was going for full execution. I sketched up some simple ideas and the final design would include:
- A laser cut box to house the Arduino Setup
- The box would ideally sit next to the kettle
- A user would be able to hit one of the 4 actions when they are making a cup of tea.
- The four buttons would include
- A message to ask who wants tea?
- A message to ask who wants coffee?
- A message to send a random funny GIF to lighten the mood
- A message to send some ‘Design inspiration’ as link to a blog post
- The box would also contain a temperature sensor that if the room went above a set temperature it would alert the studio to open doors and windows
- ThingSpeak would track the number of button presses so we could see how many cups of tea/coffee the studio went through in a day
in order to speak to Slack you need to setup an Incoming Webhook which allows you to send data in to Slack in real-time. Pretty nifty! For this I setup a new webhook on our Slack team and setup a private channel for testing. There are a few customisations you can do:
- You can customize the name of the BOT who speaks to Slack
- You can customize the icon to represent the BOT
- You can customize the messaging format and style
The text content or message contents is passed over by ThingSpeak as part of your POST data. This allows you full control on what you would like it to say or when it should say it.
With the ingredients coming together and tested I now had to decide on how to scale and design my final solution.
The 3rd Party API service I settled on is called ThingSpeak. This is a free to use service for building Internet of Things services. It is an Open Data platform that allows you as a developer to create ‘Channels’ which you can POST data to. For this ThingSpeak provide you with an API key and an endpoint (URL) to send your data to. This was possibly the biggest challenge in the process as Yun boards are incredibly flaky when you try to communicate over HTTP or HTTPS. After several code iterations and talking on forums I was able to get the Yun board to post the temperature data every 15 seconds to ThingSpeak.
With this completed it was then on to figuring out how to connect to Slacks API. Luckily ThingSpeak have a well documented method for this on their community forumns and it makes use of their ‘Apps’ feature. In essence what this ‘App’ does is it waits for new data and when it has it then you can tell it what to do next. For this project I would be bouncing the data over to Slack
In order to move forward with the concept I needed to start quickly prototyping the technical solution. As the process was not something we had covered in the starter kit I carried out extensive research in to how to achieve the solution. At this stage the following was becoming apparent:
- The setup would require an Arduino Yun board for Wifi
- I would need to connect to a 3rd party API to detect changes in the sensors
- I would then need to send a message to Slack (Cloud-based team collaboration tool) API
I quickly built a simple circuit with a single button connected to a Yun board. There were some initial hurdles to overcome with Wifi connectivity but essentially I had the Yun board programmed up as required.
With our background in Arduino established I began to brainstorm and conceptualise a potential response to the brief. One of the initial sketches I completed was focused around building an object for the studio. The potential area of focus was around how the kettle is used in the studio. I was eager to see if I could have the kettle speak to us in some way. I set out the following goals for the project:
- The object should fit in the current routine of our studio activities
- The object should communicate over a live channel such as Slack
- The object would store data through an API