Me Shield for Raspberry Pi

微信截图_20160128161844

Description

Me shield for Raspberry Pi is attached on the Raspberry Pi to give Me Baseboard or Makeblock Orion access with hardware serial communication. 微信截图_20160128162026

Features

  • No soldering needed and ready to use
  • Support Python programming
  • Compatible with Model A,B, B+
  • With a RJ25 connector for Me Baseboard or Makeblock Orion
  • Come with header, without occupying GPIO pins

Specification

Dimension: 45 x 35 x 27 mm (Length x Width x Height)

User Guide

Getting started


s4r_wiring

Suggested Reading

What is Raspberry Pi?
How to install operating system images on Raspberry Pi?

step 1 Wiring

Make sure you have installed operating system images on Raspberry PI and connect your Raspberry Pi to the internet via Ethernet cable. Slide the Me Shield for Raspberry Pi on your Raspberry Pi, and connect the shield to Me Baseboard Port 4(Leonardo) or Makeblock Orion Port 5(Uno). Next, power on the Me Baseboard or Makeblock Orion with 12V power supply. (the shield already supplies 5V voltage to raspberry, so it is not necessary to power raspberry separately)

s4r_wiring2

Step 2 Login Raspberry Pi

If you are under windows, then you need to download a free SSH software(Windows) here. Then click button “Quick Connect” to log in. Type the IP, user name, password(user name: pi, password: raspberry).

quickconnectloginSSHlogin

If you are on Mac or linux, then open a terminal with samba service installed on raspberry pi. Type the following command in the terminal window.

ssh pi@<your-rpi-ip>

More useful document http://www.raspberrypi.org/documentation/remote-access/ssh/unix.md.

 Step 3 Disable the occupied hardware serial ttyAMA0.

Make sure that pyserial is installed on your rip, if not, type the following command and wait until the process done.

sudo apt-get install python-serial

On your Raspberry Pi, disable the login prompt.

serial

Step 4 Install python library for Makeblock

Type the following command to install the library.

sudo pip install megapi

The initial code for Python:

from megapi import *

bot = MegaPi()

bot.start() #if using usb cable, need to call bot.start(‘/dev/ttyACM0’)

python your code

Step 5 Upload an Arduino firmware to Me Baseboard or Me Orion.

Download the Arduino library for Makeblock https://github.com/Makeblock-official/Makeblock-Libraries/archive/master.zip

Copy the makeblock folder to your Arduino default library. Your Arduino library folder should now look like this:

  • (On Windows): [x:\Users\XXX\Documents]\Arduino\libraries\makeblock\src
  • (On Mac OSX): [\Users\XXX\Documents]\Arduino\libraries\makeblock\src

Open Arduino IDE, choose the firmware from File>Examples according to your board type (Orion in this case).

firmware

 

Step 6 Connect a motor to port M1 on Me Orion.

Make sure that board is powered by external power.

Orion&Motor

Step 7 Run the demo script on raspberry Pi

Go to the directory where the demo script located and run the motorRun.py

cd PythonForMegaPi

cd examples

python motorRun.py

Everything should be fine here, have fun!

 

Python API

  • Start
    • MegaPi()
    • start()
  • GPIO
    • digitalWrite( pin, level )
    • pwmWrite( pin, pwm )
    • digitalRead( pin, def onResult )
    • analogRead( pin, def onResult )
  • Motion
    • DC Motor
      • motorRun( port, speed )
      • motorMove( leftspeed, rightspeed )
    • Servo Motor
      • servoRun( port, slot, angle )
    • Encoder Motor
      • encoderMotorRun( port, speed )
      • encoderMotorMove( port, speed, distance, def onFinish )
      • encoderMotorMoveTo( port, speed, position, def onFinish )
    • Stepper Motor
      • stepperMotorSetting( port, microsteps, acceleration )
      • stepperMotorRun( port, speed )
      • stepperMotorMove( port, speed, distance, def onFinish )
      • stepperMotorMoveTo( port, speed, position, def onFinish )
  • Sensors
    • Ultrasonic Sensor
      • ultrasonicSensorRead ( port, def onResult )
    • LineFollow Sensor
      • lineFollowerRead ( port, def onResult )
    • Light Sensor
      • lightSensorRead ( port, def onResult )
    • Sound Sensor
      • soundSensorRead ( port, def onResult )
    • Temperature Sensor
      • temperatureRead ( port, def onResult )
    • PIR Motion Sensor
      • pirMotionSensorRead ( port, def onResult )
    • Touch Sensor
      • touchSensorRead ( port, def onResult )
    • LimitSwitch
      • limitSwitchRead ( port, slot, def onResult )
    • Humiture Sensor
      • humitureSensorRead ( port, type, def onResult )
    • Gas Sensor
      • gasSensorRead ( port, def onResult )
    • Flame Sensor
      • flameSensorRead ( port, def onResult )
    • Button
      • buttonRead ( port, def onResult )
    • Potentiometer
      • potentiometerRead ( port, def onResult )
    • Joystick
      • joystickRead ( port, axis, def onResult )
    • 3-Axis Accelerometer and Gyro Sensor
      • gyroRead ( axis, def onResult )
    • Compass
      • compassRead ( def onResult )
  • Display
    • RGB Led
      • rgbLedSetColor ( port, slot, index, r, g, b )
      • rgbLedShow ( port, slot )
      • rgbLedDisplay ( port, slot, index, r, g, b )
    • 7-segment Display
      • sevenSegmentDisplay ( port, value )
    • Led Matrix Display
      • ledMatrixDisplayMessage ( port, x, y, msg )
      • ledMatrixDisplayRaw ( port, buffer )
    • Serial LCD Display
      • lcdDisplay ( string )
  • Others
    • DSLR Shutter
      • shutterOn ( port )
      • shutterOff ( port )
      • focusOn ( port )
      • focusOff ( port )

