Project tutorial

Talkative Automation || Audio from Arduino || HC-05 || Voice © GPL3+

This project will play sound from Arduino and work the same as Google Assistant with limited commands. voice-controlled automation.

  • 3,729 views
  • 0 comments
  • 6 respects

Components and supplies

About this project

Talkative Automation || Audio From Arduino || Voice Controlled Automation || HC - 05 Bluetooth Module

.....

...........

...............

Please SUBSCRIBE To my YouTube channel for more videos........

In this video we have built a Talkative Automation..

When you will send a voice command via mobile then it will turn on home devices and send feedback in voice.

Like "TV on"

"fan on"

We have use SD card module to interface micro sd card and get audio output.

Many of People want to interface the SD card with arduino or want some audio output via arduino.

So here is easiest and cheapest way to interface SD card with arduino . you can use the audio output from arduino via a switch or sensor . you can play any type of sound ,music and recording but that audio will be in to .wav file. If it is in .mp3 or any other audio type then we will convert it into .wav file.

Step 1: Requirements

Show All 14 Items

  • Arduino uno
  • 10mm led
  • 2x16 lcd
  • Bc547 transistor
  • AC supply Bulb
  • 220ohm Resistor
  • Female audio jack
  • 5v exhaust fan
  • Woofer / audio amplifier
  • 5v relay
  • External 5v adapter
  • SD card module with sd card
  • 10k Potentiometer
  • HC-05 Bluetooth module

Step 2: Go and Watch This Video

Go and watch this video or click on instructable link,

Where I explained how to interface sd card with arduino,

How to install tmrpcm library and

How to insert audio in SD card....

Link :--

https://www.instructables.com/id/Audio-Player-Usin...

Step 3: Download the Zip File

Download the zip file and extract it

_________

Talkative Automation by Vishal.zipDownload

Step 4: Put Audio Into SD Card

  • Open extracted folder
  • Now open sound folder
  • Copy and paste all audio in SD card as I shown in the first video.

Step 5: Upload the Codes in Arduino

  • Install tmrpcm library as I shown in first video.
  • Open again extracted folder.
  • Now open voice folder
  • Open program in arduino software
  • Connect your arduino and upload it

Step 6: Connect Circuit

Connect circuit as shown

Vcc - - - - > 5v

Ground - - - - - > ground /negative

_______________

Lcd

  • Connect DB7---------> arduino's 2 pin
  • DB6--------> arduino's 3 pin
  • DB5---------> arduino's 4pin
  • DB4---------> arduino's 5pin
  • E---------> 6pin
  • RS-------> 7pin
  • RW - - - - - > ground

________________

Bluetooth module

  • RX---------> TX
  • TX---------->RX

________________

SD card module

  • MISO --------->12
  • MOSI - - - - ->11
  • SCK ----------->13
  • CS ------------->10

Step 7: OUTPUT Connections

AUDIO OUTPUT

  • Connect audio Jack's left and right terminal to 9th pin of arduino
  • Ground will be connected to arduino's ground.

_______________

A0 Output

  • Connect a0 to the base of Bc547 transistor
  • Connect collector of transistor to coil of relay.
  • Connect ac supply with bulb in series with NO terminal and Com terminal of relay.

________________

A1 Output

  • Connect positive terminal of 10mm led to the A1 pin of arduino.
  • Connect negative terminal of 10mm led to ground pin of arduino.

________________

A2 output

I have connected exhaust fan at place of heater.

  • Connect negative terminal of exhaust fan to a2.
  • Positive to 5v supply.

Step 8: Download and Install App

Download and install Voice control app

Link for app :- https://play.google.com/store/apps/details?id=robo...

How to connect app ...

1.Turn on Bluetooth of your Mobile. 2.Pair Bluetooth name "hc-05 " password is "1234" or "0000".

3.Download the android app.

4.Open the app and click on connect.

5.Now click on hc-05 then wait a few second.

6.If it not connect then try again.

Step 9: All Done

Here we go.....

Just turn on your data connection and click on center button and say these commands

  • Light on
  • Light off
  • TV on
  • TV off
  • Heater on
  • Heater off
  • All on
  • All off

Code

Talkative Automation Arduino
Voice controlled automation with audio reply
#include "SD.h"
#define SD_ChipSelectPin 10
#include "TMRpcm.h"
#include "SPI.h"
#include "LiquidCrystal.h"

TMRpcm tmrpcm;
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

