Have you ever wondered how long your dog sleeps while you’re away at work? I have. As a hacker this seemed like the perfect excuse to strap a microcontroller to my dog, Gif, and see if I could find out. To make it a little more fun I thought I could have it text me when Gif wakes up to let me know how long he slept for. In this post I’ll show how to build your very own sleep tracker for your dog using Tessel and Twilio.

Pre-reqs:

Getting Started With Tessel

Tessel is a Node.js-compatible microcontroller with built-in Wi-Fi. As a JavaScript lover I fell in love with this device as soon as I started using it. If this is your first time working with a Tessel I’d recommend working through their quick start. Before you start make sure your Tessel is running the most recent firmware and connected to a Wi-Fi network. The first thing thing we’ll do is setup your Tessel to send an SMS via Twilio.

Sending an SMS from your Tessel

We’ll start by setting some default values and requiring the libraries we need: