Introduction: To Make a Trash Box at Intel IoT Road Show in Beijing

Sign in

Step 1: Study

Follow professors

Step 2: Tools & Site

You can find more about IoT at https://software.intel.com/en-us/iot/home .

And if you use Intel XDK as me, you can download at https://software.intel.com/en-us/iot/tools-ide/ide/xdk .

Step 3: Use GPS Module

  1. use gps library:
    • var GPSSensor = require('jsupm_ublox6');
    • var myGPSSensor = new GPSSensor.Ublox6(0);
  2. get data from UART:
    • myGPSSensor.readData(nmeaBuffer, bufferLength);

  3. this line is useful:
    • $GPGLL,3958.85089,N,11618.30945,E,015552.00,A,A*60

  4. split it:
    • i0 = GPSData.indexOf("$GPGLL,");

    • i1 = GPSData.indexOf("\n",i0+1);

    • sout = GPSData.substring(i0,i1);

    • var a = sout.split(',',10);

    • console.log(a[1]+" : " +a[2]+" : " +a[3]+" : " +a[4]);

  5. you can find your location at console window.

Step 4: Use Grove - LCD RGB Backlight

  1. screen = new (require("jsupm_i2clcd").SAINSMARTKS)(8, 9, 4, 5, 6, 7, 0);
  2. screen.setCursor(line || 0, 0);
  3. screen.write(string);

Step 5: Get Temperature From Grove - Temperature Sensor 1.2

  • var analogPin2 = new mraa.Aio(2);
  • temp = analogPin2.read();
  • temp = (1023-temp)*10000/temp;
  • temp = 1/(Math.log(temp/10000)/3975+1/298.15)-273.15;
  • console.log('temp == '+temp);

Step 6: Test the Trash Box Is Full: Grove IR Distance Interrupter V1.2

  • var myDigitalPin7 = new mraa.Gpio(7);
  • myDigitalPin7.dir(mraa.DIR_IN);
  • var myDigitalValue7 = myDigitalPin7.read();

Step 7: Upload Data by Superagent

  • var request = require("superagent");
  • request.get(url).end(function(err, res){});

Step 8: Store Data by SAE

SAE (Sina App Engine), at http://sae.sina.com.cn/ .

It supports php and mysql, redis......

Step 9: Show It at Map

Baidu Map, http://lbsyun.baidu.com/ .

you can use demos directly (http://developer.baidu.com/map/jsdemo.htm), or change some lines to support your interfaces.

Step 10: Got It ?!