Shebin Jose JacobNekhil ravi
Published © MIT

Alexa Smart Mailbox

Come forward to meet the speaking mailbox.

BeginnerFull instructions provided5 hours2,095
Alexa Smart Mailbox

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
Raspberry Pi 3 Model B
Raspberry Pi 3 Model B
×1
Amazon Echo
Amazon Alexa Amazon Echo
×1
Proximity Sensor
Proximity Sensor
×1
5V 2.5A Switching Power Supply
Digilent 5V 2.5A Switching Power Supply
×1
Speaker: 3W, 4 ohms
Speaker: 3W, 4 ohms
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Desktop Microphone, Unidirectional
Desktop Microphone, Unidirectional
×1

Software apps and online services

Arduino IDE
Arduino IDE
Alexa Voice Service
Amazon Alexa Alexa Voice Service
Alexa Skills Kit
Amazon Alexa Alexa Skills Kit
flask-ask
ngrok

Story

Read more

Schematics

Arduino - Proximity

Raspberry Pi - Arduino

Code

Arduino Code

C/C++
Code to read data from proximity sensor and write value in serial port.
#Code to read data from proximity sensor
#Developed by Shebin Jose Jacob


int sensor = 5;  
int mail   = 0; 
void setup() { 
 pinMode(sensor, INPUT);  
 Serial.begin(9600);  
}
void loop() {
 mail = digitalRead(sensor); 
 if(mail == 1) {  
   Serial.write(1);              # returns 1 if mail is present 
   } 
 else{   
 Serial.write(0);                # returns 0 if mail is not present
   }
}

Raspberry Pi code

Python
#Code to read data from serial port and send it to alexa via flask 
#Developed by Shebin Jose Jacob

from flask import Flask  
from flask_ask import Ask, statement  
import requests  import json  
import serial 
ser = serial.Serial("/dev/ttyACM0", 9600)  #change here for your serial port
app = Flask(__name__)  ask = Ask(app, '/') 
@ask.launch 
@ask.intent("Check")   
if (ser.read()==1)   
def yes():   
 return statement("New mail has arrived , Check it soon")   
else    
def no():      
 return statement("No mails yet")   
if __name__ == "__main__":   
app.run(debug=True) 

Credits

Shebin Jose Jacob

Shebin Jose Jacob

5 projects • 18 followers
I know only one language, the language of 0's and 1's
Nekhil ravi

Nekhil ravi

4 projects • 7 followers
God of Tech....

Comments

Add projectSign up / Login