Introduction: Liquidity - Tangible Home Banking System

Liquidity is a system to encourage saving money and make quick and easy monetary transactions.

Our Goal: Use IOT to create a physical interaction between objects that are able to communicate between them and at the same time transmit to the cloud the information exchanged.

Step 1: Sensor

Seedstudio Grove Starter Kit & others

We used:

2 Touch sensor

2 Light Sensor

2 Tilt sensor

2 RGB Led strip

2 Edison board

Why we welded a tilt sensor? Because we were using the gyroscope itg3200 and it is not yet supported by Edison. Remeber It! :-)

Step 2: The Plan

The basic idea is to allow an exchange of cash ("liquidity") between people. Particularly among people of the same family.

The system consists of two bottles equipped with sensors that can display the bank credit and transfer it through a gesture. Selecting the level of money to be transferred through a touch interface you can transfer the money by placing them in another bottle.

Through a series of LEDs is possible to see how much credit transfer from one bottle to another.

To attach the bottle to your virtual wallet or your bank account using a QRcode place under the base. Application development officer at the association with the credit will be developed in the future. :)

For development we used jsp and Intel XDK IoT Edition

Step 3: Make It

First: SetUp system.

We install all in Windows system

First download and install Driver, Sdk and tools:

https://software.intel.com/it-it/iot/downloads

Edison Driver for Windows (very very important)

http://downloadmirror.intel.com/24698/eng/IntelEdi...

FTDI driver for Windows

http://www.ftdichip.com/Drivers/D2XX.htm

Getting starter software:

https://software.intel.com/en-us/iot/getting-start...

If you use windows this link is crucial (documentation step by step):

https://software.intel.com/en-us/articles/getting-...

Setup IOT Analytics

https://software.intel.com/en-us/node/530661

And now configure Edison board!

Second use sensor

We used:

- The light sensors to boot the system after removing the cork from the bottle.

- The touch sensors to allow to define which level of money transfer from one bottle to another.

- The RGB LED to indicate the level of money on the bottle and see the money transfer.

- The Tilt sensor to initiate the transfer process when you tilt the bottle.

Put the RGB LED on breadboard

Third program

- Activate IOT Analytics (used to keep track of transactions)

- Install on EDISON the librery mraa@0.5.4-110-g459ecc0 (IMPORTANT). We had a problem of segmentation fault error with "standard" mraa librery

CODE

LedStrip control:

/* handle ws2801 led strip with edison */
var LEDStrip = function(spi,len) { this.length = len; this.buffer = new Buffer(this.length*3); this.spi = spi; this.debug = false; }

LEDStrip.prototype.setup = function () { this.buffer.fill(0); this.fill(this.color(0,0,0)); };

LEDStrip.prototype.clear = function () { this.buffer.fill(0); this.update(); };

LEDStrip.prototype.color = function(r,g,b) { return [r,g,b]; };

/* fill the entire strip */ LEDStrip.prototype.fill = function(color,cb) { this.buffer.fill(0); for(var i=0; i < this.length*3; i=i+3) { this.buffer[i] = color[0]; // R this.buffer[i+1] = color[1];// G this.buffer[i+2] = color[2];// B } this.update(); if(cb) { cb(); } };

/* set pixel at position x*/ LEDStrip.prototype.setPixel = function(pos,color) { var pixelPos = pos*3; this.buffer[pixelPos] = color[0]; this.buffer[pixelPos+1] = color[1]; this.buffer[pixelPos+2] = color[2]; };

/* write out to SPI */ LEDStrip.prototype.update = function() { this.spi.write(this.buffer); if(this.debug) { console.log("Strip updated!"+this.buffer.toString('hex')); } };

module.exports = LEDStrip

Send data to Cloud (only for mockup random number using iotkit-admin)

var sys = require('sys')
var exec = require('child_process').exec;

var v_gold = Math.random(100)*100;
var exec = require('child_process').exec; function puts(error, stdout, stderr) { sys.puts(stdout) } exec("iotkit-admin observation tilt " + v_gold, puts);

Step 4: It Work!

Uncorking the bottle system is activated. With the touch sensor you select how much credit you want to send. By tilting the bottle to the one near you start the transfer.

The system scale the credit from the bank account connected to the bottle 1 and loads it on the bank account connected to the bottle 2. On cloud trace remains of operations.