Home Automation Project

by jrvolkers in Workshop > Home Improvement

13 Views, 0 Favorites, 0 Comments

Home Automation Project

IMG_0959.jpeg
IMG_0961.jpeg
IMG_0960.jpeg
home auto

Stop missing notifications with a flashing LED for important notifications

Supplies

Materials

  • Particle Argon
  • LED light strip
  • Breadboard
  • Iphone
  • Soldering Iron

Software

  • iOS Shortcuts
  • Neopixel Argon Library

Preparing LED Strip and Breadboard

IMG_0963.jpeg

First you must solder the wires to prepare the LED strip, as they come with no wires already attached. I would recommend using black for the ground pin, red for the 5v and yellow for the Din, however the colors are not required it just helps with organization. Next you should wire the 3v3 pin and gnd pin to the trenches at the sides of the breadboard, and tie the trenches on either side together(shown below) with more wires to make the wiring later easier. It is recommended to use black for ground and red for 3v3, but again, it is not required, it just helps to understand what is going on at a glance.

Wiring

chrome_cdUIucABuJ.png

The wiring diagram is pretty simple and is shown above. Note that I used tinkercad to provide a cleaner and easier to understand diagram, however they dont have the argon as a device. However, the names of the pins and the locations on the breadboard will remain the same.

Code

Screenshot 2023-01-30 12.50.18.png
Screenshot 2023-01-30 12.50.50.png

This is example code for the project. There is seemingly extra code that does nothing, but this will be addressed in the conclusion

Building the Container

IMG_0965.jpeg
IMG_0964.jpeg

This is the container I built, mostly because it kept the device looking more organized, but making your own design to fit your needs better could benefit you by fitting into your workspace more naturally.


the first step is making the U shaped piece that will fit on top. A tip for this is to cut a single layer deep on the side of the cardboard that you want to bend out, in between the lines in the cardboard you should then trace and cut out the slot for the LED strip. The size of the cut should be based on the size of the LED strip that you use, and you can customize the size to fit your needs better. The next step is to find a large piece of double-layered cardboard, and the goal is to cut along the sides of the lines on the cardboard to make a slot for the U piece to fit into. You could decide to try a better method of doing this or using tape or glue to secure these pieces together more permanently, however I used this because it is easier to take apart while you are testing and if something goes wrong.

Making a Webhook

megb9oV3eg.png

Webhooks are the key to making this project work, as when it triggers the event it publishes the webhook to make it flash the LEDs. To make a webhook you first must get an access key here https://docs.particle.io/reference/cloud-apis/access-tokens/, then you need your device id as shown in the picture. To navigate to this section, you hit devices on the side bar in the particle web ide, find the device you plan on using and hit the dropdown arrow. You then make a link with this format https://api.particle.io/v1/devices/(deviceID)/(name of funtion)/?access_token=(access token)

IFTTT Setup

IMG_0970.PNG
IMG_0969.PNG

Using the link you made in the previous step, you simply create a IFTTT even on the iOS app as shown. For the if, you must search for shortcuts and then iOS shortcuts, and for the then you search and select webhooks, and in the url section you copy and paste the link you made yourself, making sure the method is set to post.

Iphone Shortcuts

IMG_0971.PNG
IMG_0972.PNG
IMG_0966.PNG
IMG_0968.jpg

In the iOS shortcut app, you will need to set up automatons that will first detect your custom triggers and use that to trigger your event you made on IFTTT. I am on iOS version 16, which allowed these things to work, though note overtime apple has changed how the shortcut app works and what automatons are available, so some of these options may change, and there may be better ways to do what I did or potentially other more useful triggers.


To create a new iOS shortcut automation, you open the shortcuts app, hit the automation button at the bottom middle of the screen, then hit plus and create personal automation. You are then presented with a screen of many options for ways to trigger events. I used the email and message triggers but others are available for you to try out.


For the automatons that I used, the first one triggers when I get a text from my parents, but whoever you deem important enough to want to be notified of can go in there. You should change the automation to trigger an IFTTT event, and then set that event to the one that you made in IFTTT in the previous step. Using this method, a good idea could be to make custom lighting changes or trigger other events based on who you receive a message from, but for my usage it is mostly unnecessary.


For the next series of notifications, it is a little time-consuming but is the only way I found to trigger the event every time. You select the trigger as an email notification, and I selected only my school email, but a personal email or business email would work the same. There is no option to select all emails, so you must choose to filter based on subject contents or senders. I chose to make my triggers activate if there was any vowel in the subject so that no matter the email it would go off. This is a little time-consuming because the iOS shortcut app will not allow you to have all of the vowels as things to set off the shortcut and you have to make a separate one for each vowel to ensure 100% that they will set it off, however for a less important use case you could be more specific in what sets it off or have it only set off when it sees a certain letter, this is less accurate and won't go off with every email, but takes less time and will get a good amount of them.

Reflection and Problems

While working on this project I had many ideas and things that didnt work. I had planned on having more things be able to set off the event, but iOS shortcuts only has a limited number of automation shortcuts and what I did is the majority of notifications that I get anyway so I abandoned the idea early. I had also tried to have a vibration sensor connected to the spot where I always put my phone down while I am at home, but while testing it I found that your phone vibrating is not strong enough to set off a normal high sensitivity vibration sensor, and while trying to find some device to amplify and set off the sensor I ended up breaking the fragile wire that connects them. While I dont think this is a bad idea in concept, if you would like to try it yourself I would try to find the highest sensitivity sensor you could find (maybe a high-sensitivity analog sensor would be a little better), and I would also think about where you are going to place it relative to your phone and if there is any way that you could find to amplify the movement of the sensor when you phone vibrates.