Schematic

shield pi

56 thoughts on “Me Shield for Raspberry Pi”

  1. Most of the images of this page are missing, would be helpful to correct the missing link to images.

        1. Hi Yu,

          Here we can see all the pictures, could you please try again?
          If there are still pictures missed, could you please kindly give a screenshot where it miss the picture and send it to daisy@makeblock.com, thanks!

  2. I’ve done my best to try to make this work. I’ve done it before with a RPi B on an older raspian version and it worked, but now with the latest raspian (jessie) and an RPi 3, I cannot get it to work. Both on the MeBaseBoard.

    First, the linked instructions for disabling the serial console is out of date and the instructions don’t actually apply to the way the serial console is handled in raspian.

    For me, even after disabling the serial console by other means, I get to the end of the instructions, try to run the demo_dcmotor.py script and it just hangs up while importing rpi_serial.

    I hope that the instructions can be updated, but I’d appreciate any help I can get.

    1. One of our software engineers will update the instruction this week, thanks for your kindly notification

          1. I gave it a try following step by step. But it is not working. Different error this time.

            Using a fresh clean formatted microSD card and loading it with stock Raspian Jessie I followed the directions exactly.

            The command: “sudo pip install megapi” yields the following:
            *******************************************************
            Downloading/unpacking megapi
            Downloading megapi-0.1.3.tar.gz
            Running setup.py (path:/tmp/pip-build-54m4fH/megapi/setup.py) egg_info for package megapi
            WARNING: ‘..’ not a valid package name;please use only.-separated package names in setup.py

            Installing collected packages: megapi
            Running setup.py install for megapi
            WARNING: ‘..’ not a valid package name;please use only.-separated package names in setup.py

            Successfully installed megapi
            cleaning up…
            ********************************************************

            on step 7, “cd PythonForMegaPi” reveals that there is no such folder. I tried looking for it anywhere else on my system, but to no avail. I guessed that maybe I could try cloning the repository from github. That got me the PythonForMegaPi folder, so I tested the motorRun.py scrip and got this error:
            ***************************
            init MegaPi

            [Errno 25] Inappropriate ioctl for device
            ***************************

    1. Hi Alejandro,

      Thanks for your feedback again.
      I opened the page and the images are ok, could you kindly try it again, once still the same, please kindly take a screenshot and send to tec-support@makeblock.com

      Please also let me know which country are you in, thanks!

  3. Please ignore my 2 previous comments. Some characters just did not get through.

    Here again.

    I can confirm the observations of Robby Cheriton. I used Orion and RPi 3 B and jessie. I also ran example ledMatrixMessage.py and got : megapi.mSerial instance at 0x7672ad50 [Errno 25] Inappropriate ioctl for device

    1. Hi Yeung Wai Keung,

      This issue is duo to that the configure resources of RPi3 is different with the previous.There is a big changes than before.
      You may need to change the Kernel related gpio configuration of the RPi3 to the same as before.Or you may need download the updated kernel on official website and change the configuration according to its requirement.

  4. Will this work with the mBot Ranger? Which port would I connect it to? What RasPi model are you using?

    1. Hi Daniel,

      This shield can only work with me baseboard and me Orion, it cannot be used on Auriga.

      1. Surely it can work with the Auriga as it has a hardware serial port. Why can’t it work and how can I get around it?

        1. Hi Daniel,

          We designed this module for me baseboard and me Orion.
          If you want to use it on Auriga, you may need figure out the connection by yourself according to the schematic of the Me Shield for Raspberry Pi and Auriga board.

      2. Can you please advise if there’s a similar Shield that can be used with the Auriga+Raspberry Pi?

  5. Hello,

    i’m using Orion and Raspberry Pi3 model B with Me Shield for raspberry PI. I followed your instruction and enabled SPI” and “I2C” and also installed python library and flashed on my orion the firmware.

    Well, when i try to execute “python motorRun.py” or the “motorRunForOrion.py” it returns to me the following error:
    init MegaPi

    [Errno 25] Inappropriate ioctl for device

    And the robot doesn’t move. (The interface is connected to the port number 5 on the Orion).

    How can i do?

    NOTE: when i install megapi libraries it seemed that there wheren’t files on /var/mail/ i downloaded them from your git-hub.

    1. Hi Matteo,

      Your issue should be same with the Yeung Wai Keung’s.
      It should duo to that the configure resources of RPi3 is different with the previous.There is a big changes than before.
      You may need to change the Kernel related gpio configuration of the RPi3 to the same as before.Or you may need download the updated kernel on official website and change the configuration according to its requirement.

      1. Okay, but in your product description you said that the product is COMPATIBLE, so i’m expecting that it is. If i had known that the product wasn’t compatible, or i if i had known that there ad been to do changes to raspberry pi kernel (that i’m not able to implement), so i would never had bought your product. I bought the product and now i want help.

        I want to know EXACTLY which configuration i have to change, what update and where i have to made modifications.

        But beware:
        this is a case of misleding advertise. Your tutorial is old ad completely unusefull for anyone that has a modern model of Pi. Your “robotics” it’s just a waste of time. Time spent to configure it to be compatible with the LATEST technologies. I’m very disappointed about you.

        1. Hi Matteo,

          Sorry for the trouble caused. The shield is compatible with the Raspberry Pi3 since it can work with Raspberry Pi3 after change the kernel.
          Normally, the Me Shield for Raspberry Pi is more suitable for geeks, changing the kernel is not diffult for these geeks. If marked this shield not compatible with the Raspberry Pi3 means that there is no way for the shield to work with RPi3.
          Anyway, sorry for this kind confusion, I will send you a instruction which contains a simple introduction about how to change the kernel to your email address, please kindly check it.

          1. Hi Admin,
            Could you send me the instructions please? I need to apply these changes as well,
            Thanks in advance

          2. I would like to have the instructions as well please.

            By the way, as I see that there are many people with the same issue, wouldn’t it be easier to have a new tutorial page rather than sending individual instructions via mail?

          3. Hi bracciolo22
            Actually, I have provided the download link in the answer to the other users on this page, anyone who need it can download it from the same link:http://download.makeblock.com/Instruction.zip

  6. Hi Admin,
    Could you send me the instructions please? I need to apply these changes as well,
    Thanks in advance

    1. Hi Lee,

      This project is belong to development lovers private projects.
      I am afraid that we don’t have enough ability to support on that. Please leave a message under the project pubished on the hackster have a try.

  7. pi@tim-pi:~/Desktop/makeblock/PythonForMegaPi/examples $ python motorRun.py
    init MegaPi

    Traceback (most recent call last):
    File “motorRun.py”, line 5, in
    bot.start()
    File “/usr/local/lib/python2.7/dist-packages/megapi.py”, line 83, in start
    self.device.start(port)
    File “/usr/local/lib/python2.7/dist-packages/megapi.py”, line 15, in start
    self.ser = serial.Serial(port,115200,timeout=10)
    File “/usr/lib/python2.7/dist-packages/serial/serialutil.py”, line 261, in __init__
    self.open()
    File “/usr/lib/python2.7/dist-packages/serial/serialposix.py”, line 278, in open
    raise SerialException(“could not open port %s: %s” % (self._port, msg))
    serial.serialutil.SerialException: could not open port /dev/ttyAMA0: [Errno 16] Device or resource busy: ‘/dev/ttyAMA0’

    ?????????????????????????????

    HÄÄÄ Thanks

  8. Hi Admin,
    Could you send me the instructions please? I need to apply these changes as well,
    Thanks in advance.

  9. Hi Admin,
    Could you send me the instructions please? I need to apply these changes as well,
    Thanks in advance.

  10. Dear Admin,

    Could you please send me the instructions?

    Thank you very much in advance!űű

  11. Hi Admin,

    I was managed to get a raspberry pi 2 and ran the basic encoderRun commands you have given at github. I am not able to stop the motors. I have run another script by giving 0 speed. The code jumps out of the loop and stops responding to any of the commands. The motors keep moving. Also I cannot run two motors at the same time?

    1. Hi Misbah,

      You may need to check the program, for personal application with Raspberry, I am afraid taht we don’t have enough ability to help.

  12. Hello Admin,I am using pi3 on Orion board.I am new to this,so please forgive me for stupid question.My robot is bluetooth version.The bluetooth module plugs in to port 5,as does the Me Shield.What would be the solution to this?Is the module on the robot even required,since rpi3 has bluetooth?Also,the pi3 has several more pins than previous versions.Can you tell which pins it needs to be on?Thanks

    1. Hi iamscomar,

      You can disconnect the Bluetooth module for Orion when you want to use it with Me Shield for Raspberry Pi.
      As for the pin connections, you may need compare the pins on Pi 3 and previous version, when solder the corresponding pins to the Me shield for raspberry.

Leave a Reply

Your email address will not be published. Required fields are marked *