bridging sensors to mobile phoneswireless.ictp.it/wp-content/uploads/2012/02/sensors4... · 2012....

Post on 07-Mar-2021

5 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Bridging Sensors to Mobile Phones

Stephen OkayFebruary 22nd 2012The Abdus Salam Int’l Center for Theoretical PhysicsTrieste, Italy

Wednesday, February 22, 2012

Mobile Phones can be sensor platforms too!

•Many mobile phones have built in accelerometers, light sensors, cameras, GPS receivers, and other sensors. These are definitely very useful in certain situations.

• But you still can’t hook a water quality or temperature or other type of sensor to them without some difficulty...

Wednesday, February 22, 2012

....or can you ?

•New types of peripheral devices allow researchers to attach different sensors to your phone.

•There are basically two main approaches:•Frequency modulation via headphone jack.

•USB Host adapter/bridge boards

Wednesday, February 22, 2012

Audio frequency modulation via headphone jack

• Modulated audio signals are converted to digital data and vice-versa. This is essentially a classic modem

•Pros:• Well-understood, “low-tech” approach

•Does not require access agreeements, NDAs or other legal arrangements to use. Just plug-and-play with the hardware(software, of course, still needed on the phone)

•Cons•Low-speed (approx. 300-8800 baud)

•Dependent on quality/fidelity of headphone audio components.

•Vendor/manufacturer may use some frequencies internally further limiting useful frequency range(and thereby bandwidth)

Wednesday, February 22, 2012

Examples

•University of Michigan “Hi-Jack” project

Wednesday, February 22, 2012

Examples

•Credit-card swipe-reader

Wednesday, February 22, 2012

USB Adapters

•Many mobile phones have a USB port on them for data transfer to a PC, recharging, etc.

•Unlike RS-232 or TTL-serial devices, USB devices can’t be connected to each other ad-hoc.

•USB Devices are either a USB-Host or USB-Client device

Wednesday, February 22, 2012

The real problem...

•The USB standard is both a data communications AND a power standard. •A USB Host must provide 500mA power at 5V minimum to connected

client devices in addition to protocol support. (Phones or cameras typically can’t do that)

• USB Clients will communicate only with devices they recognize as a Host, like a desktop or laptop computer.

•Sensor carrier boards are USB Client devices, so how do we get them to talk to a phone, which is also a USB Client ?

Wednesday, February 22, 2012

Answer...

•USB bridge/adapter boards which provide the necessary power as well as protocol support but processor-wise are just microcontrollers.

Sparkfun IOIO Board

Google Android Accessory Board

...and about 12 others from different vendorsWednesday, February 22, 2012

USB Bridge Boards(cont’d)

•Features•Analog & Digital I/O pins for attaching sensors, servos,motors, LEDs, etc.

•Open Hardware design, often with Open Source firmware.

•Currently Limited to Android devices• (Apple requires a licensing agreement for attaching devices to their hardware)

Wednesday, February 22, 2012

The “ThermalPod” Project

•Huawei IDEOS Android Phone•TMP-36 temperature sensor•IOIO Bridge Board

=

Wednesday, February 22, 2012

What’s going on here ?

-USB Host on IOIO provides power and data exchange between phone and board-Android app on phone sends commands to IOIO via the Android Debug service.-Microcontroller on IOIO reads analog signal from temperature sensor & sends that back over the Android Debug Port

Wednesday, February 22, 2012

On the phone side...

•An Android application, written using the standard Android SDK and the IOIO Library, gets the sensor voltage data off the board and converts that to a temperature value that is then displayed on the screen.

•The IOIO Library works with any Android phone running Android 1.5 or later.

•The official ADK Library requires an Android 2.3.4 or later. •Different boards have different OS requirements.

Wednesday, February 22, 2012

Going further...

•Any of the analog or digital sensors used in the wireless sensor exercises in this School can be connected to one of these boards:•Temperature

•Moisture

•Humidity

•Light

•etc.

•You can also set the pins to output and turn on LEDs, a buzzer/bell, turn a servo-motor, etc.

•Attach a Zigbee Coordinator node to the UART pins and use the phone as a sensor gateway.

Wednesday, February 22, 2012

Some useful links

•University of Michigan “Hi-Jack” Project:http://www.eecs.umich.edu/~prabal/projects/hijack/

•Details on USB Host/Client, etc.:https://en.wikipedia.org/wiki/Universal_Serial_Bus

•Android Accessory Development Kit:http://developer.android.com/guide/topics/usb/adk.html

•IOIO Board - https://www.sparkfun.com/products/10748•Freeduino USB Host:http://shop.moderndevice.com/products/freeduino-usb-host-board

•Generally useful USB Host Board blog:http://www.circuitsathome.com/

Wednesday, February 22, 2012

top related