Instructables

SensoDuino: Turn Your Android Phone into a Wireless Sensors Hub for Arduino

Featured
Picture of SensoDuino: Turn Your Android Phone into a Wireless Sensors Hub for Arduino
sensoduino_b.jpg
sensoduino versus shields.jpg
SensoDuino (3).png

UPDATES
  • Nov 23, 2013: SensoDuino 0.160 gets a face left.  
  • Nov 19. 2031: OPINION: The Amazing Synergy Between Arduino & Android.
  • Nov 19, 2013: SensoDuino 0.159 is out. Android phone date (y,m,d) and time (h,m,s) are supported as sensors. Support for Android KitKat (4.4/API 19). 

INTRODUCTION

Think of SensoDuino as having over a dozen virtual shields for your Arduino each providing a function or feature such as GSM, GPS, Gyro, etc but without having to stack or wire these components. SensoDuino is a free Android application that captures data from sensors built into your Android mobile device then transmits the data over the HC-05 Bluetooth module to Arduino Uno or any device with serial Bluetooth capabilities such as a Windows PC, Mac, or Bluetooth equipped microcontroller. SensoDuino also saves the captured data to a comma-delimited text file.  This app has been tested and designed for the HC-05 Serial Bluetooth module. Other Bluetooth modules may or may not work. Please refer to comments by users who tried other Bluetooth modules with this app. 

You can install SensoDuino from Google Play only. 

https://play.google.com/store/apps/details?id=com.techbitar.android.sensoduino

You can control the frequency of sensor data reading, transmitting, and logging (subject to the specifications of the sensor vendor.)  This is my second Android app for Arduino Uno. You might also be interested in my first app Andruino  which is a simple 2-way Bluetooth-based Android controller for Arduino Uno.

SensoDuino eliminates the need for USB Host hardware for your phone or Arduino Uno. For Arduino Uno or microcontroller, you only need a $10 HC-05 Bluetooth module (or equivalent).  

Save over $200 in sensors and parts for your Arduino Uno or microcontroller project, if you already have a mid-range Android device such as my Samsung Galaxy II Plus. See section titled: Android: A Capable Electronics DIY Platform.

SUPPORTED SENSORS

SensoDuino recognizes the following Android sensors: GPS, Orientation, Gravity, Rotation Vector, Gyroscope, Accelerometer, Linear Accelerometer,  Magnetometer, Light Level, Audio Level, Proximity, Pressure, Temperature, and Relative Humidity.

Some software (virtual) sensors relay on the presence of hardware sensors to function. For example, the gravity sensor, linear acceleration sensor, and rotation vector sensor all of these software sensors relay on the presence of hardware gyro sensor on your Android device to function.  
 
SensoDuino also features an Android sensor scanner that will list hardware and software sensors supported by your Android device as well as key sensor specifications such as max power consumption, resolution, vendor, etc.  Some Android devices have duplicate sensors from different vendors. The Android SDK will return the default sensor.

FEATURES OVERVIEW
  • Reads Android sensors. 
  • Saves sensor readings to comma-delimited text file. 
  • Transmits readings in ASCII comma-delimited format via Bluetooth. 
  • Lists your Android device's built-in sensors both hardware and software (virtual sensors). 
  • Set speed of sensor data capturing, logging, and transmission from 100 milliseconds to 10 minutes (subject to sensor limits). 
  • Keeps track of accuracy for logged sensor readings and provide visual clues for inaccurate sensor data. 
  • Geo-tags sensor readings using your Android device GPS.
  • Optimized for speed of operation and transmission. 
  • Keeps device awake to prevent loss of sensor data logging. 
  • Scan and list available sensors in your device and their specifications.
WHAT CAN YOU DO WITH SENSODUINO

With the help of Arduino or other microcontrollers, SensoDuino can be used in robotics and UAV guidance. Its support for 12 motion and environment sensors covers a wide range of sensory feedback. Also, SensoDuino can be used for logging. The ability to set the speed of logging from 10Hz to once every 10 minutes allows for high-speed as well as time-lapse logging of sensor readings.

PROJECTS BASED ON SENSODUINO

Bluetooth-controlled Pan/Tilt Servo Platform Using Android (SensoDuino) & Arduino
http://www.techbitar.com/bluetooth-controlled-pan-tilt-servo.html

IR Remote Control Station for SensoDuino
http://www.techbitar.com/universal-ir-remote-control-station-for-android.html

THANKS

Special thanks to colleagues from PIN13 Protospace who helped with testing, usability, guide review and proofreading. Mainly, I wish to thank Jafar Quttaineh for his detailed product testing and for his invaluable insights and feature suggestions. Also thanks to Mujahed Al-Tahle for his detailed analysis and testing of the product and guide.

