Android Beaglebone Weather Cape

From Texas Instruments Wiki
Jump to: navigation, search

Content is no longer maintained and is being kept for reference only!

The #evp parser function was deprecated in EmbedVideo 2.0. Please convert your parser function tag to #ev.

Introduction

Penetration of Android into non phone segments like Home Automation, Thermostat, Portable Data Terminals, Point of Sale etc. – raise a need of Android solution with domain specific features like temperature and light sensor, ethernet, mass storage, external modem, custom boot partitions, serial port interface, smartcard interface and many more.

Primary objective of this wiki is to explain detailed beaglebone weather cape porting guide on TI's Android Jellybean release.[ Link [1]].

About Beaglebone Weather Cape

BeagleBone WeatherCape.jpg


The BeagleBone Weather Cape provides weather data for the BeagleBone including temperature, barometric pressure, humidity, and ambient light. These weather input data can be accessed via I2C bus. The BeagleBone Weather Cape also features an LED to indicate that power is applied. [Ref# [2]]

Block Diagram WeatherCape.png

Above block diagram gives the overview of sensor controls

  • EEPROM

The Beaglebone Weather Cape has an EEPROM containing information that will allow the SW to identify the board and to configure the expansion headers pins as needed. EEPROMs are required for all Capes sold in order for them to operate correctly when plugged in the Beaglebone.

  • Ambient Light Sensor

The TSL2550 features two photodiodes and an ADC on a single CMOS integrated circuit to provide 12-bit light measurements. Ambient light is converted into currents by the photodiodes and eventually to digital outputs by the ADC. One photodiode of TSL2550 is sensitive primarily to infrared light; therefore, the digital output from this photodiode is used to compensate the infrared effect on the digital output of the other photodiode, which is sensitive to both visible and infrared light. The final output data calculated in a commonly used illuminance unit of Lux.

  • Temperature and Barometric Pressure Sensor

The BMP085 uses piezo-resistive technology to provide high accuracy measurements. Temperature and pressure data can be sampled up to 128 samples per second and are converted digitally via an ADC before being transmitted over I2C interface. The output data is provided in oC and hPa (millibar) using calibration data stored inside BMP085 EEPROM.

All above listed sensors are interfaced with AM335x over I2C bus. Tricky part over here is on the board initialization one has to read the EEPROM of the cape and identify whether – sensor cape (named weather cape here) is connected to AM335x base module.


Porting Steps

Step1 : Enabling kernel driver for TSL2550 & BMP085

Download patches from [HERE]

  • Patches are for
    • Enabling beaglebone weather cape support
    • BMP085 driver modification to report events to input sub system - required for Android
/* go to android kernel directory */
$cd <MY_DIR>/kernel

/* extract downloader patch files */
$tar -xzvf Beaglebone-weathercape.tar.gz

/* apply patches */
$ git am 0001-bmp085-sensor-modified-to-work-with-android.patch
$ git am 0002-added-support-for-beaglebone-weather-cape.patch
  • Enable TSL2250 and BMP085 in menuconfig
Symbol: SENSORS_TSL2550 [=y]                                                                                                                         │
  │ Type  : tristate                                                                                                                                     │
  │ Prompt: Taos TSL2550 ambient light sensor                                                                                                            │
  │   Defined at drivers/misc/Kconfig:351                                                                                                                │
  │   Depends on: MISC_DEVICES [=y] && I2C [=y] && SYSFS [=y]                                                                                            │
  │   Location:                                                                                                                                          │
  │     -> Device Drivers                                                                                                                                │
  │       -> Misc devices (MISC_DEVICES [=y]) 
Symbol: BMP085 [=y]                                                                                                                                  │
  │ Type  : tristate                                                                                                                                     │
  │ Prompt: BMP085 digital pressure sensor                                                                                                               │
  │   Defined at drivers/misc/Kconfig:480                                                                                                                │
  │   Depends on: MISC_DEVICES [=y] && I2C [=y] && SYSFS [=y]                                                                                            │
  │   Location:                                                                                                                                          │
  │     -> Device Drivers                                                                                                                                │
  │       -> Misc devices (MISC_DEVICES [=y]) 

Step 2 : Android HAL

  • Download patches for Android HAL development for beaglebone sensor cape [Click HERE]
  • Patch set includes
    • support of beaglebone weather cape sensor board
    • Temperature, Pressure and Ambient light sensor values will be measured through sensor service manager
  • Apply patches
/* go to android directory */
$cd <MY_DIR>/device/ti/beaglebone

/* extract downloader patch files */
$tar -xzvf Beaglebone-weathercape-android-hal.tar.gz

/* apply patches */
$ git am 0001-added-sensor-support-for-beaglebone.patch
$ git am 0002-enabled-sensor-library-for-beaglebone-device.patch
$ git am 0003-Added-permission-to-BMP085-sensor-node.patch


Note: The complete development and porting guide for introducing new sensor inside Android is available [HERE]

Step 3: Build the Android source

  • Follow the procedure available at [[3]]

Application Source & Binary

  • Download application source at [[4]]
  • Download application binary/apk at[[5]]
  • Snapshots from application

Sensorapp mainscreen.jpg

Sensorapp temperature.jpg

Sensorapp light.jpg

Sensorapp pressure.jpg

References

http://circuitco.com/support/index.php?title=BeagleBone_Weather
http://gitorious.org/blazetablet/device-ti-blazetablet/commit/52268922c84304897a39e65817a0002b5bcf6b7b
http://beagleboardtoys.info/index.php?title=BeagleBone_Weather#Software_Support

Technical Support and Product Updates

For further information or to report any problems, contact
http://e2e.ti.com/android
http://support.ti.com

For community support join
http://groups.google.com/group/rowboat
For IRC #rowboat on irc.freenode.net