Top Internet of Things Daily & Weekly

IoT Speech Recognition

Android IoT voice recognition with Arduino:

  • The Internet of Things (IoT) is a new emerging technology these days, a self configurable and adaptive system consisting of networks of sensors and other object including intelligent objects whose purpose is to interconnect with all things, including everyday and industrial objects, in such a way that they become intelligent, programmable and more capable of interacting with humans.
  • Arduino board is one of the important objects in this ecosystem, since it facilitates us to connect and control different devices like sensors, LEDs, step motors, servos and mobile phones.
  • This tutorial describes how to create an Internet of Things with Android and Arduino:

    Android Application to control a Generic Servo Motor and a Led, according to user speech over mobile phone.

  • Then we have IOT implementation taking place with the help of CC3000 which is then allowing us to send parameters in this case “speech words” using mobile App which in this case is above is a hosting platform.
  • The mobile device sends information “lowercase text string type” to the IOT “CC3000” which is interfaced with the Arduino Micro, the Servo Motor and led lamp, this information is obtained from the mobile application when the user speaks with the microphone that the application recognizes the word and sends the text match or matches “you can select that on the app”, to the Arduino Micro via a UDP or TCP client “you can set on the app” that runs on the mobile application and with the help of the CC3000, so the micro Arduino can either power the servomotor or turn off the led lamp.

Control a servo, LED lamp or any device connected to WiFi, using Android app.

@arduino: Android IoT voice recognition with Arduino:

The Internet of Things (IoT) is a new emerging technology these days, a self configurable and adaptive system consisting of networks of sensors and other object including intelligent objects whose purpose is to interconnect with all things, including everyday and industrial objects, in such a way that they become intelligent, programmable and more capable of interacting with humans.

All the applications that involve IOT, whether industrial, home, etc. Are controlled and monitored by certain parameters which are implemented and executed by the user or “other”. Therefore, their implementation and execution differs with the sets of parameters, for the execution that is specified or desired by the user.

Arduino board is one of the important objects in this ecosystem, since it facilitates us to connect and control different devices like sensors, LEDs, step motors, servos and mobile phones.

This tutorial describes how to create an Internet of Things with Android and Arduino:

Android Application to control a Generic Servo Motor and a Led, according to user speech over mobile phone.

All objects are in the same network for simplicity. The above images shown a above diagram of the system. It consist of 1 Servo Motor is capable of to take in 6 volts and deliver 44.4 oz-in. of maximum torque at 0.18 sec/60° at normal voltage inputs Torque: 38.8/44.4 oz-in. (4.8/6.0V) Speed: 0.20/0.18 sec/60° (4.8/6.0V) and rotate from 0 to 180 degrees and a commercial matrix led lamp of 24 10000 MCD (milli-candela’s) leds with features:

Then we have IOT implementation taking place with the help of CC3000 which is then allowing us to send parameters in this case “speech words” using mobile App which in this case is above is a hosting platform.

The mobile device sends information “lowercase text string type” to the IOT “CC3000” which is interfaced with the Arduino Micro, the Servo Motor and led lamp, this information is obtained from the mobile application when the user speaks with the microphone that the application recognizes the word and sends the text match or matches “you can select that on the app”, to the Arduino Micro via a UDP or TCP client “you can set on the app” that runs on the mobile application and with the help of the CC3000, so the micro Arduino can either power the servomotor or turn off the led lamp.

/* * Author : Zavala Ortiz Vicente Arturo. * language : .cpp * Created : 3/11/2015 11:56:57 AM * Name : ATmega32u4_IOT_LED_Servo.cpp * Update : 1/9/2017 02:29:15 PM */ #include #include #include “Servo.h” #include “Network.h” /***** wifi Global Variables *****/ // Connection info data lengths #define MAX_MSG_LEN 100 #define SERVO_PIN 10 #define LED_PIN 9 // Constants char ap_ssid [] = “SSID of network” ; char ap_password [] = “Password of network” ; unsigned int ap_security = WLAN_SEC_WPA2 ; // Security of network unsigned long timeout = 3000 ; // Milliseconds // Global Variables CC3000 wifi = CC3000 (); NETWORK client = NETWORK ( wifi ); char in_message [ MAX_MSG_LEN ] = { 0 }; /***** Other Global Variables *****/ uint8_t i ; static char data [ 20 ]; double value = 0 ; Servo servo ; // create servo object to control a servo /***** Motors Global Variables *****/ void setup () { /* add setup code here */ ConnectionInfo connection_info ; // Initialize CC3000 (configure SPI communications) #ifdef CC3000_DEBUG Serial . begin ( 115200 ); #endif // Initialize CC3000 (configure SPI communications) if ( ! wifi . init ( SS )) { #ifdef CC3000_DEBUG DEBUGPRINTLN ( PSTR ( “Initialize CC3000 FAIL!” )); #endif return ; } else { #ifdef CC3000_DEBUG DEBUGPRINTLN ( PSTR ( “Initialize CC3000 OK” )); #endif } uint8_t connection_cnt = 0 ; while ( connection_cnt <= WL_MAX_ATTEMPT_CONNECTION ) { #ifdef CC3000_DEBUG DEBUGPRINT ( PSTR ( "Connection try: " )); printDec ( connection_cnt ); DEBUGPRINT ( PSTR ( " \n " )); #endif if ( ! wifi . connect ( ap_ssid , ap_security , ap_password , timeout )) { #ifdef CC3000_DEBUG DEBUGPRINTLN ( PSTR ( "Error: Could not connect to AP!" )); #endif } else break ; connection_cnt ++ ; _delay_ms ( 2000 ); } // Gather connection details and print IP address if ( ! wifi . getConnectionInfo ( connection_info ) ) { #ifdef CC3000_DEBUG DEBUGPRINTLN ( PSTR ( "Error: Could not obtain connection details" )); #endif return ; } else { #ifdef CC3000_DEBUG DEBUGPRINT ( PSTR ( "IP Address: " )); printIPAddr ( connection_info . ip_address ); #endif } pin_mode ( LED_PIN , OUTPUT ); servo . attach ( SERVO_PIN ); // attaches the servo on pin 9 to the servo object servo . write ( 0 ); _delay_ms ( 20 ); } void loop () { /* add main program code here */ if ( ! client . isOpen ()) { if ( client . open ( UDP_SOCKET ) == 0 ) { DEBUGPRINT ( PSTR ( "Create SOCKET ERROR!" )); client . close (); } if ( ! client . Bind ( 4443 )) { #ifdef CC3000_DEBUG DEBUGPRINTLN ( PSTR ( "Binding SOCKET Error!" )); #endif } } #ifdef CC3000_DEBUG DEBUGPRINTLN ( PSTR ( "WAITING FOR MESSAGE!" )); #endif if ( client . readFrom ( 4443 , in_message , MAX_MSG_LEN , SOCKOPT_RECV_TIMEOUT ) == - 1 ) { #ifdef CC3000_DEBUG DEBUGPRINTLN ( PSTR ( "NO MESSAGE RECEIVED" )); #endif } else { if ( client . http_gets ( data , " word " , in_message )) { if (( strcmp ( data , "left" ) == 0 )) { servo . write ( 180 ); // sets the servo position according to the scaled value _delay_ms ( 20 ); } else if (( strcmp ( data , "center" ) == 0 )) { servo . write ( 90 ); // sets the servo position according to the scaled value _delay_ms ( 20 ); } else if (( strcmp ( data , "right" ) == 0 )) { servo . write ( 0 ); // sets the servo position according to the scaled value _delay_ms ( 20 ); } else if (( strcmp ( data , "on" ) == 0 )) { value = atoi ( data ); digitalWrite ( LED_PIN , HIGH ); _delay_ms ( 20 ); } else if (( strcmp ( data , "off" ) == 0 )) { value = atoi ( data ); digitalWrite ( LED_PIN , LOW ); _delay_ms ( 20 ); } } } client . fulsh_buffer ( in_message ); client . fulsh_buffer ( data ); _delay_ms ( 20 ); }

IoT Speech Recognition