Introduction: The Third Eye(GPS Location Triggered Speaker Using Intel Edison) (Intel IOT)

Picture of The Third Eye(GPS Location Triggered Speaker Using Intel Edison) (Intel IOT)

In this Instructable , I will show you how to use ,GPS Module ,Parsing GPS Data from the GROOVE GPS module on a Edison using Node.js and Required packages for doing a Text to Speech using espeak library.

Mount the Groove Arduino expansion shield on edison board.

Connect the GPS module to rx tx pinned mount(required as the GPS uses serial comm to connect the data)

Connect the GPS and upload the GPS Data to IBM Bluemix cloud , and when the GPS Module is nearby Trigger the Speaker to Speak out the Data sent by Cloud.

Connect the GPS using Grove Kit to the rx tx module in the groove shield. is very much required

Be Outiside , because you will not get the GPS Data properly inside the Building.

Step 1: Connecting to IBM Bluemix Using Node.js

Picture of Connecting to IBM Bluemix Using Node.js

You need a IBM Bluemix Account , and a App running in the Dashboard of Bluemix. Creating one will be different Instructable

Install nmea and ibmiotf in edison

using command

npm install nmea

npm install ibmiotf

nmea- package to parse GPS data , ibmiotf - package to connect to IBM bluemix

This is the code for connecting the Bluemix in a basic manner uncomment all lines

//Node.js application for connecting the Intel Edison Arduino to IBM Bluemix

//using Quickstart.

//Sends data from an analog sensor on analog pin zero (A0).

//*

///Change the following to your Edison's MAC address

////var MAC = 'fc:c2:de:38:94:24'; //Note bluemix doesn't detect the mac addr with colon

//var MAC = '784b87ab5af6';

////Uses mqtt.js, see package.json. More info at:

//https://www.npmjs.com/package/mqtt

//var mqtt = require('mqtt');

//var client = mqtt.connect('mqtt://test.mosquitto.org');

//var PROTOCOL = 'mqtt';

//var BROKER = 'quickstart.messaging.internetofthings.ibmcloud.com';

//var PORT = 1883;

/

///Create the url string

//var URL = PROTOCOL + '://' + BROKER;

//URL += ':' + PORT;

////URL is 'mqtt://quickstart.messaging.internetofthings.ibmcloud.com:1883'

/

/var CLIENTID= 'd:quickstart:iotquick-edison:' + MAC;

//var TOPIC = 'iot-2/evt/status/fmt/json';

/

/var client = mqtt.connect(URL, { clientId: CLIENTID });

////Installed NPM

/

/client.on('connect', function () {

// setInterval(function(){

// client.publish(TOPIC, '{"d":{"Volts":' + getFakeVolts() + '}}');//Payload is JSON

// console.log('sending data to bluemix'+getFakeVolts());

// }, 2000);//Keeps publishing every 2000 milliseconds.

//});

/

///Connect to an analog sensor on Edison Arduino pin A0.

////Uses mraa included with Edison image. More info at:

////http://iotdk.intel.com/docs/master/mraa/index.html

////Edison Arduino returns drifting values if you have no sensor; you can see

////the "data" on Bluemix if you have no sensor connected on pin A0.

////var mraa = require('mraa');

////var pin0 = new mraa.Aio(0);

////var analogVolts = function() {

//// var counts = pin0.read();

//// var volts = counts * 4.95 / 1023;

//// return parseFloat(volts).toFixed(4);

////};

/

/var fakeVolts =0.0;

//var getFakeVolts = function() {

// var volts = fakeVolts;

// fakeVolts = fakeVolts +0.1;

// if (fakeVolts > 1.0) { fakeVolts = 0.0; }

// return volts;

//}

/*jslint node:true, vars:true, bitwise:true, unparam:true *

*jshint unused:true *

*

Node.js application for connecting the Intel Edison Arduino to IBM Bluemix

using Quickstart.

Sends data from an analog sensor on analog pin zero (A0).

*

/Change the following to your Edison's MAC address

var MAC = '784b87ab****';

var ibmiotf = require('ibmiotf');

var config = {

"org" : "9xljvz",

"id" : "784b87ab5af6",

"type" : "GPS",

"auth-method" : "token",

"auth-token" : ")V5*nb&_1w7Cim_WE_"

};

var deviceClient = new ibmiotf.IotfDevice(config);

deviceClient.connect();

deviceClient.on('connect', function () {

setInterval(function(){

deviceClient.publish("status","json", '{"d":{"temp":' + getTemp() + '}}');//Payload is JSON

}, 2000);//Keeps publishing every 2000 milliseconds.

});

//Connect to an analog sensor on Edison Arduino pin A0.

//Uses mraa included with Edison image. More info at:

//http://iotdk.intel.com/docs/master/mraa/index.html

//Edison Arduino returns drifting values if you have no sensor; you can see

//the "data" on Bluemix if you have no sensor connected on pin A0.

// Load Grove module

Step 2: SOund Card and Espeak

Picture of SOund Card and Espeak

Connecting the Sound card and espeak module

espeak -ven-us+f4 -s170 "6 new wireless networks found”

install espeak package and run this command to see espeak speaking from speaker , you need a USB sound card.

Comments

DIY Hacks and How Tos (author)2016-03-20

Cool project

About This Instructable

347views

4favorites

More by NeoStallion:The Third Eye(GPS Location triggered speaker using Intel Edison) (Intel IOT)
Add instructable to: