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:

Leave a Reply

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

You are commenting using your 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: