Services are the software apps we use every day to connect with physical objects and obtain data from mobile devices. The gateway to managing these services for physical connectivity can be achieved by using applets with embedded hardware. There’s a website, called IFTTT (IF This Then That), which allows users to use services to build personal applications to monitor a variety of conditions and provide notifications on their smartphones and tablets. In this blog, I’ll further explore services and applets along with details on building a simple IoT appliance device using an IFTTT applet, an Arduino, and a cloudBit.
|The IFTTT website provides a variety of applets for consumer and mobile device platforms. (Source: IFTTT)|
IFTTT is a website that allows users to build applets which are operated (triggered) by physical or online services like microcontrollers, Facebook, Gmail, Instagram, and Twitter. The website is free and the applet uses conditional statements as the operational foundation for the target service. As an example, suppose a user is interested in tweeting a certain hashtag based on sending an email. An applet can be built using an IFTTT conditional statement service. Another example of using IFTTT is a photo will be stored in the cloud when someone on Facebook tags a user. IFTTT has gone through several design iterations of its website where a variety of applets have been built by an active developer community.
|IFTTT provides a variety of applets to choose from, built by the developer community. (Source: IFTTT)|
IFTTT Deep Dive
|ESC Boston is back! Get ready for an expanded, expert-led program over two full days, May 3-4, 2017. Part of America's largest embedded systems industry conference series, ESC Boston gives you the chance to drill down into four tracks covering embedded hardware, embedded software, connected devices and the IoT, and advanced intelligence.|
CLICK HERE TO LEARN MORE!
The applets provided by IFTTT use the following web-based development concepts:
- The basic building blocks of IFTTT are services. Services, once known as channels, is a series data description from websites like Twitter or Instagram. With the use of APIs (Application Programming Interfaces), a service can describe control actions like posting photos to a target website. To accomplish control actions requires an event or trigger to occur within the service.
- Triggers are items that produce a physical action to occur in a service. Receiving notifications based on accelerometer data from a mobile device is an example of a trigger. Keywords or phrases can also be used as triggers.
- Actions are the physical output of an applet. They occur based on a trigger operating within a service. Operating a Philips Hue LED light bulb when rain is forecasted by the weather service is an example of an Action.
- Applets are based on triggers and actions. Applets were also called recipes in the initial development of IFTTT.
- Ingredients allow the user to customize the body data within the applet. Examples of body data are subject, device name, attachment, received date, and the sender’s address. The applet’s ingredient is easily changed using a small HTML template.
Although IFTTT applets provided on the website are built with triggers and actions, they can be customized by changing the small application’s ingredient settings.
An IoT IFTTT Appliance Device
|A HTML template is used as a tool to change the ingredient settings of an applet’s body data.|
(Source: IFTTT and Don Wilcher)
With an understanding of an IFTTT applet, I’ll discuss how to use the web-based tool in building a simple IoT appliance device with off-the-shelf components. The basic operation of the appliance device is to send an email when a littleBits cloudBit is triggered. The +5V trigger is wired to the input pin of the cloudBit. Although a pushbutton bit can provide the trigger, I wanted to repeat the signal automatically using a microcontroller. The original design concept was to use a TI MSP430 Launchpad platform as the microcontroller trigger device, but I discovered that a 3.3V signal is not compatible in activating a cloudBit. I wanted to build a simple design without complicating it with a voltage level converter IC solution, so an Arduino was selected as the trigger for the cloudBit.
|An email will be sent when the cloudBit is triggered by an Arduino. (Source: Don Wilcher|
The wiring diagram I developed to provide the automation trigger from an Arduino to the cloudBit is simple to build using a few jumper wires, a USB power bit, and two proto-modules. The Arduino code I used to provide the +5V trigger to the cloudBit is the Blink example within the microcontroller platform’s IDE (Integrated Development Environment). The Blink code was modified to provide a trigger to the cloudBit every 10 seconds.
|The IoT IFTTT Appliance Device built with a cloudBit, a few supporting littleBits electronic modules, and an Arduino. (Source: Don Wilcher)|
The cloudBit will send an email every 10 seconds to my AOL account based on the described modified Blink code change.
|Email message sent by cloudBit. (Source: Don Wilcher)|
To make the email message more personalized, I changed the ‘00e04c038f34’ body device name to my alter ego of ‘MrD.’ The body device name change was made using the ingredient setting within the cloudBit applet.
|Changing the body device name (MrD) is conveniently done through the cloudBit applet’s ingredient setting. (Source: IFTTT and Don Wilcher)|
The new email received shows a successful ingredient setting change.
|The alter ego ‘MrD’ body device name is displayed on the email message. (Source: Don Wilcher)|
The IFTTT platform allows adding applets to your mobile devices easily using web services. Also, with a little bit of electronics and coding, the applets can be made to build IoT physical devices, as well. Additional information on IFTTT applets and development tools can be found on the website
Don Wilcher is a passionate teacher of electronics technology and an electrical engineer with 26 years of industrial experience. He’s worked on industrial robotics systems, automotive electronic modules/systems, and embedded wireless controls for small consumer appliances. He’s also a book author, writing DIY project books on electronics and robotics technologies.