Project tutorial
Voice Assistant Using A Smart Phone And 1Sheeld

Voice Assistant Using A Smart Phone And 1Sheeld

You can make FRIDAY, that can make calls, tell you the temperature, turn things on or off and even take pictures.

  • 1,727 views
  • 0 comments
  • 7 respects

Components and supplies

About this project

Everyone would like to have a voice assistant like JARVIS. But the lack of AI (Artifical Intelligence) in modern technology is the limiting factor. Using an Arduino, 1Sheeld shield and a smartphone, you can make FRIDAY (Not JARVIS because 1Sheeld supports only female voice on text-to-speech shield) that can make calls, tell you the temperature, turn things on or off and even take pictures.

Step 1: Prepare Hardware

I used one normal LED and one bright LED that I took from a LED strip. Connect the LEDs (For the bright one a transistor is needed) and LM35 temperature sensor to the pins shown in the picture. I made a custom shield i order to make things much more easier, but using a breadboard is always an option

Step 2: Upload The Code

While uploading the code, make sure the UART switch of 1Sheeld is on off position. (shown in the picture) If you don't do that, you will have errors unless you unplug 1Sheeld and then upload the code. (Once you upload the code, bright LED might light up until you give "over" command, or its just a problem of mine.)

Step 3: Select Required Shields

As shown in the picture you need to select Buzzer, Phone, Text To Speech and Voice Recognizer shields.(If you think "make noise" function is stupid, don't select Buzzer shield) If you press "Remember" button on the top right corner, you don't need to select the shields every time you start the app.

Step 4: Done!

Your personal FRIDAY is ready to use. Open Voice Recognizer shield, make sure you have internet connection, tap on the big red dot and start giving commands! I believe this project have so much potential. you can add relays and turn this into a home automation system, or control your computer by using an Arduino Leonardo except Uno. Possibilities are limitless.

If you liked this project, please vote for this on "Phone Contest" sponsored by Seeed Studio!

Code

Untitled fileArduino
//including the necessary 1sheeld shields and 1Sheeld itself
#define CUSTOM_SETTINGS
#define INCLUDE_TEXT_TO_SPEECH_SHIELD
#define INCLUDE_VOICE_RECOGNIZER_SHIELD
#define CUSTOM_SETTINGS
#define INCLUDE_PHONE_SHIELD
#define INCLUDE_BUZZER_SHIELD
#define INCLUDE_CAMERA_SHIELD
#include <OneSheeld.h>

//setting the variables and commands
const int pinTemp = A0;
float temperature;
int B=3975;                
float resistance;
//I had some difficulties with telling the exact word so i altered the commands a bit
const char one[]="temperature";
const char two[]="how are you";
const char three[]="what is this box";
const char four[]="light";
const char five[]="of";
const char six[]="kol";
const char seven[]="make noise";
const char nine[]="over";
const char ten[]="bright lights";
const char eleven[]="picture";

void setup()
{
  OneSheeld.begin();    //defining the leds and setting them as outputs
  pinMode(13,OUTPUT);
  pinMode(12,OUTPUT);
}

void loop()  //comand functions occur from this line
{  
   if(VoiceRecognition.isNewCommandReceived())
   {
    
//temperature
     if(!strcmp(one,VoiceRecognition.getLastCommand()))
         {
      int val = analogRead(pinTemp);
      resistance=(float)(1023-val)*10000/val;
      temperature=1/(log(resistance/10000)/B+1/298.15)-273.15;
      int n= temperature * -1 ;
      String temp="The Temperature is :";
      temp += String(n);
      temp +="degree celcius, sir";
      TextToSpeech.say(temp);
         }

//how are you
     else if(!strcmp(two,VoiceRecognition.getLastCommand()))
         {
          TextToSpeech.say("Like a charm sir,");
          delay(1000);
          TextToSpeech.say("you");
         }
         
//self introduction    
     else if(!strcmp(three,VoiceRecognition.getLastCommand()))
         {
         TextToSpeech.say("this is The Beacon project that you made, sir");
         }
   
//LED pin 13
     else if(!strcmp(four,VoiceRecognition.getLastCommand()))
         {
         digitalWrite(13, HIGH);
         }

//LED pin 13 off     
     else if(!strcmp(five,VoiceRecognition.getLastCommand()))
         {
         digitalWrite(13, LOW);
         }

//making a call
     else if(!strcmp(six,VoiceRecognition.getLastCommand()))
         {
         Phone.call("01234567890");
         }

//make noise
     else if(!strcmp(seven,VoiceRecognition.getLastCommand()))
         {
         Buzzer.buzzOn();
         delay(5000);
         Buzzer.buzzOff();
         }       

//LED pin 12
     else if(!strcmp(nine,VoiceRecognition.getLastCommand()))
         {
         digitalWrite(12, HIGH);
         }
     
//LED pin 12 off    
     else if(!strcmp(ten,VoiceRecognition.getLastCommand()))
         {
         digitalWrite(12, LOW);
         }

//taking a picture
     else if(!strcmp(eleven,VoiceRecognition.getLastCommand())) 
         {
         Camera.setQuality(HIGH_QUALITY);
         Camera.setFlash(AUTO);
         Camera.rearCapture();
         }
        }
       }
Codebender

Schematics

FGLUB4BIDUR4PP3.LARGE.jpg
Fglub4bidur4pp3.large

Comments

Similar projects you might like

Voice Controlled Robot using your Smart Phone

Project tutorial by Ahmed Yassin

  • 4,898 views
  • 0 comments
  • 10 respects

Arduino can hear and understand your voice with 1Sheeld !

Project tutorial by Alessandro Didonna

  • 4,283 views
  • 1 comment
  • 11 respects

Control your Light System Using Smart Phone

Project tutorial by Ahmed Yassin

  • 46,444 views
  • 6 comments
  • 63 respects

Control your light system with your voice

Project tutorial by Maha Raafat

  • 42,171 views
  • 22 comments
  • 160 respects

Bluetooth Steering wheel for a robot using 1Sheeld

Project tutorial by Kristian Blåsol

  • 2,868 views
  • 1 comment
  • 13 respects

Led fading using 1Sheeld

Project tutorial by Nado Hollow

  • 1,070 views
  • 1 comment
  • 2 respects
Add projectSign up / Login