You are on page 1of 26

 

HOME

PRODUCTS

ACCESSOIRES

SHOP

SUPPORT

CONTACT

X300 EXPANSION BOARD

HOME PRODUCTS ACCESSOIRES SHOP SUPPORT CONTACT X300 EXPANSION BOARD

KEY FEATURES Input Voltage - 6V to 18Vdc converted to 5V, 4A via step-down DC/DC converter

KEY FEATURES

KEY FEATURES Input Voltage - 6V to 18Vdc converted to 5V, 4A via step-down DC/DC converter
KEY FEATURES Input Voltage - 6V to 18Vdc converted to 5V, 4A via step-down DC/DC converter
KEY FEATURES Input Voltage - 6V to 18Vdc converted to 5V, 4A via step-down DC/DC converter
KEY FEATURES Input Voltage - 6V to 18Vdc converted to 5V, 4A via step-down DC/DC converter

Input Voltage

  • - 6V to 18Vdc converted to 5V, 4A via step-down DC/DC converter to power the Raspberry Pi

SATA

  • - Allows you to connect SATA devices to your Raspberry Pi

 
  • - 3.5mm MIC in jack

Audio

  • - 3.5mm stereo audio jack

  • - SPDIF output

 
  • - Audio IO connector (Microphone input and stereo audio amplifier 3.3Wx2)

 
  • - WiFi (IEEE 802.11b/g/n) with external antenna

Wireless

  • - IR sensor (38KHz)

  • - Bluetooth serial communication

USB Storage

  • - Self-powered USB hub with 3 ports

Real-time clock (RTC)

  • - Based on DS3231SN with included CR2032 battery

 
  • - Power output socket

  • - Camera flex slot so camera can still be used with the expansion board attached

  • - DIP switch to remove connection from RPi’s pin header

Misc

  • - Directly connected on top of the Raspberry Pi using the board GPIO header pins

  • - No wiring nor soldering is required

  • - Duplicated the 40-pin header of the R-Pi in order to support existing expansion boards

  • - Suitable for Raspberry Pi Model B+ and Raspberry Pi 2 Model B NEW!

Dimensions

  • - 85 x 56mm (Same size as Raspberry Pi)

PACKING LIST

  • x X300 expansion board

1

  • x USB adapter

1

  • x 2.4GHz WIFI antenna

1

  • x nylon spacers (M3 x 20mm)

4

  • x nylon screws (M3 x 6mm)

8

QUICK START GUIDE

  • A. Fitting the expansion board

  • B. Download and install the pre-built image - Optional

  • C. Power supply

  • D. Microphone input and audio output

  • E. Audio input and output interface

  • F. Setting RTC time

  • G. Setting up the IR remote

  • H. SATA port

I. Bluetooth serial communication

  • A. FITTING THE EXPANSION BOARD

QUICK START GUIDE A. Fitting the expansion board B. Download and install the pre-built image -
  • 1. Push a screws up through the mounting

hole on the underside of the Raspberry Pi and screw the spacer down until it is hand tight

QUICK START GUIDE A. Fitting the expansion board B. Download and install the pre-built image -

2. Plugs the expansion board straight into your Raspberry Pi B+'s GPIO header

and

screw down

QUICK START GUIDE A. Fitting the expansion board B. Download and install the pre-built image -

3. Insert the USB adapter

QUICK START GUIDE A. Fitting the expansion board B. Download and install the pre-built image -
  • 4. Install the WiFi antenna

    • B. DOWNLOAD AND INSTALL THE PRE-BUILT IMAGE - OPTIONAL

for instructions.

for instructions. Image Notes Based on RASPBIAN (Release date: 2015-01-30) Rpi-update is included Updated to the
Image Notes
Image Notes
  • Based on RASPBIAN (Release date: 2015-01-30)

  • Rpi-update is included

  • Updated to the latest Raspberry Pi firmware and kernel as of Feb 15th 2015

  • Alsamixer is included and configured

  • RTC time is configured

  • IR remote is configured

Download the Image
Download the Image

The 1.1GB image can be downloaded from Onedrive.com , pan.baidu.com

for instructions. Image Notes Based on RASPBIAN (Release date: 2015-01-30) Rpi-update is included Updated to the
  • Image Install

To install the image file, you will need to unzip it and write it to a suitable 4G or larger SD card using the UNIX tool dd. Windows users should use Win32DiskImager. Do not try to drag and drop or otherwise copy over the image without using dd or Win32DiskImager – it won’t work. If you’re still not clear on what to do, the community on the Raspberry Pi Wiki has written a guide for beginners on how to set up your SD card.

for instructions. Image Notes Based on RASPBIAN (Release date: 2015-01-30) Rpi-update is included Updated to the
  • Set RTC Time

<a> Get the right time set on the Pi ,

pi@raspberrypi ~ $ sudo date mmddhhmmyyyy.ss (mm= Month, dd= Date, hh= Hour, mm= Minute, yyyy= Year, ss= Second ) example: 2013 Jan 4 , 11:39:00 , sudo date 010411392013.00

<b> Write the system time to the RTC ,

pi@raspberrypi ~ $

sudo hwclock -w

<c> Verify the time ,

pi@raspberrypi ~ $

sudo hwclock -r

IF THE PRE-BUILT IMAGED IS USED, ALAMIXER, RTC AND IR REMOTE ARE NOT REQUIRED TO CONFIGURE AGAIN.

C. POWER SUPPLY

Xseries expansion board supplies the RPi with a regulated +5V through the GPIO header using a 2A poly-resettable (PTC) fuse. With the wide voltage input range (6~18vdc), the RPi can be powered from a wide variety of external sources such as batteries, 12V power adapters, solar battery sources, etc.

Recommended Power Adapter : 110~240VAC input, 12VDC 2A output Dimension of input plug (Unit: mm)

Warning: do not connect a +5V supply through the Raspberry Pi micro-USB connector when used with

Warning: do not connect a +5V supply through the Raspberry Pi micro-USB connector when used with this expansion board.

D. MICROPHONE INPUT AND AUDIO OUTPUT

<1> Update your Raspberry Pi to ensure all the latest packages are installed:

pi@raspberrypi ~ $ sudo apt-get update pi@raspberrypi ~ $ sudo apt-get upgrade pi@raspberrypi ~ $ sudo apt-get dist-upgrade

<2> After the update is complete, Reboot your Raspberry Pi,

pi@raspberrypi ~ $

sudo shutdown -r now

<3> This will install a package of ALSA utilities if you don't already have them (ALSA stands for Advances Linux Sound Architecture).

pi@raspberrypi ~ $

sudo apt-get install alsa-utils

<4> This will run the AlsaMixer application in a LXTerminal window:

pi@raspberrypi ~ $

alsamixer

This shows the on-board audio device's playback control (note that the chip is called "Broadcom Mixer").

This shows the on-board audio device's playback control (note that the chip is called "Broadcom Mixer").

<5> Press "F6" and you should see a small pop-up "window" with all the available sound cards listed. The item "0 bcm2835 ALSA" is the on- board audio device, and the item "1 C-Media USB Audio Device" is the USB audio device. Use the arrow keys to select the "1 C-Media USB Audio Device" item and press Enter:

This shows the on-board audio device's playback control (note that the chip is called "Broadcom Mixer").

<6> This shows the playback controls for the USB audio device. Use the right and left arrow keys to select the control you wish to adjust and

then use the up and down arrow keys to adjust the level. With "Speaker" selected, pressing "m" key on your keyboard will toggle the mute function on the audio output (when muted, "MM" appears instead of "OO" at the bottom of the control). Likewise, the "Mic" control (which actually refers to the level of microphone input fed back through to the audio output) can be muted, and is shown so in the above screenshot (note the "MM" at the bottom of the control). The "Auto Gain Control" item can not be adjusted with the arrow keys, but can be turned on and off by pressing the "m" key.

<6> This shows the playback controls for the USB audio device. Use the right and left

<7> Press "F4" the display will change to show the audio capture control for the USB audio device:

This control is used to adjust the level of audio input from the audio device to

This control is used to adjust the level of audio input from the audio device to the Raspberry Pi, and may be muted by pressing the space bar on your keyboard (but this will not mute the audio fed back through to the audio output).

<8> Press "F5" you will be able to see and adjust the playback and capture controls together in the same window:

This control is used to adjust the level of audio input from the audio device to

The above screenshot shows the "Speaker" playback control set to 80%, the "Mic" playback control is muted (and also reduced to zero), the "Mic" capture control set to 50% and the "Auto Gain Control" is turned on.

The following final section of this post is optional ....

<9> There is a "proper" graphical user interface available for the AlsaMixer application. To download and install it type the following at the command line prompt and press Enter:

pi@raspberrypi ~ $

sudo apt-get install alsamixergui

Once installed, you will find the "Alsamixergui" application under the "Sound & Vision" submenu of the "Start Menu" in the LXDE GUI.

The following final section of this post is optional .... <9> There is a "proper" graphical

This application works in a similar way to the AlsaMixer application (although note that in the above screenshot the "Mic" controls have been swapped over). In practice I actually found the basic AlsaMixer application (when run in a LXTerminal window) easier to use than the AlsaMixerGUI version, not least of all because the GUI version does not allow you to choose which audio device you want to control - you can only control the "default" ALSA audio device.

<10> To make the USB audio device the default ALSA audio device, you need to create a file called ".asoundrc" in the "/home/pi" folder containing the following text:

pcm.!default { type hw card 1 } ctl.!default { type hw card 1 }
pcm.!default {
type hw
card 1
}
ctl.!default {
type hw
card 1
}
pcm.!default { type hw card 1 } ctl.!default { type hw card 1 } <11> Save

<11> Save your changes by pressing Ctrl-x then Y. You should be able to control the USB audio device using the AlsaMixerGUI application. The above procedure assumes that the on-board audio device is designated "card 0" and that the Xseries expansion board audio device is designated "card 1", but this should be the case as long as you do not have any other audio devices connected to your Raspberry Pi.

<12> Let's record the sound now.

pi@raspberrypi ~ $

arecord -D plughw:1 --duration=10 -f cd -vv rectest.wav

The -vv option displays extra information on the screen as well as a volume meter, this should be peaking at around 95% on the loudest sounds, if it is at 100% all a lot of the time then you are probably recording distortion.

<13> Playback the recording with aplay:

pi@raspberrypi ~ $

aplay rectest.wav

E. AUDIO INPUT AND OUTPUT INTERFACE

pi@raspberrypi ~ $ arecord -D plughw:1 --duration=10 -f cd -vv rectest.wav The -vv option displays extra

F. SETTING RTC TIME

This page details how to setup the RTC Pi on the Raspbian “wheezy” image from http://www.raspberrypi.org/downloads

<14> Ensure that the CR2032 coin battery was inserted into the battery holder. Using the expansion board without a battery installed may damage the RTC chip and will stop it from appearing on the I2C bus.

<15> Follow the instructions on how to install and configure I2C on Raspbian Linux.

<16> Once you have installed I2C check that the RTC Pi has been detected using:

pi@raspberrypi ~ $

sudo i2cdetect -y 1

The RTC Pi should appear on channel 68 as shown in the screen shot below. If the RTC Pi does not appear check that the battery is installed correctly and is fully charged:

F. SETTING RTC TIME This page details how to setup the RTC Pi on the Raspbian

<17> Enable I2C by running:

Find the I2C line where the I2c is black listed

blacklist i2c-bcm2708

Comment it out by replacing it with the line below

#blacklist i2c-bcm2708

<18> Set the bash shell to root by typing (sudo bash) :

pi@raspberrypi ~ $

sudo bash

<19> And then run:

root@raspberrypi ~ $

echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device

<20> Type (exit) to drop out of the root bash shell.

root@raspberrypi ~ $

exit

<21> You can check the current time on the expansion board with:

pi@raspberrypi ~ $

sudo hwclock -r

<22> Get the right time set on the Pi ,

pi@raspberrypi ~ $ sudo date MMDDHHMMYYYY.SS (MM= Month, DD= Date, HH= Hour, MM= Minute, YYYY= Year, SS= Second ) example: 2013 Jan 4 , 11:39:00 , sudo date 010411392013.00

<23> Write the system time to the expansion board,

pi@raspberrypi ~ $

sudo hwclock -w

<24> Verify the time ,

pi@raspberrypi ~ $

sudo hwclock -r

Now you have the expansion board running with the current date and time the next step is to make it load when the Raspberry Pi boots.

<25> Add the RTC kernel module to the /etc/modules list, so its loaded when the machine boots.

pi@raspberrypi ~ $

sudo nano /etc/modules

And add:

i2c-bcm2708
i2c-bcm2708

rtc-ds1307
rtc-ds1307
rtc-ds1307 <26> Save your changes by pressing Ctrl-x then Y

<26> Save your changes by pressing Ctrl-x then Y

<27> Create the DS1307 device creation at boot, edit /etc/rc.local by running

pi@raspberrypi ~ $

sudo nano /etc/rc.local

And add:

echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device sudo hwclock -s

<27> Create the DS1307 device creation at boot, edit /etc/rc.local by running pi@raspberrypi ~ $ sudo

<28> Save your changes by pressing Ctrl-x then Y

<29> Reboot your Raspberry Pi

pi@raspberrypi ~ $

sudo reboot

If everything worked correctly the expansion board should be initialised on boot and the current date and time will be loaded into Linux.

G. SETTING UP THE IR REMOTE

<30> Installing LIRC

pi@raspberrypi ~ $

sudo apt-get install lirc

<31> Add the two lines below to /etc/modules . This will start the modules up on boot. Pin 8 bellow will be used to take the output from the IR sensor.

pi@raspberrypi ~ $

sudo nano /etc/modules

lirc_dev lirc_rpi gpio_in_pin=8

<32> Save your changes by pressing Ctrl-x then Y <33> If you are using 3.18.x RaspberryPi

<32> Save your changes by pressing Ctrl-x then Y

<33> If you are using 3.18.x RaspberryPi firmware you must modify one additional file for the

lirc-rpi
lirc-rpi

kernel extension to be loaded:

Edit your

/boot/config.txt

file

pi@raspberrypi ~ $

sudo nano /boot/config.txt

and add:

dtoverlay=lirc-rpi,gpio_in_pin=8

<34> Edit /etc/lirc/hardware.conf and have it appear exactly as shown below. pi@raspberrypi ~ $ sudo nano

<34> Edit /etc/lirc/hardware.conf and have it appear exactly as shown below.

pi@raspberrypi ~ $

sudo nano /etc/lirc/hardware.conf

# /etc/lirc/hardware.conf

#

# Arguments which will be used when launching lircd

LIRCD_ARGS="

# /etc/lirc/hardware.conf # # Arguments which will be used when launching lircd LIRCD_ARGS=" --uinput" # Don't

--uinput"

# Don't start lircmd even if there seems to be a good config file

# START_LIRCMD=false

# Don't start irexec, even if a good config file seems to exist. # START_IREXEC=false # Try to load appropriate kernel modules LOAD_MODULES=true # Run "lircd --driver=help" for a list of supported drivers.

DRIVER="

  • default"

# usually /dev/lirc0 is the correct setting for systems using udev "

DEVICE="/dev/lirc0

lirc_rpi
lirc_rpi

MODULES="

"

# Default configuration files for your hardware if any

LIRCD_CONF=""

LIRCMD_CONF=""

# /etc/lirc/hardware.conf # # Arguments which will be used when launching lircd LIRCD_ARGS=" --uinput" # Don't

The highlighted text are the parts that will need changing, though it’s worth checking the rest of the text incase you have a different initial configuration.

<35> Save your changes by pressing Ctrl-x then Y

