loading

Hi today I will be showing you how to make a tweeting Arduino alarm with a PIR sensor.

You will need:

  • A parallax PIR sensor 3 pin
  • Ethernet cable
  • Ethernet shield (i use this one)
  • Breadboard
  • Arduino UNO
  • 6 jumper wires

Step 1: Wiring the Thing Up!

  1. First you'll need to attach the ethernet shield to Arduino.
  2. Attach the PIR sensor to the breadboard.
  3. Wire up the PIR. ( gnd goes to -, vcc or anything like that goes to +, out goes to pin 7)
  4. Attach ethernet cable to seeeduino ethernet shield v 1.1.

Step 2: The Code

#if defined(ARDUINO) && ARDUINO > 18   // Arduino 0019 or later
#include <SPI.h>
#endif
#include <Ethernet.h>
//#include <EthernetDNS.h>  Only needed in Arduino 0022 or earlier
#include <Twitter.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = {<<<a open ip here>>>};
// get your token from http://arduino-tweet.appspot.com
Twitter twitter("<<<token goes here>>>");
int alarm = 7;
int lever = 6;
int greenLED = 4;

void setup()
{
   delay(1000);
  Ethernet.begin(mac, ip);
  Serial.begin(9600);
  pinMode(alarm, INPUT);
  pinMode(lever, INPUT);
  pinMode(greenLED, OUTPUT);
}

void loop() {
if (alarm == HIGH)
{
   twitter.post("alarm activated");
}

else
{
  digitalWrite(greenLED, HIGH);
}


}
<p>Great job on this. I'm trying to use it as well but I'm receiving an error in the &lt;&lt;&lt;a open ip here&gt;&gt;&gt; line and the &quot;&lt;&lt;&lt;token goes here&gt;&gt;&gt;&quot; line. When I replace those lines with my internet name and my twitter token, it tells me they are not defined or something similar. Any ideas of what to do? Maybe I am missing a basic concept here as I am new to arduino.</p><p>Thanks!</p>

About This Instructable

2,465views

11favorites

More by aidnevigue:Tweeting Arduino Alarm with one PIR sensor. aka AlarmIno 
Add instructable to: