At a recent lunch, a discussion started about how we love free food here at Credera. Often throughout the week, leftover food from some event is placed in our kitchen and whoever put it there will post in Slack that it’s up for grabs. The better the offer, the quicker you better get there before it disappears. At some point during the discussion an idea formed: Wouldn’t it be awesome if when you put food in the kitchen, you could just press a button that would take a picture of whatever food you are offering and have it automatically post a message to Slack? With that idea, CrederaFood was born and the journey of working on my first Internet of Things (IoT) project began.
At a high level, the project seemed simple: Make a device that can respond to a button being pressed, capture an image, and send a message to our Slack workspace. However, as I began to dig into the details, I realized that a significant amount of research and planning would have to be done on my part for this project to be successful. Determining what hardware met my requirements and creating a functional program were the two key pieces I needed to focus on.
After doing a little research, I chose Raspberry Pi as my computing device. The Raspberry Pi platform has been around since 2013 and there are numerous websites and blog posts available to help a beginner. Also, the onboard Wi-Fi and the ability to natively support an external camera reduced the headache of having to figure out how to integrate those hardware components.
My original vision for the button a person would press resembled something close to a doorbell physically wired to the Raspberry Pi device. Though, after contemplating the idea of wires hanging down from the kitchen counter, I abandoned that plan. Luckily for me, I stumbled upon a nifty program called amazon-dash. This program repurposes one of Amazon’s Dash Buttons, normally used for reordering products from Amazon, to execute a function of your choice when the button is pressed. For this project, I used it to run the CrederaFood application script.
Python is the official programming language for Raspberry Pi and its OS, Raspbian, which is preloaded with Python development tools. I had never written anything in Python before, but with help from online resources, it was fairly simple to learn. By leveraging a few existing Python modules, such as Picamera, which interfaces with the attached camera, and SlackClient to communicate with our Slack workspace, a functional script came together in a relatively short amount of time. Slack did take some configuration to set up an app and generate the authentication token used by the script. You can find the script in its final form here.
After troubleshooting some Wi-Fi connectivity issues between the Raspberry Pi and the dash button, CrederaFood was up and running! With the initial success of this pilot project, some ideas of how we could expand CrederaFood have come up, such as a notification going out when there is fresh coffee.
lessons learned for future iot projects
Even though the use case of this project may seem a little superfluous, it is a great example of how to start with a simple idea and turn it into a functional IoT solution. The lessons learned from this project will help create a pattern to use for future IoT initiatives.
define the scope of the project
To start the process of taking an idea and turning it into a real IoT solution, it is essential to define what exactly it is you are wanting to accomplish, what problem you are attempting to solve, or what functionality you are looking to create that doesn’t currently exist. Additionally, the questions of who or what interfaces with the device, what data needs to be collected, and how the device transmits that data need to be carefully thought out. A clear vision of what you want to accomplish and your specific requirements will pay off throughout the validation and building processes.
validate functionality before spending money
With the scope of the project defined, the next step is to validate that the existing hardware and software available to you can be used together to achieve the project’s desired function. Validating that the needed hardware exists is fairly straightforward as they are physical devices each serving a particular purpose. The application running on that hardware will be the more difficult part of the project since you will be the one defining how the program functions and interfaces with the different devices. Before you spend money on hardware, make sure your software can meet your requirements.
be flexible during the build and deployment process
The build phase of your project can be the most fun part, as you finally get to bring everything together and begin to see your original idea become a functional solution. Yet this phase can also be the most frustrating part. Imagine if the parts didn’t fit together the way you wanted them to and what was just working now doesn’t function at all. Patience is key during this part of the project. Don’t let your frustrations get in the way of troubleshooting and overcoming challenges.
explore the potential for additional projects
Once the project is complete, take time to think about how this solution could be adapted to meet other needs. IoT projects can be an enabler for new opportunities or even used to optimize existing solutions, and the knowledge gained from each project allows for faster and better innovation.
ready to jump in with iot?
Whether you already have some IoT solutions in mind or if you need some help exploring ideas of how IoT could benefit your company, Credera would love the opportunity to be a part of your IoT journey. Feel free to contact us at email@example.com. Get building!