<36> Download the lircd.conf (For the remote supplied by SupTronics) file and save to /home/pi

<37> Extract the .tar.gz file

pi@raspberrypi ~ $ tar xzvf lircd.conf.tar.gz

<38> Replace the existing conf file (which is most likely empty) with the you just downloaded.

pi@raspberrypi ~ $

sudo cp lircd.conf /etc/lirc/lircd.conf

<39> Reboot

pi@raspberrypi ~ $

sudo reboot

<40> Test your remote,

pi@raspberrypi ~ $

irw

Your commands will appear in the console when you press buttons on your remote. Press Ctrl-c to exit this.

H. SATA PORT

The SATA port allows you to connect SATA devices to your Raspberry Pi, a very useful tool for data transfer, backup and cloning. It supports most SATA devices such as CD ROM, DVD ROM, CD drive, 2.5 inch hard disk and 3.5 inch hard disk.

Installation for SATA drives:

1. Connect you SATA drive to the SATA port with a SATA cable. 2. Connect SATA Power Cable to a power adapter which is used to power hard disk OR to the power connector on X300 (Output voltage of power adapter used must be 12Vdc).

I. BLUETOOTH SERIAL COMMUNICATION

Technical documents BC04-B Technical specification Required additional hardware
Technical documents
BC04-B Technical specification
Required additional hardware

BC04-B_AT Command

A computer or device with a Bluetooth terminal software

To establish a communication with the Raspberry Pi over Bluetooth you need another device that can speak Bluetooth. If your computer has a Bluetooth adapter then you just need to find a terminal software that you can use to send and receive data, like HyperTerminal on Windows, or
screen on OS X and Linux. A computer is not the only choice, though. For example, I will use my Android cell phone with the free BlueTerm (download from Google play) app installed.

Wiring
Wiring
Wiring
 

RPi GPIO pin

BT module pin

 

N/A

+3.3V

 

