SCRATCH control for MOD-IO


Controlling Relays, Switching ON/OFF of 220V appliances and home automation is possible now with Scratch + MOD-IO.

1. Install python-smbus:

#apt-get install python-smbus
2. Install scratchpy

#git clone
#cd scratchpy
#make install

3. Run SCRATCH and open

4. Go to ‘Sensing’. Right click ‘… sensor value’ hit: ‘Enable
remote sensor connections’ (if it not enabled).

5. Run terminal and start the python script
#python -a 0x58 -i 2 --port=xxxx --verbose
-i - I2C bus that you're using
-a - Address of MOD-IO (default 0x58)
--host - IP if you're connecting remote computer
--port - Port number
--verbose - Print some debug information.
For example:
#python -a 0x58 -i 2 --verbose --host= --port=40000

You should see message that the program is connected.

6. Run the Scratch block

7. Press ‘1’, ‘2’, ‘3’ or ‘4’ to toggle relays

the project is uploaded on GitHub:

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:

You can see this application running in this video:

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:, 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.