Building a sip detector — Combining Machine Learning and IoT

Andrew Steinheiser
Octoblu Engineering
2 min readMar 23, 2017

After recently receiving one of Intel’s new Tiny Tiles, I wanted to create something interesting that utilizes the built in functionality of the board. With an onboard accelerometer and Bluetooth Low Energy capabilities, I considered creating a device that detects when a sip is being taken from a koozie. Thus the Connected Koozie was born…

The koozie was connected to Octoblu and used to change a light when a sip is taken

The Connected Koozie was made possible through a support vector machines library, Meshblu’s messaging platform, and a little bit of sewing.

The support vector machines library I used is called node-svm. SVMs are supervised learning models that analyze data and recognize patterns (Wikipedia). So basically, what I had to do was create a training set of data to feed my SVM. Initially, I had the Tiny Tile send accelerometer data over BLE to a script I wrote. The script output the accelerometer’s position and a boolean to a JSON file. The boolean represented whether or not the koozie was in a ‘sip’ position. After I had enough data points in the file, I used node-svm to create a prediction model.

With my new prediction model, I created a connector to send ‘sips’ to Meshblu. My connector uses the prediction model to determine what accelerometer values indicate a ‘sip’ is being taken. When the Connected Koozie is in ‘sip’ position, a message is sent to Meshblu.

Finally, I had to cut out a piece of another koozie, and sew it on the Connected Koozie as a pouch for the Tiny Tile.

Moving forward, I want to use the messages from the Connected Koozie to potentially facilitate a drinking game or track the amount of water I’m drinking each day.

If you would like to see the code for this project, it’s available on my github. I also wrote up an in depth guide on how to create your own Connected Koozie on Hackster.

--

--

Andrew Steinheiser
Octoblu Engineering

ASU 2018 Computer Science Engineering Intern at @octoblu #IoT #Reactjs #johnnyfive