X205 SKU: EZ-0046

From 52Pi Wiki
Jump to navigation Jump to search

X205 EXPANSION BOARD FOR RASPBERRY PI

X205 860p2.jpg



X205 165p3.jpg
X205 165p4.jpg
X205 165p5.jpg



KEY FEATURES

Parameters Values
Input Voltage 6V to 20Vdc converted to 5V, 3A via step-down DC/DC converter to power the Raspberry Pi
RS232 serial communications Control the Raspberry Pi over RS232 or connect to external serial accessories
RS485 serial communications You will be able to have a communication port for your field bus directly connected to your RPi!
- It will allow up to 32 devices to communicate through the same data line over a cable length of up to 4,000ft with a maximum data rate of 10Mbit/s.
Audio 3.5mm MIC in jack
- 3.5mm stereo audio jack
- Audio IO connector (Microphone input and stereo audio amplifier 3.3Wx2)
Wireless WiFi (IEEE 802.11b/g/n) with external antenna
- IR sensor (38KHz)
USB Storage Self-powered USB hub with 3 ports
Real-time clock (RTC) Based on DS3231SN with included CR2032 battery
GPIO Control 8-channel Darlington driver chip (ULN2803) allowing to control electronic circuits which require more current
Misc 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
- 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+, Raspberry pi 2 Model B and Raspberry Pi 3 Model B NEW!
Dimensions 85 x 56mm (Same size as Raspberry Pi)

X205test1.jpg



PACKING LIST

  • 1 x X205 expansion board
  • 1 x USB adapter
  • 1 x 2.4GHz WIFI antenna
  • 4 x nylon spacers (M3 x 20mm)
  • 8 x nylon screws (M3 x 6mm)

QUICK START GUIDE

  • A. Fitting the expansion board
  • B. Operation system
  • C. Power supply
  • D. RS232 communications
  • E. Testing of RS485 communications
  • F. Microphone input and audio output
  • G. Audio input and output interface
  • H. Setting RTC time
  • I. Setting up the IR remote
  • J. ULN2803 8-channel RC servo port

    • A. FITTING THE EXPANSION BOARD

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

Assembly 275p1.jpg



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

Assembly 275p2.jpg



3. Insert the USB adapter

Assembly 275p4.jpg



4. Install the WiFi antenna

Assembly 275p5.jpg



B. OPERATION SYSTEM

Rpi.jpg


Download


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~21Vdc), 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)
Ds0101.jpg


D. RS232 COMMUNICATIONS

Introduction

The RS232 port is connected to the UART port on the Raspberry Pi using a MAX3232 interface. The MAX3232 IC converts the 3.3V UART port to RS232 voltages allowing communication with RS232 compatible devices over a DB9 serial cable or with the use of a null-modem cable the board allows terminal access with linux on the Raspberry Pi using a terminal application. The RS232 port can be accessed through the terminal block on x205. Schematic diagram


E. TESTING OF RS485 COMMUNICATIONS

  • What is RS485

Please click on the link below for further details of RS485.
http://www.radio-electronics.com/info/telecommunications_networks/rs485/rs-485-tutorial-basics.php

  • Install Dedendecy Libraries (Raspbian)