#define Light A0
#define TV A1
#define heater A2
int temp=0,i=0;
int led=A3;
int blink=0;
char str[40];
void setup()
{
  lcd.begin(16,2);
  Serial.begin(9600);
       pinMode(led, OUTPUT);
       pinMode(heater, OUTPUT);
       pinMode(Light, OUTPUT);
       pinMode(TV, OUTPUT);
       digitalWrite(heater,HIGH);
       
  lcd.setCursor(0,0);
  lcd.print("Voice Controlled");
  lcd.setCursor(0,1);
  lcd.print("   Automaton    ");
  delay(2000);
  lcd.clear();
  lcd.setCursor(0,1);
  lcd.print("System Ready");
  delay(500);
  delay(1000);
  lcd.clear();
  lcd.setCursor(0,0);
lcd.print("Light TV  Heater");
  lcd.setCursor(0,1);
  lcd.print("OFF   OFF  OFF ");
  tmrpcm.speakerPin=9;
  if(!SD.begin(SD_ChipSelectPin))
{
  Serial.println("SD fail");
  return;
}
tmrpcm.setVolume(6);
tmrpcm.play("ready.wav"); 
}
void loop()
{
  lcd.setCursor(0,0);
  lcd.print("Light TV  Heater");
   
  if(temp==1)
  {
    check();
    Serial.println(str);
    temp=0;
    i=0;
    delay(1000);
  }
}
 void serialEvent() 
 {
  while(Serial.available()) 
  {
    if(Serial.find("*"))
    {
      delay(5000);
      while (Serial.available()) 
      {
      char inChar=Serial.read();
      str[i++]=inChar;
      if(inChar=='#')
      {
        temp=1;
        return;
      } 
      } 
    }
   }
 }
void check()
{
   if(!(strncmp(str,"TV on",5)))
    {
        digitalWrite(TV, HIGH);
       lcd.setCursor(6,1); 
      lcd.print("ON   ");
      tmrpcm.play("tv_on.wav");
      delay(200);
    }  
   
   else if(!(strncmp(str,"TV off",6)))
    {
       digitalWrite(TV, LOW);
      lcd.setCursor(6,1);
       lcd.print("OFF  ");
       tmrpcm.play("tv_off.wav");
      delay(200);
    }
  
    else if(!(strncmp(str,"heater on",9)))
    {
      digitalWrite(heater, LOW);
      lcd.setCursor(11,1); 
      lcd.print("ON   ");
      tmrpcm.play("htr_on.wav");
      delay(200);
    }
 
    else if(!(strncmp(str,"heater off",10)))
    {
      digitalWrite(heater, HIGH);
      lcd.setCursor(11,1); 
      lcd.print("OFF    ");
      tmrpcm.play("htr_off.wav");
      delay(200);
    }
 
    else if(!(strncmp(str,"light on",8)))
    {
      digitalWrite(Light, HIGH);
      lcd.setCursor(0,1); 
      lcd.print("ON    ");
      tmrpcm.play("light_on.wav");
      delay(200);
    }
 
    else if(!(strncmp(str,"light off",9)))
    {
      digitalWrite(Light, LOW);
      lcd.setCursor(0,1); 
      lcd.print("OFF   ");
      tmrpcm.play("light_of.wav");
      delay(200);
    } 
    
    else if(!(strncmp(str,"all on",6)))
    {
      digitalWrite(Light, HIGH);
      digitalWrite(heater, LOW);
      digitalWrite(TV, HIGH);
      lcd.setCursor(0,1); 
      lcd.print("ON    ON   ON  ");
      tmrpcm.play("all_on.wav");
      delay(200);
    }
 
    else if(!(strncmp(str,"all of",6)))
    {
      digitalWrite(Light, LOW);
      digitalWrite(heater, HIGH);
      digitalWrite(TV, LOW);
      lcd.setCursor(0,1);
      lcd.print("OFF  OFF   OFF  ");
      tmrpcm.play("all_off.wav");
      delay(200);
    }     
    
     else if(!(strncmp(str,"all off",7)))
    {
      digitalWrite(Light, LOW);
      digitalWrite(heater, HIGH);
      digitalWrite(TV, LOW);
      lcd.setCursor(0,1);
      lcd.print("OFF  OFF   OFF  ");
      tmrpcm.play("all_off.wav");
      delay(200);
    }     
}

Schematics

Talkative Automation
It is voice controlled automation with audio reply
Img 20171215 170016 bvjeuuxahr

Comments

Similar projects you might like

Automation basics using arduino and DTMF decoder

Project tutorial by TEAM DIY

  • 2,605 views
  • 1 comment
  • 4 respects

Voice Controlled Home Automation Prototype

Project showcase by Bharath Rao M

  • 1,409 views
  • 0 comments
  • 4 respects

Android App-Based Home Automation System Using IOT

Project tutorial by Team Autoshack

  • 24,849 views
  • 17 comments
  • 75 respects

2WD Voice Controlled Robot with Arduino and BitVoicer Server

Project tutorial by Marcio Tamagushi

  • 10,213 views
  • 11 comments
  • 32 respects

Audio Input

Project showcase by Arduino_Scuola

  • 7,393 views
  • 3 comments
  • 6 respects
Add projectSign up / Login