PLEASE RATE ON GOOGLE PLAY

This is a free app and only through your ratings can I determine if it's worth supporting or discontinuing.


 
Remove these adsRemove these ads by Signing Up
AndreP18 days ago

how can i use it with a raspberry?

DH61 month ago

Does this app still transmit data when running in the background (ie. hit the home button after syncing)?

alda13 months ago

Thank you Hazim for the app, and excellent and clear ideas. I have just ported SensoDuino into BB10 and planning interesting projects.

takkan6 months ago

hello!

I am planning on working on a project using SensoDuino and an old android phone, just wanted to know what is the oldest platform of android that this app is compatible with?

schel6 months ago

Great Job! I've got my senso' ! whens GPS n some of the other N/A's available?

yonache6 months ago

I have a problem

I am unable to establish communication between the HC-05 to the arduino

The HC-05 transmit data but the arduino didt get that

/*

PROJECT: SensoDuino 0.17

PROGRAMMER: Hazim Bitar (techbitar at gmail dot com)

DATE: Sep 30, 2013

FILE: sensoduino.ino

LICENSE: Public domain

*/

// Replace sensor numbers with Names

#include <SoftwareSerial.h>

#define START_CMD_CHAR '>'

#define END_CMD_CHAR '\n'

#define DIV_CMD_CHAR ','

#define DEBUG 1 // Set to 0 if you don't want serial output of sensor data

SoftwareSerial mySerial(3, 2);

String inText;

float value0, value1, value2;

void setup() {

Serial.begin(115200);

mySerial.begin(115200);

Serial.println("\nSensoDuino 0.13 by TechBitar.com (2013).\n");

Serial.println("Android Sensor Type No: ");

Serial.println("1- ACCELEROMETER (m/s^2 - X,Y,Z)");

Serial.println("2- MAGNETIC_FIELD (uT - X,Y,Z)");

Serial.println("3- ORIENTATION (Yaw, Pitch, Roll)");

Serial.println("4- GYROSCOPE (rad/sec - X,Y,Z)");

Serial.println("5- LIGHT (SI lux)");

Serial.println("6- PRESSURE (hPa millibar)");

Serial.println("7- DEVICE TEMPERATURE (C)");

Serial.println("8- PROXIMITY (Centimeters or 1,0)");

Serial.println("9- GRAVITY (m/s^2 - X,Y,Z)");

Serial.println("10- LINEAR_ACCELERATION (m/s^2 - X,Y,Z)");

Serial.println("11- ROTATION_VECTOR (Degrees - X,Y,Z)" );

Serial.println("12- RELATIVE_HUMIDITY (%)");

Serial.println("13- AMBIENT_TEMPERATURE (C)");

Serial.println("14- MAGNETIC_FIELD_UNCALIBRATED (uT - X,Y,Z)");

Serial.println("15- GAME_ROTATION_VECTOR (Degrees - X,Y,Z)");

Serial.println("16- GYROSCOPE_UNCALIBRATED (rad/sec - X,Y,Z)");

Serial.println("17- SIGNIFICANT_MOTION (1,0)");

Serial.println("97 - AUDIO (Vol.)");

Serial.println("98 - GPS1 (Lat., Long., Alt.)");

Serial.println("99 - GPS2 (Bearing, Speed, Date/Time)");

Serial.println("\n\nNOTE: IGNORE VALUES OF 99.99\n\n");

Serial.flush();

}

void loop()

{

Serial.flush();

int inCommand = 0;

int sensorType = 0;

unsigned long logCount = 0L;

char getChar = ' '; //read serial

// wait for incoming data

if (Serial.available() < 1) return; // if serial empty, return to loop().

// parse incoming command start flag

getChar = Serial.read();

if (getChar != START_CMD_CHAR) return; // if no command start flag, return to loop().

// parse incoming pin# and value

sensorType = Serial.parseInt(); // read sensor typr

logCount = Serial.parseInt(); // read total logged sensor readings

value0 = Serial.parseFloat(); // 1st sensor value

value1 = Serial.parseFloat(); // 2rd sensor value if exists

value2 = Serial.parseFloat(); // 3rd sensor value if exists

if (DEBUG) {

Serial.print("Sensor type: ");

Serial.println(sensorType);

Serial.print("Sensor log#: ");

Serial.println(logCount);

Serial.print("Val[0]: ");

Serial.println(value0);

Serial.print("Val[1]: ");

Serial.println(value1);

Serial.print("Val[2]: ");

Serial.println(value2);

Serial.println("-----------------------");

delay(10);

}

}

vickyhiggs7 months ago

Hi sir i'm doing my project based on sensoduino using my android accelerometer sensor for driving toy helicopter(like your pan/tilt servo).Can you please help me with coding???

mike_vasili7 months ago

hello... i have a an arduino mega 2560 a bluetooth module HC-05 and a galaxy s4. the problem is that, to watch the data received from the phone to the serial monitor of arduino i have to constantly press the reset button of the arduino. please help me...

grnbrgd49 months ago
this is going to work perfectly for my S4 Active on my UAV project with my two pals
cgrrty9 months ago
Can i send the Android Phone's data to the pc?if can do it,what is sofrware i would used in the pc?
techbitar (author)  cgrrty9 months ago
it depends on what you plan to do with the data on the PC. If you just want to display it, a terminal emulator like Tera Term running on your PC will do. if you want to parse the info and process it you use the sample code I provide with the SensoDuino project info. but you can log, plot, parse, etc the sensoduino data on the PC.
cgrrty techbitar9 months ago
where i can download the last version apk?
kindflower10 months ago
that's great

if i want to use arduino mega 2560.what are the changes to be made?
techbitar (author)  kindflower10 months ago
I don't have an arduino mega 2560 to test with but give it a shot and see if it works as is. judging from the 2560 's spec sheet I don't expect any major tweaking but I have been proven wrong before.
thanks
Raitis11 months ago
Right what I needed!
Can I put the phone down at a random position and set values to zero for that position?
techbitar (author)  Raitis11 months ago
One way to achieve something similar is to have your receiver application be it on PC or Arduino read and save sensor readings from your SensoDuino as initial sensor values. Then deduct these saved initial values from new sensor readings. For example if you start your app and it get from SensoDuino a GPS Yaw of 60, then every new Yaw value will get 60 deducted from it to give you the delta of the two values. So if next SensoDuino GPS reading gives a Yaw of 90 then the difference is 30. This is one way to "zero" your SensoDuino readings.
Raitis techbitar11 months ago
Well, that I've thought of myself, but still thanks! :)
The use I have for this is such that I need to log it to phone first and later just do some work with the data on PC alone. It wont be a big deal to just take starting positions and deduct those from every other position in Excel (I hope).
I've written a review on GPlay as well now with another issue - the app stops logging data when you turn the screen off. Given that my logging times are mostly 2 hours + I might have some issues regarding battery life and some accidental hitting on screen as well, can you do something about it?
Other than that the app does the trick for me even despite I log my postitions using accelerometer because gyro is not present on my phone. Exporting the log to Excel is quite easy too.
Thanks! :)
techbitar (author)  Raitis11 months ago
Hi Raitis, I replied to your comment on Gplay. Thanks for the rating :)

I will look into ways to extend the battery life in future versions. I have not tried it yet but maybe enabling Airplane mode if your mobile supports it can save additional power, if you don't need to be connected to the mobile network while logging. Thanks for the suggestions and rating.
Raitis techbitar11 months ago
You're worth the rating!
I kinda thought about using the airplane mode, since was not sure if let's say an incoming call would not stop the logging process as well.
Thanks for the effort!
techbitar (author)  Raitis11 months ago
FYI, I added the Accelerometer sensor to the latest version of SensoDuino. Before, I had the Linear Accelerometer only.
ArduMower11 months ago
Great job. We send the data to the mobile phone ;) http://www.youtube.com/watch?v=tOm5aNRvX0Q
techbitar (author)  ArduMower11 months ago
Nice! Thanks for sharing.
Temporalis11 months ago
This program is fantastic! Is there a way to send the accumulated data to an email address on a set schedule using the phone's wireless access? If so perhaps it might be a future feature. I think that would make this the perfect piece of software for me.
techbitar (author)  Temporalis11 months ago
Thanks for the good suggestion. I will add it to the feature request list.
NTT11 months ago
This is exactly what I was looking for! Thank you ever so much :-D
techbitar (author)  NTT11 months ago
You're welcome. Glad to hear it.
braserito6611 months ago
This is a very interesting way to use old smart phones to share sensors and comms
techbitar (author)  braserito6611 months ago
an Android phone, when paired with let's say an Arduino Uno, is a very cost effective DIY platform when compared to other bare-bone palm-sized ARM SoC solutions such as raspi after you add basic sensors and comparable features to the latter.
zx lee11 months ago
Hi, first i would like to say i really like how you connect between arduino and android.

My question is how to get started in programming android? what are the programming language used?
techbitar (author)  zx lee11 months ago
Hi, AppInventor is one of the simplest way to get into Android development. http://appinventor.mit.edu

If you prefer Java you can start with Eclipse or Android Studio.
http://developer.android.com/sdk/index.html
audreyobscura11 months ago
Cool idea, and informative post.
techbitar (author)  audreyobscura11 months ago
Thank you!