1. Update source list
$ sudo apt-get update
2 . Install python-pip
$ sudo apt-get install python-pip
3.Use pip to install WiringPi (WiringPi is designed for raspberry pi to behave similarly to that of the wiring library under Arduino.
After this library is installed,c or shell or python can use the function to configure and control GPIOs directly.
$ sudo pip install wiringpi
4. Installed the associated library files of serial ports :
$ sudo apt-get install python-serial
5.Test whether the GPIO library and the serial library is installed or not:
$ python
$ import RPi.GPIO
$ import serial
If there is no error , then the two libraries are installed correctly.

X205test2.jpg



6. We need to configure file ‘/boot/cmdline.txt’ to remove the kernel booting information and debug message:
$ sudo nano / boot / cmdline.txt
You can see the following information:
dwc_otg.lpm_enable = 0 console = ttyAMA0, 115200 kgdboc = ttyAMA0, 115200 console = tty1 root = / dev/mmcblk0p2 rootfstype = ext4 elevator = deadline rootwait
Remove “console = ttyAMA0, 115200 kgdboc = ttyAMA0, 115200″ so that the information becomes:
dwc_otg.lpm_enable = 0 console = tty1 root = / dev/mmcblk0p2 rootfstype = ext4 elevator = deadline rootwait
7. Disable log in from the serial port:
$ sudo nano / etc / inittab
and comment out ” T0: 23: respawn :/ sbin / getty-L ​​ttyAMA0 115200 vt100″
8 Restart Raspberry Pi:
$ sudo reboot
Now you can use / dev/ttyAMA0 like the regular COM port.


  • Python Test Code

Test code(serial_test.py , unzip and save to /home/pi ) :

300



  • Test Tools
    • 1 x Raspberry Pi
    • 1 x X205 expansion board for Raspberry Pi
    • 1 x Cable (two conductors)
    • 1 x USB-RS485 converter
RS485 converter.jpg



  • Wire Diagram and Test

Wiring:
X205 RS485 ‘A’-> USB-RS485 converter ‘ A ‘
X205 RS485 ‘B’-> USB-RS485 converter ‘ B ‘

After the wiring is done, launch a serial terminal. We use X-CTU in our case, and set the baud rate to 9600:

X205test4.jpg


After running serial_test.py, enter the characters in the X-CTU:

X205test5.jpg


X205test6.jpg



F. MICROPHONE INPUT AND AUDIO OUTPUT

To configure X205 sound card as the default audio device.
<1> Right-click the volume icon, a pop-up menu appears to allow you to select "USB PnP Sound Device".

X200test1.jpg


<2> Click "Device Settings..." to allow more detailed control of the X300 audio devices – you can access this either under Device Settings from the volume right-click menu or from the Preferences section of the main menu, where it is listed as Audio Device Settings.

X200test2.jpg


X200test3.jpg


<3> From this dialog, select the device you want to control from the drop-down at the top, and then press the Select Controls button to choose which of the controls the device offers that you want to display. Pressing the Make Default button on this window has the same effect as choosing an output source in the volume right-click menu.

X200test4.jpg


<4> Let's record the sound with LXterminal
pi@raspberrypi ~ $ arecord -D plughw:1,0 -f cd test.wav
<5> Press Ctrl + C to abort recording
<6> Playback the recording with aplay
pi@raspberrypi ~ $ aplay test.wav


G. AUDIO INPUT AND OUTPUT INTERFACE

X200test5.jpg



H. SETTING RTC TIME

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

  • <7> 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.
  • <8> Follow the instructions on how to install and configure I2C on Raspbian Linux.
  • <9> 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:

X200test6.jpg


    • <10> Enable I2C by running:

pi@raspberrypi ~ $ sudo nano /etc/modprobe.d/raspi-blacklist.conf
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

    • <11> To ensure that the necessary kernel modules are loaded at boot, ensure your /boot/config.txt file has the entry below …

pi@raspberrypi ~ $ sudo nano /boot/config.txt dtoverlay=i2c-rtc,ds3231

X200test7.jpg


  • <12> Save your changes by pressing Ctrl-x then Y
  • <13> Edit /lib/udev/hwclock-set with

pi@raspberrypi ~ $ sudo nano /lib/udev/hwclock-set

  • <14> Locate the lines and edit
X200test8.jpg


  • <15> Comment following three lines in config.txt by adding '#' located at start of the line. (check Images below)
X200test9.jpg


  • <16> Save your changes by pressing Ctrl-x then Y
  • <17> Reboot your Raspberry Pi

pi@raspberrypi ~ $ sudo reboot

  • <18> 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 
  • <19> Write the system time to the expansion board,

pi@raspberrypi ~ $ sudo hwclock -w

  • <20> Verify the time ,

pi@raspberrypi ~ $ sudo hwclock -r
If everything worked correctly the expansion board should be initialised on boot and the current date and time will be loaded into Linux.


I. TESTING THE IR RECEIVER

  • <21> Installing LIRC

pi@raspberrypi ~ $ sudo apt-get install lirc

  • <22> 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
X200test10.jpg


  • <23> Save your changes by pressing Ctrl-x then Y
  • <24> Edit your /boot/config.txt file

pi@raspberrypi ~ $ sudo nano /boot/config.txt
and add:

dtoverlay=lirc-rpi,gpio_in_pin=8
X200test11.jpg


  • <25> 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="--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"
MODULES="lirc_rpi" 
# Default configuration files for your hardware if any 
LIRCD_CONF="" 
LIRCMD_CONF="" 
X200test12.jpg


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.

  • <26> Save your changes by pressing Ctrl-x then Y
  • <27> Reboot the Raspberry Pi

pi@raspberrypi ~ $ sudo reboot

  • <28> Run these two commands to stop lircd and start outputting raw data from the IR receiver

pi@raspberrypi ~ $ sudo /etc/init.d/lirc stop
pi@raspberrypi ~ $ mode2 -d /dev/lirc0

  • <29> Point a remote control at your IR receiver and press some buttons. You should see something like this:
X200test13.jpg



J. ULN2803 8-CHANNEL RC SERVO PORT

Bring in some muscle to your output pins with 8 mighty Darlingtons!
This driver chip contains 8 drivers that can sink 500mA from a selectable 5V or DC input voltage supply and has kickback diodes included inside for driving coils.
This will let your little microcontroller or microcomputer power solenoids, DC motors (in one direction) and unipolar stepper motors.
The GPIO Pins are connected to ULN2803 inputs through a DIP switch, with the its outputs going to two array of Wire-to-Board header.
Alternatively, these ports can be used to supply +5V or input voltage to other external circuitry, or embedded devices.

Please note that this is an 'open collector' driver - it can only be used to connect the load to ground and there will be a 1 Volt (or more) 'drop' across the internal transistors.
You can Download here:
File:ULN2803 SCH x200.pdf
File:Raspberry Pi GPIO Pin numbering.pdf
File:ULN2803APG datasheet en 20121126.pdf


GPIO control en.jpg
Uln2803.png



  • Optional driver to install - WiringPi

<1> Install GIT
pi@raspberrypi ~ $ sudo apt-get install git-core
<2> Download WiringPi
pi@raspberrypi ~ $ git clone git://git.drogon.net/wiringPi
<3> Enter the directory of wiringPi
pi@raspberrypi ~ $ cd wiringPi
<4> Install wiringPi
pi@raspberrypi ~ $ ./build
<5> Test GPIO port
pi@raspberrypi ~ $ gpio mode x out (x = 0~7)
pi@raspberrypi ~ $ gpio write x 1 (x=0~7, 1=On)
pi@raspberrypi ~ $ gpio write x 0 (x=0~7, 0=off)