Android phone's sensors

Hi peeps,

 

Just though It'd best if I mention something I'm doing, perhaps somebody has already achieved this.

 

Practically all Anrdoid phones have a 3DOF accelerometer and a 3DOF magnetometer, the first thing that came to my mind was to use them for robotics!  Reason being i'm a student ie. a little scarce on funds for goodies like 9DOF boards.

 

My goal is to use these sensors for an AHRS or similar, but unfortunatley (I have read) Android is not a real-time OS so isn't suitable for running AHRS code.  So instead  I'm trying to get the sensor data to be spewed out of the phone into an arduino, and for this there's so far 2 solutions i've seen.

  1. Amarino, a fairly complete interface between Android an Arduino using bluetooth
  2. Android SerialPort API, to allow use of the serial ports hidden in the phones

Since i don't have a bluetooth arduino I'm going for number 2.  I have the demo code working, a serial monitor on my phone (like the arduino IDE one), all I need now is to make an app to pour sensor data down the line.  Trouble is I have literally no idea about java and I'm an Eclipse noob, so it's proving hard to do this super simple task :[

 

If anyone could help I'd be real grateful!  I'll post my progress here.

 

note - I know the sensors are a little crappy compared to say the Oilpan - in fact my phone is an LG GW620 which has a Bosch BMA150 accel (i2c, 10 bit-ADC),  and a [chinese] ak8973 mag. (i2c, 8-bit ADC).  Not great. 

Also I'm aware I need a gyro - I've got a 1 axis 20 year old Tokin CG-16DO ceramic gyro (off a Kalt Baron 30 - old school helicopter!), so I think i'll need to upgrade from that :P

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Activity

DIY Robocars via Twitter
RT @gclue_akira: 柏の葉で走行させてるjetracerの中身 #instantNeRF #jetracer https://t.co/giVvuE4hP7
Jul 4
DIY Robocars via Twitter
Cool web-based self-driving simulator. Click save when the AI does the right thing https://github.com/pncsoares/self-driving-car
Jul 4
DIY Robocars via Twitter
RT @donkey_car: Human-scale Donkey Car! Hope this makes it to a @diyrobocars race https://www.youtube.com/watch?v=ZMaf031U8jg
Jun 25
DIY Robocars via Twitter
Jun 25
DIY Robocars via Twitter
Jun 16
DIY Robocars via Twitter
RT @GrantEMoe: I won my first @diyrobocars @donkey_car virtual race! Many thanks to @chr1sa @EllerbachMaxime @tawnkramer and everyone who m…
Jun 13
DIY Robocars via Twitter
RT @gclue_akira: JetRacerで自動走行したコースを、InstantNeRFで再構築。データセットは別々に収集 #jetracer #instantNeRT https://t.co/T8zjg3MFyO
Jun 13
DIY Robocars via Twitter
RT @SmallpixelCar: SPC 3.0 Now the motor also works. This car is doable. I just need to design a deck to mount my compute and sensors. http…
Jun 13
DIY Robocars via Twitter
RT @SmallpixelCar: My new car SPC 3.0. https://t.co/CKtkZOxeNQ
Jun 7
DIY Robocars via Twitter
RT @SmallpixelCar: High speed at @diyrobocars thanks @EdwardM26321707 for sharing the video https://t.co/o4317Y2U1S
Jun 7
DIY Robocars via Twitter
RT @SmallpixelCar: Today at @RAMS_RC_Club for @diyrobocars. Used @emlid RTK GPS and @adafruit @BoschGlobal IMU. Lap time 28s https://t.co/R…
May 28
DIY Robocars via Twitter
May 15
DIY Robocars via Twitter
May 14
DIY Robocars via Twitter
May 13
DIY Robocars via Twitter
RT @f1tenth: Say hi to our newest #F1TENTH creation for @ieee_ras_icra next week in Philly. It’s going to be huge! 😎 🔥 @AutowareFdn @PennEn…
May 13
DIY Robocars via Twitter
May 11
More…