Blog #4 - Event triggering with IFTTT

 IoT mini Project - Security Lock 

Dean Sinnott, 20067691

IFTTT applet

In this lab, we were introduced to a cloud-based IoT platform called IFTTT, short for IF THIS THEN THAT. 

IFTTT allows users to connect different devices together by setting up simple rules, where one event automatically triggers another. These are known as applets.  

As a class we messed around with many of the pre-built applets available to the free account on the IFTTT site. Some provided great insight into the new technology and others just did not work. 

I focused on creating an applet that would send an email notification when a micro:bit detected movement. This was my first time working with IFTTT and with the concept of webhooks. These are special URLs that can be triggered by other systems to start an action. In this case, the webhook URL was connected to an email service. 

I had to upgrade to a pro account to access more useful IFTTT events but there was a free trial option.

Structure of sent email


My Setup 

I did not have access to a cloud expansion board at the time so I used a USB serial connection to link the micro:bit to my laptop. The micro:bit was programmed to detect a shake/ movement, using the built-in accelerometer. When it detected movement it wrote "SHAKE" to the serial port. 


Micro:bit code block

On the computer side, I ran a small Python script that constantly read the serial data. When it saw "SHAKE", it made a request to my IFTTT webhook URL, which triggered an email to be sent to my student email address. 

python script







What I Learned 

This was an extremely practical way for my to improve my thinking on how cloud serveries and physical devices can be connected. IFTTT made it easy to setup automation, and using serial connection as a workaround for missing Wi-Fi hardware showed me how flexible theses systems can be.

I also learned how webhooks act like bridges, connecting small inputs (like sensor readings) to bigger cloud-based actions (like sending emails). 

Future Improvements 

If I had access to a cloud board, I could make this setup completely wireless, allowing the micro:bit to send the webhook directly. This would remove the need for a laptop in the middle and make the idea more suitable for a real-world security or alert system.

It was noted on multiple occasions that there would be severe delays in triggering the applet which would then cause the backlog of requests to trigger all at once. Another improvement I would make in the future would be to remove my decency on the IFTTT platform and instead use my own lightweight web server (e.g. Flask). This would give me full control.

Comments

Popular posts from this blog

Blog 2 - HRV Demo

Week 1: HRV Review

Lock In Day 1 (20/05/25)