A13-OLinuXino project – control relays and read ADCs and IOs with Android


Yesterday we got yet another amazing project by our friend Dimitar Gamishev.

He was playing with A13-OLinuXino-WIFI and decided to learn how to write Android applications, but he didn’t stop with “Hello world”

What he decided to try is to interface low level resources to his Android application like to implement I2C communication and control of MOD-IO connected to A13-OLinuXino UEXT connector.

The result is MODIO.apk which you can download from: https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/A13/ANDROID-MOD-IO

You can see this application running in this video: http://www.youtube.com/watch?v=fBydZn8FylE

With it you can switch on/off relays on MOD-IO and read the Input status and ADC analog values (the trimmer potentiometer on the picture).

The sources are at GitHub: https://github.com/hehopmajieh/modio_android, what he did was to use Android NDK to implement the I2C communication in C then to export it and make it public for use by the Android SDK java applications. As you can see the result is Android APK which you can run and it communicates with MOD-IO connected to UEXT.

Using the same approach all GPIOs, SPIs, I2C and etc resources on A13-OLinuXino can be made available for native Android SDK applications and you can intereface real world hardware with pure Android application code.

12 Comments (+add yours?)

  1. sectorqube
    Oct 25, 2012 @ 19:58:32

    Wow amazing work olimex … you can use google io io for android that is also another option … its jus a suggestion anyways keep this goin


  2. Curtis Pope
    Dec 01, 2012 @ 05:53:24

    This is awesome. Will definitely try to modify this for Gpio once I learn a little more about android development. Being able to read native inputs and adc is pretty cool.


  3. Harish G
    Dec 29, 2012 @ 23:29:48

    Hi here you are accessing i2c, if i want to access GPIO for my application, hw i have to access


  4. Leo van der Veen
    Mar 13, 2013 @ 10:59:04

    Great work, would also be interested in a port that would be able to access the GPIO pins. I shall have a look at it but come from a different (coding) background. It might already be done, is it ?


  5. michalscnoplMichal
    Apr 23, 2013 @ 15:35:44

    Does anyone has solution for SPI?


    • Dave
      Jun 17, 2013 @ 18:06:13

      Yes, an SPI example using SPI over UEXT would be interesting. I’m cloning the git project now and am taking a look at it. Have you made any progress on your end with SPI?


  6. Dave
    Jun 17, 2013 @ 20:32:27

    I’ve downloaded the TestJNI code and have it compiling okay. However, when I build, all it seems to do is create libaxonI2C.so and doesn’t build the APK. I am new to Android development, so would it be possible for you to include information about changing the Eclipse project settings so that the APK is generated? In other words, info about how you created MODIO.apk would be super helpful. Thank you!


  7. Dave McLaughlin
    Jan 29, 2014 @ 10:17:37

    Nice to see someone has found a use for my I2C code 🙂


  8. salim safran
    Mar 08, 2015 @ 09:29:34

    did any port this wonderful android i2c code to QT android or Android Studio?.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: