SlideShare a Scribd company logo
Fun with sensors
AmsterdamJS
21 April 2015
@janjongboom
Telenor R&D
Mozilla things
Fun with JavaScript and sensors - AmsterdamJS April 2015
Before mobile revolution…
Limited input methods
Vibration sensor?
Accelerometer?
Accelerometer?
Proximity
Accelerometer
Ambient Light
Magnetometer
Gyroscope
Humidity
Ambient Temperature
Pressure
Battery
Cameras
Bend sensor
Internet of Things
Moves IHR SleepCycle
BORING!
Fun with JavaScript and sensors - AmsterdamJS April 2015
Fun with JavaScript and sensors - AmsterdamJS April 2015
Fun with JavaScript and sensors - AmsterdamJS April 2015
Fun with JavaScript and sensors - AmsterdamJS April 2015
WiFi Connection
Real purpose: internet connection
Hide & Seek!
Hider sets up a WiFi hotspot
Seekers use dBm to triangulate
Hide & Seek!
1 var req = navigator.mozWifiManager.getNetworks();
2 req.onsuccess = function() {
3 var seeker = this.result.find(n => n.ssid === 'seeker');
4 if (!seeker) {
5 console.log('Too far out!');
6 }
7 else {
8 console.log(network.relSignalStrength);
9 }
10 };
Device Light
Real purpose: adjust brightness
Music
Theremin is instrument
Use device light as tone frequency
Wave your hands and magic!
Music
Theremin is instrument
Use device light as tone frequency
Wave your hands and magic!
1 var context = new AudioContext();
2 var oscillator = context.createOscillator();
3 oscillator.connect(context.destination);
4 oscillator.start(0);
5
6 window.addEventListener('devicelight', function(e) {
7 oscillator.frequency.value = e.value * 10;
8 });
Music
Gyroscope
Real purpose: rotate screen
Gyroscope
Real purpose: rotate screen
Track real life movement
Draw 3D model of phones
Measure gyroscope data
Show real life state on screen
Fun with JavaScript and sensors - AmsterdamJS April 2015
Track real life movement
1 var front = new THREE.MeshBasicMaterial({ map: loadTexture('front.jpg') });
2 var back = new THREE.MeshBasicMaterial({ map: loadTexture('back.jpg') });
3 var border = new THREE.MeshBasicMaterial({ color: 0xffe04526 });
4
5 var materials = [ border, border, border,
6 border, front, back ];
7
8 var geometry = new THREE.BoxGeometry(2, 4, 0.3);
9 var cube = new THREE.Mesh(geometry,
10 new THREE.MeshFaceMaterial(materials));
11 scene.add(cube);
Track real life movement
1 window.addEventListener('deviceorientation', function(e) {
2 cube.rotation.x = e.beta / 60;
3 cube.rotation.y = e.gamma / 60;
4 cube.rotation.z = e.alpha / 60;
5 });
Accelerometer
Real purpose: Turn to mute
Juggling visualizer
Measure z-forces on device
Plot it in graph over time
Juggle with multiple devices
Juggling visualizer
1 window.addEventListener('devicemotion', function(e) {
2 var serie = getGraphSerieForDevice(e.data.deviceId);
3 serie.addPoint([ e.data.timestamp, Math.abs(e.data.z) ]);
4 });
Weight scale
Beacons
Real purpose: ads
Beacons
Tag everyone with a beacon
Cross-reference facebook
Phone alerts you who to talk to
Beacons
1 var Bleacon = require('bleacon');
2
3 Bleacon.startScanning();
4
5 Bleacon.on('discover', function(b) {
6 console.log('found', b.major, b.minor, b.distance);
7 });
Work in progress in Firefox OS & Firefox for Android (https://bugzilla.mozilla.org/show_bug.cgi?id=1063444)
Fun with JavaScript and sensors - AmsterdamJS April 2015
Fun with JavaScript and sensors - AmsterdamJS April 2015
Linux
Kernel
Linux
Kernel
Gecko
Linux
Kernel
Gecko HTML5
UI
Linux
Kernel
Gecko HTML5
UI
Has all phone APIs in JS
Linux
Kernel
Gecko
Has all phone APIs in JS
Fun with JavaScript and sensors - AmsterdamJS April 2015
Fun with JavaScript and sensors - AmsterdamJS April 2015
Fun with JavaScript and sensors - AmsterdamJS April 2015
Fun with JavaScript and sensors - AmsterdamJS April 2015
Linux
Kernel
Gecko
Has all phone APIs in JS
Linux
Kernel
Gecko JanOS
Has all phone APIs in JS
Linux
Kernel
Gecko JanOS
Has all phone APIs in JS
Fun with JavaScript and sensors - AmsterdamJS April 2015
JanOS
Fork of Firefox OS
For phones & Rpi
Runs without display
Fun with JavaScript and sensors - AmsterdamJS April 2015
Fun with JavaScript and sensors - AmsterdamJS April 2015
Get hacking!
Grab a phone that has latest Chrome / Firefox
Use that sensor data
Think outside the box
Thank you!
http://janjongboom.com
janos.io
github.com/janjongboom/jsconf-asia

More Related Content

PDF
Fun with sensors - JSConf.asia 2014
PPTX
Project
PPTX
Monte carlo methods in graphics and hacking
PDF
The Reality Side Of AR
PDF
Qualcomm Vuforia Mobile Vision Platform: Smart Terrain for Depth-Sensing Cameras
PDF
(2015/09) Drone Imagery Economics
PPT
TINYOS Oscilloscope Application
PPTX
Fun with sensors - JSConf.asia 2014
Project
Monte carlo methods in graphics and hacking
The Reality Side Of AR
Qualcomm Vuforia Mobile Vision Platform: Smart Terrain for Depth-Sensing Cameras
(2015/09) Drone Imagery Economics
TINYOS Oscilloscope Application

What's hot (18)

PDF
Giancarlo Sudano - Welcome to the Quantum Age - A lap around Microsoft Quantu...
PDF
NERC Presentation
PDF
Near Exascale Computing in the Cloud
DOCX
Coding matlab
PDF
Processing images with Deep Learning
PDF
Skeltrack: A Free Software library for skeleton tracking (LinuxTag 2012)
PDF
雑談2017
PPTX
Creating A Multi-wavelength Galactic Plane Atlas With Amazon Web Services
PDF
Introduction to Mixed Reality
DOCX
Real-Time Hardware Simulation with Portable Hardware-in-the-Loop (PHIL-Rebooted)
PDF
Widgets and astropy: accomplishing useful research with undergraduates
PPT
Clouds
PDF
Enhanced Human Computer Interaction using hand gesture analysis on GPU
PDF
Kickoff Creative Coding 2
PDF
Gpu based-image-quality-assessment-using-structural-similarity-(ssim)-index
PPTX
Getting The Most Out of VR | Sinjin Bain
PDF
The Land of Oz 20191109 Magic Leap x docomo meetup
PPTX
How to build a Pokemon Go App
Giancarlo Sudano - Welcome to the Quantum Age - A lap around Microsoft Quantu...
NERC Presentation
Near Exascale Computing in the Cloud
Coding matlab
Processing images with Deep Learning
Skeltrack: A Free Software library for skeleton tracking (LinuxTag 2012)
雑談2017
Creating A Multi-wavelength Galactic Plane Atlas With Amazon Web Services
Introduction to Mixed Reality
Real-Time Hardware Simulation with Portable Hardware-in-the-Loop (PHIL-Rebooted)
Widgets and astropy: accomplishing useful research with undergraduates
Clouds
Enhanced Human Computer Interaction using hand gesture analysis on GPU
Kickoff Creative Coding 2
Gpu based-image-quality-assessment-using-structural-similarity-(ssim)-index
Getting The Most Out of VR | Sinjin Bain
The Land of Oz 20191109 Magic Leap x docomo meetup
How to build a Pokemon Go App
Ad

Viewers also liked (20)

PDF
ECMAScript 6
PDF
Webapp Rendering and Optimization.
PDF
HKG15-211: Advanced Toolchain Usage Part 4
PDF
[funka] Adaptive Images in Responsive Web Design
PDF
Why Visual Content will Dominate 2014
PDF
UX. How to start?
PDF
Chromium OS Introduction
PDF
User Centred Design - Designing Better Experiences - General Assembly - April...
PDF
Digital Signal Processor evolution over the last 30 years
PDF
JavaScript - new features in ECMAScript 6
PPTX
Technical Authorship in Practice - How to grow a technology blog and write a ...
PDF
Architecture of the Web browser
PDF
Clean code
PDF
The Future of Adaptive Content
PDF
Measuring What Matters: A UX Approach to Metrics :: UX Days Tokyo [April 2015]
PDF
How to name things: the hardest problem in programming
PDF
How to create an awesome presentation
PPTX
2015 Font Trends For Presentations
PDF
INFOGRAPHICS: The Good and The Bad
PPTX
Rethinking Best Practices
ECMAScript 6
Webapp Rendering and Optimization.
HKG15-211: Advanced Toolchain Usage Part 4
[funka] Adaptive Images in Responsive Web Design
Why Visual Content will Dominate 2014
UX. How to start?
Chromium OS Introduction
User Centred Design - Designing Better Experiences - General Assembly - April...
Digital Signal Processor evolution over the last 30 years
JavaScript - new features in ECMAScript 6
Technical Authorship in Practice - How to grow a technology blog and write a ...
Architecture of the Web browser
Clean code
The Future of Adaptive Content
Measuring What Matters: A UX Approach to Metrics :: UX Days Tokyo [April 2015]
How to name things: the hardest problem in programming
How to create an awesome presentation
2015 Font Trends For Presentations
INFOGRAPHICS: The Good and The Bad
Rethinking Best Practices
Ad

Similar to Fun with JavaScript and sensors - AmsterdamJS April 2015 (20)

PDF
Firefox OS and the Internet of Things - NDC London 2014
PDF
DomCode 2015 - Abusing phones to make the internet of things
PDF
The Wonderful-Amazing-Orientation-Motion-Sensormatic Machine
PPT
Device API - now with added fun
PDF
Altering the real world with JavaScript - Framsia
PPT
Sensing Mobile Devices talk from QCon London 2013
PDF
DAHO.AM 2015 - Abusing phones to make the internet of things
PDF
Motion recognition with Android devices
PDF
Advantages and limitations of PhoneGap for sensor processing
PDF
"Fun with JavaScript and sensors" by Jan Jongboom
PDF
Semantics and Sensors
PDF
Input Output devices for Processing IoT Data
PPT
PhoneGap - Hardware Manipulation
PPTX
lecture5-wearables-and-motion-sening.pptx
PDF
Mobile Sensor Networks based on Smartphone devices and Web Services
PPT
iwatchjr | Mobile Handset Sensors Coordinate System
PPT
Smartphone sensor and gesture
PDF
WebAPIs & WebRTC - Spotify/sthlm.js
PDF
Week12.pdf
PDF
RWW Mobile Summit Keynote Presentation, May 2010
Firefox OS and the Internet of Things - NDC London 2014
DomCode 2015 - Abusing phones to make the internet of things
The Wonderful-Amazing-Orientation-Motion-Sensormatic Machine
Device API - now with added fun
Altering the real world with JavaScript - Framsia
Sensing Mobile Devices talk from QCon London 2013
DAHO.AM 2015 - Abusing phones to make the internet of things
Motion recognition with Android devices
Advantages and limitations of PhoneGap for sensor processing
"Fun with JavaScript and sensors" by Jan Jongboom
Semantics and Sensors
Input Output devices for Processing IoT Data
PhoneGap - Hardware Manipulation
lecture5-wearables-and-motion-sening.pptx
Mobile Sensor Networks based on Smartphone devices and Web Services
iwatchjr | Mobile Handset Sensors Coordinate System
Smartphone sensor and gesture
WebAPIs & WebRTC - Spotify/sthlm.js
Week12.pdf
RWW Mobile Summit Keynote Presentation, May 2010

More from Jan Jongboom (20)

PDF
TinyML on Arduino - workshop
PDF
Intelligent Edge - Getting started with TinyML for industrial applications
PDF
Teaching your sensors new tricks with Machine Learning - Eta Compute webinar
PDF
Get started with TinyML - Embedded online conference
PDF
Adding intelligence to your LoRaWAN deployment - The Things Virtual Conference
PDF
Get started with TinyML - Hackster webinar 9 April 2020
PDF
Tiny intelligent computers and sensors - Open Hardware Event 2020
PDF
Teaching your sensors new tricks with Machine Learning - CENSIS Tech Summit 2019
PDF
Adding intelligence to your LoRaWAN devices - The Things Conference on tour
PDF
Machine learning on 1 square centimeter - Emerce Next 2019
PDF
Fundamentals of IoT - Data Science Africa 2019
PDF
17,000 contributions in 32K RAM - FOSS North 2019
PDF
Open Hours: Mbed Simulator
PDF
Efficient IoT solutions based on LoRaWAN, The Things Network and Mbed OS
PDF
Machine learning on 1 cm2 - Tweakers Dev Summit
PDF
Simulating LoRaWAN devices - LoRa Alliance AMM 2019
PDF
Develop with Mbed OS - The Things Conference 2019
PDF
Firmware Updates over LoRaWAN - The Things Conference 2019
PDF
Faster Device Development - GSMA @ CES 2019
PDF
Mbed LoRaWAN stack: a case study - LoRa Alliance AMM Tokyo
TinyML on Arduino - workshop
Intelligent Edge - Getting started with TinyML for industrial applications
Teaching your sensors new tricks with Machine Learning - Eta Compute webinar
Get started with TinyML - Embedded online conference
Adding intelligence to your LoRaWAN deployment - The Things Virtual Conference
Get started with TinyML - Hackster webinar 9 April 2020
Tiny intelligent computers and sensors - Open Hardware Event 2020
Teaching your sensors new tricks with Machine Learning - CENSIS Tech Summit 2019
Adding intelligence to your LoRaWAN devices - The Things Conference on tour
Machine learning on 1 square centimeter - Emerce Next 2019
Fundamentals of IoT - Data Science Africa 2019
17,000 contributions in 32K RAM - FOSS North 2019
Open Hours: Mbed Simulator
Efficient IoT solutions based on LoRaWAN, The Things Network and Mbed OS
Machine learning on 1 cm2 - Tweakers Dev Summit
Simulating LoRaWAN devices - LoRa Alliance AMM 2019
Develop with Mbed OS - The Things Conference 2019
Firmware Updates over LoRaWAN - The Things Conference 2019
Faster Device Development - GSMA @ CES 2019
Mbed LoRaWAN stack: a case study - LoRa Alliance AMM Tokyo

Recently uploaded (20)

PPTX
E -tech empowerment technologies PowerPoint
PDF
mera desh ae watn.(a source of motivation and patriotism to the youth of the ...
PPT
250152213-Excitation-SystemWERRT (1).ppt
PDF
Exploring VPS Hosting Trends for SMBs in 2025
PPTX
Layers_of_the_Earth_Grade7.pptx class by
PDF
Introduction to the IoT system, how the IoT system works
PPT
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
PPTX
Introduction to cybersecurity and digital nettiquette
PPTX
Slides PPTX: World Game (s): Eco Economic Epochs.pptx
PPTX
SAP Ariba Sourcing PPT for learning material
PDF
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
PPTX
1402_iCSC_-_RESTful_Web_APIs_--_Josef_Hammer.pptx
PDF
simpleintnettestmetiaerl for the simple testint
PPTX
Funds Management Learning Material for Beg
PDF
The Ikigai Template _ Recalibrate How You Spend Your Time.pdf
PDF
📍 LABUAN4D EXCLUSIVE SERVER STAR GAMING ASIA NO.1 TERPOPULER DI INDONESIA ! 🌟
PPTX
Internet Safety for Seniors presentation
PDF
SlidesGDGoCxRAIS about Google Dialogflow and NotebookLM.pdf
PPT
Ethics in Information System - Management Information System
PDF
Slides PDF: The World Game (s) Eco Economic Epochs.pdf
E -tech empowerment technologies PowerPoint
mera desh ae watn.(a source of motivation and patriotism to the youth of the ...
250152213-Excitation-SystemWERRT (1).ppt
Exploring VPS Hosting Trends for SMBs in 2025
Layers_of_the_Earth_Grade7.pptx class by
Introduction to the IoT system, how the IoT system works
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
Introduction to cybersecurity and digital nettiquette
Slides PPTX: World Game (s): Eco Economic Epochs.pptx
SAP Ariba Sourcing PPT for learning material
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
1402_iCSC_-_RESTful_Web_APIs_--_Josef_Hammer.pptx
simpleintnettestmetiaerl for the simple testint
Funds Management Learning Material for Beg
The Ikigai Template _ Recalibrate How You Spend Your Time.pdf
📍 LABUAN4D EXCLUSIVE SERVER STAR GAMING ASIA NO.1 TERPOPULER DI INDONESIA ! 🌟
Internet Safety for Seniors presentation
SlidesGDGoCxRAIS about Google Dialogflow and NotebookLM.pdf
Ethics in Information System - Management Information System
Slides PDF: The World Game (s) Eco Economic Epochs.pdf

Fun with JavaScript and sensors - AmsterdamJS April 2015