Raspberry Pi

RASPBERRY PI 2 MODEL B

The Raspberry Pi 2 Model B is the most recent of the Raspberry Pi models and is the one we will use as the brain of the EmuBot

Raspberry-Pi-2

Tech Specs:

  • 4 USB ports
  • 40 GPIO pins
  • Full HDMI port
  • Ethernet port
  • Combined 3.5mm audio jack and composite video
  • Camera interface (CSI)
  • Display interface (DSI)
  • Micro SD card slot
  • VideoCore IV 3D graphics core

 

 

The Raspberry Pi website has a lot of information and the forums have heaps of help if you get stuck with anything related to the pi.

Installation of the Raspberry Pi

The Raspberry Pi has jumper on the side so you don’t need to solder anything. The pins are numbered and the diagram below is colour coded to ensure you use the right pins.  There are four main pins which we need to use (2 or 5, 6, 8 & 10).  You can also use Pin 9 if you wish to run a ground between the OpenCM board and your Raspberry Pi.  This is good practise but not essential.

The Rx/Tx wires should be reversed on the OpenCM so that Rx links to Tx and vice versa.  It is a common mistake to have Receiving (Rx) and Receiving (Rx) linked which won’t allow for any communication.

 


RaspPi_PINs

Operating System

For the OARK we use the current Raspbian Wheezy operating system which is installed onto a microSD card and can be downloaded from the Raspberry Pi website.For imaging your Raspberry Pi it would be recommended to use a utility such as Apple Pi Baker.

Once you have successfully created an image on your SD Card you can put it into the Raspberry Pi and power it up. If you haven’t wired it onto your robot you can use the Micro USB input and power it of your computer. It only requires 5V.

The default login for a raspberry pi is:


Username: pi
Password: raspberry

To access the graphical user interface type:
sudo startx

Other useful commands in the Raspbian operating system are:

Reboot sudo reboot
Shutdown sudo shutdown -h now
System Info ifconfig
Check USB lsusb
Turn Off Ethernet ifdown eth0
Turn On Ethernet ifup eth0

 

Serial Communication

As mentioned on the Dynamixel page the Raspberry Pi communicates through the OpenCM board via the Rx and Tx pins. Rx/Tx stands for Transmitter and Receiver which is a serial communication.

EmuBot_Hardware_Circuit

Due to the limitations in serial communication we can’t just send straight integers or strings so we need to manipulate the data for it to be sent. We are also going to setup our own little data packets to ensure the OpenCM board handles the instructions correctly.

You must install pySerial Library to ensure that you can open a serial port to communicate via the OpenCM to the dynamixels. To install these modules you still need to use terminal and the following commands

sudo apt-get install python-dev
sudo apt-get install python-pip
sudo pip install pyserial

Other Development Libraries

There are a couple of other development libraries which may come in handy when you start coding. You will be told during a particular tutorial if you need to install anything specifically. However, in the meantime it is worth running an update to ensure all of the your dependencies are up to date.
sudo apt-get update