SCRATCH control for MOD-IO

Image

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 https://github.com/pilliq/scratchpy.git
#cd scratchpy
#make install

3. Run SCRATCH and open MOD-IO.sb

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 IO.py -a 0x58 -i 2 --host=xxx.xxx.xxx.xxx --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 IO.py -a 0x58 -i 2 --verbose --host=192.168.0.100 --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: https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/A13/A13%2BSCRATCH%2BMOD-IO

Web Server with MOD-IO + MOD-ENC28J60

Image

Doing embedded Web servers with microcontrollers is not new but Andrew Rossignol blogged recently that he made embedded Web Server with MOD-IO and MOD-ENC28J60, the catch is that MOD-IO have ATMega16 microcontrollers with only 16KB Flash and 1K RAM!

You can read more about his implementation on his blog

Good work!

Raspberry Pi can now work with UEXT modules

Image

In my previous post https://olimex.wordpress.com/2012/11/21/raspberry-pi-gpio-to-breadboard-and-uext-adapter/ I wrote about the Raspberry pi adapter we designed which allow Raspberry Pi to have access to the modules we have like Relay modules, Thermocouple sensor modules, 3-axis magnetometer and accelerometers, Zigbee, WiFi, GSM, GPS etc.

The RPI-UEXT adapter is already in stock and you can wire it to your Raspberry Pi with any 26-pin ribbon cable, we do offer 15 cm cable also which you can use with RPI-UEXT

On this video you can see how Raspberry PI is controlling MOD-IO 4 relays with the help of the RPI-UEXT adapter: http://www.youtube.com/watch?v=vuHU2SmLYBI

to make MOD-IO control as on above video with your RPi you should do as follows:

step 1:

sudo vi /etc/modprobe.d/raspi-blacklist.conf
The file should look like:

# blacklist spi and i2c by default (many users don’t need them)
blacklist spi-bcm2708
#blacklist i2c-bcm2708

step 2:

sudo vi /etc/modules

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with “#” are ignored.
# Parameters can be specified after the module name.

i2c-dev
snd-bcm2835

step 3:

sudo apt-get install python-smbus

step 4:

sudo vi modio.py

import smbus
import time
bus = smbus.SMBus(0)
address = 0x58

while 1:
bus.write_byte_data(address, 0x10, 0x0F)
time.sleep(1)
bus.write_byte_data(address, 0x10, 0x00)
time.sleep(1)

step 5:

sudo python modio.py

and you will see how the relays go ON and OFF 🙂

have fun!

iMX233-OLinuXino-MAXI and lot of Relay IOs through MOD-IO

MOD-IO is UEXT module with 4 relays and 4 optoisolated inputs, the great thing is that many MOD-IO could stack together and this way you have access virtually to unlimited number of IOs.

This project on GitHub make iMX233-OLinuxino-MIAXI to talk and control MOD-IOs https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/iMX233/MOD-IO

NEW BOARD: MOD-IO2

Image

MOD-IO2 EUR 12.95 lower cost, smaller version of our popular MOD-IO board, it have 2 RELAYs with 15A/250VAC specs and 7 GPIOs which are accessable via UEXT connector by I2C.

The best of all is MOD-IO2 are addressable and stackable so you can connect many together and have as many as you wish GPIOs and RELAYs connected to your board with UEXT connector.