sensitive

Sensitive is an experimental node.js module that enables you to read the sensors of multiple phones at the time and create real-time multiplayer experiences on a "host" browser.

Usage no npm install needed!

<script type="module">
  import sensitive from 'https://cdn.skypack.dev/sensitive';
</script>

README

Sensitive.js

Sensitive.js is a small Node.js app that reads sensor data from your mobile phone and sends it to an Arduino. It's still quite buggy, but it works :)

How it works

Sensitive.js has to run on a computer that has an Arduino attached to a USB port (this could be a RaspberryPi for instance).

When you access the node.js server from your phone, a Sensitive.js client opens a Websocket connection and starts sending the sensor readings. The node app then forwards them to your Arduino, using the serial port.

Supported Sensors

  • Geolocation (lat, lng)
  • Accelerometer (x, y, z)
  • Orientation (alpha, beta, gamma)
  • Compass (degrees, direction)

Demo app

The demo app is quite simple. It's a two part app that allows you to start and stop reading sensors. The first part is an HTML file and the other is an Arduino sketch.

Note that the demo sketch needs a Liquied Crystal display to show the data. This is of course not required for Sensitive.js, but you will have to strip the code a bit to run it without the display.

Get it running

  1. Get the sources and dependences
git clone git@github.com:alanreid/Sensitive.js.git 
cd Sensitive.js
npm install
  1. Open app.js and change the serial port to the one your Arduino is using
  2. Upload the demo sketch to your Arduino
  3. Run the app with
node app.js
  1. Access to your node's IP & port from your mobile device.

Contact me

Contact me on Twitter: @alan_reid

License

This software is distributed under the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0