GND (Pin #6)

GND

 

TXD (Pin #8)

RXD

 

RXD (Pin #10)

TXD

Raspberry Pi configuration
Raspberry Pi configuration
Raspberry Pi configuration

I'm going to assume you are running a recent release of Raspbian on your Raspberry Pi. If you are running another OS then you will need to find out how the changes below are done in your system.

By default the Raspberry Pi is configured to write boot time messages to the serial port, and also to start a login console on it. Unfortunately, the default baud rate that the RPi uses for its serial port is 115200 bps, while the Bluetooth module comes preconfigured to 9600 bps. There are two config files that need to be updated.

File /boot/cmdline.txt contains the kernel options that are used to boot the system. In my Raspbian based system this file contains the following options:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

Change to

dwc_otg.lpm_enable=0 console=ttyAMA0,9600 kgdboc=ttyAMA0,9600 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

The second configuration file is /etc/inittab . Inside this file you have to locate the following line:

pi@raspberrypi ~ $

sudo nano /etc/inittab

T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

Change to

T0:23:respawn:/sbin/getty -L ttyAMA0 9600 vt100

With those changes made the RPi is configured to talk to the Bluetooth module. If you now power up your Raspberry Pi you will notice that the LED in the Bluetooth module blinks rapidly. This is the sign that the Bluetooth module is ready and waiting to be paired with another device.

Connecting from a Bluetooth terminal
Connecting from a Bluetooth terminal

Now leave the RPi running with the Bluetooth module in its blinking state and go to the Bluetooth enabled computer or smartphone that you will connect to it. Your device should now find the Bluetooth module with the name BC04-B when you set it to discover devices.

If you are using an Android device with BlueTerm then start the app and from the app menu select "Connect device". Android does the baud selection automatically so you don't have to configure it. From a terminal software running in a computer it is likely that you will need to configure the speed, number of data bits per character, parity, and number of stop bits per character. The values you need to use are:

  • Speed: 9600 bps

  • Data bits: 8 bits

  • Parity: None

  • Stop bits: 1 bit

The Bluetooth module comes preconfigured with a PIN number. To complete the connection your computer or smartphone will ask you to enter this PIN. The factory default PIN is 1234 .

dwc_otg.lpm_enable=0 console=ttyAMA0, 115200 kgdboc=ttyAMA0, 115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait Change to dwc_otg.lpm_enable=0 console=ttyAMA0, 9600 kgdboc=ttyAMA0,

The LED in the Bluetooth module will now stop blinking and remain lit, indicating that it has made a connection.

And here comes the fun part. You need to reboot the Raspberry Pi so that the new serial port settings take effect. To reboot the RPi run the following command in a local or network shell:

$ sudo reboot

Now watch the Bluetooth terminal on your PC or smartphone while the Pi reboots. Boot messages should be appearing on your terminal, and as soon as the RPi is up you should get a login prompt there as well.

You can now login from your Bluetooth terminal and use the command line prompt as you normally would over a local or network shell.

Configuring the Bluetooth module
Configuring the Bluetooth module

Firstly you will need to install minicom into your RPi using the following command:

$ sudo apt-get install minicom

The Bluetooth module comes preconfigured from the factory with a set of defaults, which are:

  • Baud rate: 9600

  • Bluetooth ID: BC04-B

  • PIN: 1234

But these values can be changed by sending special commands through the communication channel. Now that the Raspberry Pi is connected to the module we can try this.

These special commands that configure the Bluetooth module can be sent from a connected remote device, or they can be sent from the local system, in this case the Raspberry Pi. Since the Raspberry Pi is the star of the article I'm going to also use it to do the configuration.

Here is a quick summary of the most useful configuration commands:

Command

Description

AT

Test the communication with the Bluetooth module.

AT+VERSION

Report the module's version number

AT+NAMEname

Change the Bluetooth ID to name (maximum 20 characters).

AT+PINnnnn

Change the PIN to nnnn, which must be a four digit number.

 

Change the baud rate. Use one of the following values for n:

2: 2400bps

3: 4800bps

AT+BAUDn

4: 9600bps

5: 19200bps

 

6: 38400bps

7: 57600bps

8: 115200bps

One tricky aspect of sending these commands is that the Bluetooth module has a very short timeout, so all the characters in a command must be entered really quickly. The safest way to get the entire command in time is to type it in a text editor window and then use copy/paste to send it really fast.

To send the commands we can use minicom . So let's fire it up one more time:

$ minicom -b 9600 -o -D /dev/ttyAMA0

Note that it isn't necessary to have a connection to do this, so you can do this while the Bluetooth module is in its blinking state.

$ minicom -b 9600 -o - D /dev/ttyAMA0 Note that it isn't necessary to have a

You now need to use any method to get the string AT into the clipboard, and then hit paste inside the minicom window to send the command to the module.

$ minicom -b 9600 -o - D /dev/ttyAMA0 Note that it isn't necessary to have a

When you send AT the module should respond with this in the minicom window:

OK

If you get this response then you know that everything is all right. If you don't get a response then for some reason the Raspberry Pi is unable to communicate with the Bluetooth module.

When I send AT+VERSION to the module I get the following response:

OKlinvorV1.5

To change the baud rate to the fastest rate of 115200 we need to issue the command AT+BAUD8 , and the module will respond with:

OK115200

Because the baud rate was changed now the communication will break, and we will need to exit and restart minicom with the updated speed:

$ minicom -b 115200 -o -D /dev/ttyAMA0

To change the name of the module to MyBT we must issue the command AT+NAMEMyBT , and the module will respond with:

OKsetname

And to change the PIN to 4321 the command is AT+PIN4321 and the response from the Bluetooth module will be:

OKsetPIN

Note that when the name and/or the PIN change the module requires a power cycle for the changes to take effect.

Also don't forget that if you change the baud rate and later want to reestablish the serial console you will need to change the two config files to reflect the new baud rate you have selected in the Bluetooth module.

 

TECHNICAL SUPPORT

SALES AND AGENT

SUPTRONICS LIMITED

sales@suptronics.com

sales@suptronics.com

All Rights Reserved.