Home > Projects > How To – DIY – Projects > Create an Applescript/Arduino Alert flag. using arduino

Create an Applescript/Arduino Alert flag. using arduino

Summary of Create an Applescript/Arduino Alert flag. using arduino


This Instructable guides users in creating a physical email alert system for Macs using an Arduino. By connecting a servo motor to the Arduino, the setup triggers a small flag to rise when specific alerts occur, such as new comments on Instructables. The project utilizes AppleScript to communicate with the Arduino via serial connection, offering a tangible notification method beyond standard computer sounds.

Parts used in Create an Applescript/Arduino Alert flag:

  • An Arduino (Duemilanove or Diecimila)
  • A Flag
  • A 47 Ohm resistor
  • A Servo
  • Wires to connect the Arduino to the Servo
  • Tod Kurt's Arduino Serial C code

Have you ever felt like the mail sound on your Mac just wasn’t enough? Simple sounds and alerts just don’t cut it for you? You want something more apparent and rewarding? If so, this is the Instructable you’ve been looking for.

In this Instructable, I’ll show you how to hook up your Arduino to your Mac and throw up an actual flag when the alert of your choice occurs. In our example, we’ll be doing an email alert, but you can use AppleScript to call this when almost anything happens.
Create an Applescript
I’ve created a little Instructables flag to go off when I receive comments on my instructables.

Let’s get started!

Step 1: What you Need

Hardware:

An Arduino: I know at least that the Duemilanove and the Diecimila will work. I don’t know if older board versions will work.

A Flag: I made an instructables flag to alert me when I get instructables comment.

A 47 Ohm resistor: This is to prevent the Arduino from resetting at the close of a serial connection

A Servo

Wires to connect the Arduino to the Servo. My wires were a bit longer than needful.

Software:

Tod Kurt’s Arduino Serial C code. Tod put this code up which makes it tremendously easy to communicate with the Arduino. Files included here. For more info look here:
http://todbot.com/blog/2006/12/06/arduino-serial-c-code-to-talk-to-arduino/

– Arduino Code

– Run Flag Applescript

Step 2: Setup the Arduino

We need to get the physical side of this equation set up first.

Out of the Servo, There are 3 wires: Voltage, Ground, and Control. In this setup, we’re plugging those into 5v, Ground and Pin 9.

Also, we’re going to put a 47ohm resistor into the 3v3 pin and the reset pin. This will prevent the arduino from resetting every time there’s a serial connection closed. This was a real pain for me to deal with early on, I’d written the software to handle the reset with a delay, but it wasn’t ever working the way I wanted it to. Resistor solves that problem easily.
Create an Applescript
Note: According to the source I got this from, the Resistor causes an excessive 20mA current in the Arduino when the reset button is pressed. The person who tested it said it’s outside of specifications, but still worked. Avoid resetting the Arduino when you have the Resistor is connected.

Software
Load the included software onto the Arduino. Make changes as you see fit. Essentially, you’re sending a 0 or a 1 to the arduino, and it’s going to turn the flag up or down based on that.

 

For more detail: Create an Applescript/Arduino Alert flag.

Quick Solutions to Questions related to Create an Applescript/Arduino Alert flag:

  • What is the primary purpose of this project?
    To hook up an Arduino to a Mac and raise a physical flag when a chosen alert occurs.
  • Which Arduino board versions are confirmed to work?
    The Duemilanove and the Diecimila are known to work, though older versions are unconfirmed.
  • How do you prevent the Arduino from resetting during serial connection?
    By placing a 47 ohm resistor between the 3v3 pin and the reset pin.
  • Can this system be triggered by events other than email?
    Yes, you can use AppleScript to call the flag when almost anything happens.
  • Which pins should the servo wires be connected to?
    Connect the servo wires to 5v, Ground, and Pin 9.
  • What software is required to facilitate communication with the Arduino?
    You need Tod Kurt's Arduino Serial C code along with custom Arduino code.
  • What values does the software send to control the flag?
    The software sends a 0 or a 1 to turn the flag down or up respectively.
  • Is there a safety warning regarding the resistor installation?
    Yes, avoid pressing the reset button while the resistor is connected due to excessive current flow.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top