Smart Mailbox

details

This project is about a smart mailbox using arduino and temboo which is cloud service. It can know whether mail has been received or not in the mail box using capacitive sensor. If mail box has a mail, It will send e-mail to your gmail through cloud service. And then you can get e-mail whether mail box is empty or not.

 

Picture of Wat heb je allemaal nodig?

 

I want to introduce this project because I think it is interest and usefull project in real life.

 

Code

/* Setup shield-specific #include statements */
#include 
#include 
#include 
#include 
#include 
#include 
#include "TembooAccount.h" // Contains Temboo account information

byte ethernetMACAddress[] = ETHERNET_SHIELD_MAC;
EthernetClient client;

int numRuns = 1;   // Execution count, so this doesn't run forever
int maxRuns = 10;   // Maximum number of times the Choreo should be executed

void setup() {
  Serial.begin(9600);
  
  // For debugging, wait until the serial console is connected
  delay(4000);
  while(!Serial);

  Serial.print("DHCP:");
  if (Ethernet.begin(ethernetMACAddress) == 0) {
    Serial.println("FAIL");
    while(true);
  }
  Serial.println("OK");
  delay(5000);

  Serial.println("Setup complete.\n");
}

void loop() {
  if (numRuns <= maxRuns) {
    Serial.println("Running SendEmail - Run #" + String(numRuns++));

    TembooChoreo SendEmailChoreo(client);

    // Invoke the Temboo client
    SendEmailChoreo.begin();

    // Set Temboo account credentials
    SendEmailChoreo.setAccountName(TEMBOO_ACCOUNT);
    SendEmailChoreo.setAppKeyName(TEMBOO_APP_KEY_NAME);
    SendEmailChoreo.setAppKey(TEMBOO_APP_KEY);

    // Set Choreo inputs
    String UsernameValue = "Dominichoogkamer@gmail.com";
    SendEmailChoreo.addInput("Username", UsernameValue);

    // Identify the Choreo to run
    SendEmailChoreo.setChoreo("/Library/Google/Gmail/SendEmail");

    // Run the Choreo; when results are available, print them to serial
    SendEmailChoreo.run();

    while(SendEmailChoreo.available()) {
      char c = SendEmailChoreo.read();
      Serial.print(c);
    }
    SendEmailChoreo.close();
  }

  Serial.println("\nWaiting...\n");
  delay(30000); // wait 30 seconds between SendEmail calls
}

 

For more information about this project, Refer to this URL.

http://www.instructables.com/id/Smart-Mailbox/?ALLSTEPS

Source : http://www.instructables.com/id/Smart-Mailbox/?ALLSTEPS

This project is about a smart mailbox using arduino and temboo which is cloud service. It can know whether mail has been received or not in the mail box using capacitive sensor. If mail box has a mail, It will send e-mail to your gmail through cloud service. And then you can get e-mail whether mail box is empty or not.

 

Picture of Wat heb je allemaal nodig?

 

I want to introduce this project because I think it is interest and usefull project in real life.

 

Code

/* Setup shield-specific #include statements */
#include 
#include 
#include 
#include 
#include 
#include 
#include "TembooAccount.h" // Contains Temboo account information

byte ethernetMACAddress[] = ETHERNET_SHIELD_MAC;
EthernetClient client;

int numRuns = 1;   // Execution count, so this doesn't run forever
int maxRuns = 10;   // Maximum number of times the Choreo should be executed

void setup() {
  Serial.begin(9600);
  
  // For debugging, wait until the serial console is connected
  delay(4000);
  while(!Serial);

  Serial.print("DHCP:");
  if (Ethernet.begin(ethernetMACAddress) == 0) {
    Serial.println("FAIL");
    while(true);
  }
  Serial.println("OK");
  delay(5000);

  Serial.println("Setup complete.\n");
}

void loop() {
  if (numRuns <= maxRuns) {
    Serial.println("Running SendEmail - Run #" + String(numRuns++));

    TembooChoreo SendEmailChoreo(client);

    // Invoke the Temboo client
    SendEmailChoreo.begin();

    // Set Temboo account credentials
    SendEmailChoreo.setAccountName(TEMBOO_ACCOUNT);
    SendEmailChoreo.setAppKeyName(TEMBOO_APP_KEY_NAME);
    SendEmailChoreo.setAppKey(TEMBOO_APP_KEY);

    // Set Choreo inputs
    String UsernameValue = "Dominichoogkamer@gmail.com";
    SendEmailChoreo.addInput("Username", UsernameValue);

    // Identify the Choreo to run
    SendEmailChoreo.setChoreo("/Library/Google/Gmail/SendEmail");

    // Run the Choreo; when results are available, print them to serial
    SendEmailChoreo.run();

    while(SendEmailChoreo.available()) {
      char c = SendEmailChoreo.read();
      Serial.print(c);
    }
    SendEmailChoreo.close();
  }

  Serial.println("\nWaiting...\n");
  delay(30000); // wait 30 seconds between SendEmail calls
}

 

For more information about this project, Refer to this URL.

http://www.instructables.com/id/Smart-Mailbox/?ALLSTEPS

Source : http://www.instructables.com/id/Smart-Mailbox/?ALLSTEPS

COMMENTS

Please Login to comment
  Subscribe  
Notify of