DIY Things on EHW

.
Showing posts with label programing. Show all posts
Showing posts with label programing. Show all posts

Thursday, 21 January 2016

CONTROL THE DEVICES USING VOICE RECOGNITION- MSP430 ,GOOGLE API

CONTROL THE DEVICES CONNECTED TO MSP430 USING VOICE RECOGNITION


In this post , speech recognition from google API is used for controlling the devices connected to the micro controller. voice is converted to a low size format and sent over to google servers .The corresponding text will be returned from google. this text is again sent back to controller for control purposes.

Materials Required :


  • Smartphone with internet .
  • Relay(for controlling AC / high voltage devices)
  • Bluetooth module.
  • MSP430 launchpad controller.




  1. Please read the Interfacing of Bluetooth-Module with MSP430-Launchpad before starting this project.
  2. please read how to Interface relay with MSP430 to control devices 




NOTE : Since pin 2 and 3 are used for Bluetooth interfacing , please connect the transistor base to the pins other than 2 and 3 . In this Post the pin 4 is used for connecting the device as per the article how to Interface relay with MSP430 to control devices 


Combine and connect the circuit from the below links (USE PIN 4 INSTEAD OF 2 to connect relay)
 Interfacing of Bluetooth-Module with MSP430-Launchpad 
 how to Interface relay with MSP430 to control devices (Ex:Light)

Download the Android  APP 


Android App from EmbeddedHW.com

  • Click on the Home Button

Home screen of EmbeddedHw Android App

INTERNET IS REQUIRED FOR VOICE CONTROL
  •  Turn on your Internet in the smartphone
  •  Turn On the Bluetooth of the smartphone & Pair the device (password:1234)
  •  Click on the connect button and select our device.
  •  click on the voice control to speak
The speech will be converted to text using google API .This converted Text will sent to our controller using the bluetooth module.

EXAMPLE :-

you can turn on the LIGHT by saying "LIGHT ON". the controller will receive the text "LIGHT ON" from the smartphone.this text can be used to turn on the light . 
An example program is given below


byte ehw = 0; // incoming serial byte


void setup()


{

  // start serial port at 9600 bps:

  Serial.begin(9600);
 pinMode(4, OUTPUT); 

}

void loop()
{
  // if we get a valid byte, read analog ins:
while (!Serial.available() > 0)
    ehw = Serial.read();
   Serial.println(ehw);
if(ehw="LIGHT ON"){
  digitalWrite(4, HIGH); }
else if(ehw="LIGHT OFF"){
  digitalWrite(4, LOW); }
else 
Serial.println("Incorrect message");
delay(10);
  }

Thursday, 14 January 2016

Interfacing Bluetooth Module with MSP430 Launchpad


Interfacing Bluetooth Module with MSP430 Launchpad

Here is the interfacing of a cheap Bluetooth module with MSP430 Lauchpad.
Bluetooth Module has 5 Pins with a UART I/O.


  1. Enable
  2. RX  
  3. TX
  4. VCC----> 5V
  5. GND---->Gnd

We are not connecting the Enable pin since it default Enabled.


  • RX is connected to UART pin of MSP430G2553 -P1.0
  • TX is connected to UART pin of MSP430G2553 -P1.1


VCC is connected to 5V output of MSP430 lauchpad and Ground to common Ground.



Interfacing Bluetooth Module with MSP430 Launchpad
Pin Connecton
























Interfacing Bluetooth Module with MSP430 Launchpad
Interfacing of MSP430 Launchpad with Bluetooth module



Interfacing Bluetooth Module with MSP430 Launchpad
Bluetooth Module
Make Sure your Jumper is connected in SW UART . Now it's time for Testing the setup.


Burn the below program :
IDE :- Energia 

Energia is an open-source electronics prototyping platform started by Robert Wessels in January of 2012 with the goal to bring the Wiring and Arduino framework to the Texas Instruments MSP430 based LaunchPad. The Energia IDE is cross platform and supported on Mac OS, Windows, and Linux.

Program :




byte ehw = 0; // incoming serial byte



void setup()

{

  // start serial port at 9600 bps:
  Serial.begin(9600);
}

void loop()
{
  // if we get a valid byte, read analog ins:
while (!Serial.available() > 0)
    ehw = Serial.read();
   Serial.println(ehw);
   delay(10);
  }


After burning open the serial monitor.

Download the Android  APP 


Android App from EmbeddedHW.com

  • Click on the Home Button

Home screen of EmbeddedHw Android App


  •  Turn On the Bluetooth of the smartphone & Pair the device (password:1234)
  •  Click on the connect button and select our device.
  •  Now click any of the buttons in the App home screen and verify whether any data is coming in the serial monitor of Energia. 

If everything works well , a data corresponding to each buttons will be shown in the serial monitor.





 

Copyright @ 2016 All About Hardware .

Blog by EHW