Difference between revisions of "RPi2 B Package D"
Line 1: | Line 1: | ||
+ | [[File:RPi2-B-Package-D_l.jpg|thumb|right|400px |alt=RPi2-B-Package-D|link=http://www.waveshare.com/rpi2-b-package-d.htm | RPi2 B Package D]] | ||
== Raspberry Pi 2 Model B Development Kit (Type D) == | == Raspberry Pi 2 Model B Development Kit (Type D) == | ||
{{RPi2 B Package D Package Content}} | {{RPi2 B Package D Package Content}} |
Revision as of 04:14, 9 November 2015
Raspberry Pi 2 Model B Development Kit (Type D)
Package D Content
Weight: 0.315 kg
- Raspberry Pi 2 Model B x 1
- ARPI600 x 1
- Sensors Pack × 1
- USB Type A Plug to Micro B Plug Cable x 1
- USB type A plug to mini-B plug cable x 1
- RPi screws pack (2pcs) x 1
|
Feature
- Onboard USB to serial port (support Raspberry Pi serial port debugging), RTC and ADC etc.
- Support Arduino interface (with AD function), which is convenient for Raspberry Pi to connect to various Arduino expansion boards (Shield).
- Support Raspberry Pi for wireless data transmission through XBee communication module, and support XBee USB adapter function.
- Support sensor interface, convenient for Raspberry Pi to connect to various sensors.
Onboard Resources
How to use Raspberry Pi
Open I2C Interface
- Open the Raspberry Pi terminal and enter the following command to enter the configuration interface
sudo raspi-config Choose Interfacing Options -> I2C ->yes Start the i2C kernel driver
sudo reboot
User Guides for Raspberry Pi
Enable SPI Interface
PS: If you are using the system of the Bullseye branch, you need to change "apt-get" to "apt", the system of the Bullseye branch only supports Python3.
Open the Raspberry Pi terminal and enter the following command to enter the configuration interface
sudo raspi-config Select Interfacing Options -> SPI -> Yes to enable the SPI interface
sudo reboot
Please make sure the SPI is not occupied by other devices, you can check in the middle of /boot/config.txt
Enable Uart Interface
Open the Raspberry Pi terminal and enter the following command to enter the configuration interface
sudo raspi-config Select Interfacing Options -> Serial, close the shell access, open the hardware serial port
Install Library Function
Install Library
If you use the bookworm system, you can only use lgpio library, bcm2835 and wiringPi can't be installed and used.
BCM2835
#Open the Raspberry Pi terminal and run the following command wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.71.tar.gz tar zxvf bcm2835-1.71.tar.gz cd bcm2835-1.71/ sudo ./configure && sudo make && sudo make check && sudo make install # For more, you can refer to the official website at: http://www.airspayce.com/mikem/bcm2835/
WiringPi
#Open the Raspberry Pi terminal and run the following command cd sudo apt-get install wiringpi #For Raspberry Pi systems after May 2019 (earlier than that can be executed without), an upgrade may be required: wget https://project-downloads.drogon.net/wiringpi-latest.deb sudo dpkg -i wiringpi-latest.deb gpio -v # Run gpio -v and version 2.52 will appear, if it doesn't it means there was an installation error # Bullseye branch system using the following command: git clone https://github.com/WiringPi/WiringPi cd WiringPi . /build gpio -v # Run gpio -v and version 2.70 will appear, if it doesn't it means there was an installation error
lgpio
#Open the Raspberry Pi terminal and run the following command wget https://github.com/joan2937/lg/archive/master.zip unzip master.zip cd lg-master sudo make install # You can refer to the official website for more: https://github.com/gpiozero/lg
- python
sudo apt-get update sudo apt-get install ttf-wqy-zenhei sudo apt-get install python-pip sudo pip install RPi.GPIO sudo pip install spidev sudo apt-get install python-smbus sudo apt-get install python-serial sudo pip install rpi_ws281x
Download Demo
sudo apt-get install p7zip wget https://www.waveshare.com/wiki/File:ARPI600_.7z 7zr x ARPI600.7z -r -o./ARPI600 sudo chmod 777 -R ARPI600 cd ARPI600/RaspberryPi/program
Connecting Raspberry Pi UART to control peripherals
Configure the system serial port
1) Enter the terminal and execute:
sudo nano /boot/cmdline.txt
put the following line:
wc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
Change it to the following line:
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
Press Ctrl+X and select Y to save. 2) Execute:
sudo nano /etc/inittab
find the following line:
#Spawn a getty on Raspberry Pi serial line T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
change to
#Spawn a getty on Raspberry Pi serial line #T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
Press Ctrl+X, select Y to save
3) Execute:
sudo reboot
After executing this command and restarting the Raspberry Pi, you will not be able to enter the Raspberry Pi terminal from the serial port. At this time, if the user wants to enter the terminal, he must use SSH or connect the Raspberry Pi to an external monitor and enter the LX terminal. (If you want the serial port to be used as the debug output of the Raspberry Pi serial port again, you can restart after restoring the changes, so it is best to back up before making changes)
Serial data display
1. Set the jumpers on the ARPI600: connect CP_RX to P_TX, and CP_TX to CP_RX.
2. Start the PuTTY serial debugging software to configure following parameters:
- Serial line: it is used to select corresponding serial port.
- Speed: it is used to set the Baud rate: 9600 (Notices: the parameter Speed in here is set to 9600, differently from the configuration shown in the figure).
- Connection type: this option should be set to Serial.
3. Copy the file program/Xbee/send into the Raspbian, and enter the folder send, then, execute the following code:
sudo make sudo ./serialTest
The terminal will display the data as
Interface description
Interface overview
The default relationship between Arduino digital control pins and Raspberry Pi IOs is shown in the table. The relationship between Arduino digital control pins and Raspberry Pi IOs
APRI600 | IO of Raspberry Pi B+ |
---|---|
D0 | P_RX |
D1 | P_TX |
D2 | P0 |
D3 | P1 |
D4 | P2 |
D5 | P3 |
D6 | P4 |
D7 | P5 |
D8 | P6 |
D9 | P7 |
D10 | CE0 |
D11 | MOSI |
D12 | MISO |
D13 | SCK |
The jumper pins D11, D12 and D13 on the module are used for configuring the ARPI600. And these pins should be shorted by the 0Ω resistances.
In factory settings, the jumpers are set as follows:
- Connect SCK to D13
- Connect MISO to D12
- Connect MOSI to D11
The following settings are connecting pins D11, D12, and D13 to the general IO control pins of the Raspberry Pi board.
- Connect D13 to P26
- Connect D12 to IO_SD
- Connect D11 to IO_SC
Notices: Users can modify the settings of these jumpers as required. In this operation, welding is required. Any changes under no guidance from Waveshare will be considered as a waiver of warranty.
The pins A0-A5 of ARPI600 can also be configured as IO pins or ADC pins.
a) When the pins A0-A5 are connected to 1, they will sever as IO control pins. The relationship between the pins A0-A5 and the pins of the Raspberry Pi board is as the table shows.
- The relationship between the pins A0-A5 and the pins of the Raspberry Pi board
APRI600 | IO of Raspberry Pi B+ |
---|---|
A0 | CE1 |
A1 | P5 |
A2 | P6 |
A3 | P7 |
A4 | CW0 |
A5 | MOSI |
b) When the pins A0-A5 are connected to 3, they will sever as ADC pins.
You can also connect the pin A4 to P_SCL, and the pin A5 to P_SDA (as the figure shows), to make them serve as I2C control pins of the Raspberry Pi board. However, in default settings, the pins A4 and P_SCL are disconnected, and so are the pins A5 and P_SDA.
Notices: Users can modify the settings of these jumpers as required. In this operation, welding is required. Any changes under no guidance from Waveshare will be considered as a waiver of warranty.
ARPI600 provides sensor interfaces 4P. The figure shows the jumper settings for sensor interface 4P.
In which:
- The pins on A are connected to the ADC pins A6-A10 of TLC1543;
- The pins on D are connected to the IO control pins P0-P4 of the Raspberry Pi board.
Users can apply different sensors via the sensor interface.
How to use ARPI600 with external sensor kits (purchased separately)
The following operations require the ARPI600 to be plugged into the Raspberry Pi. If there is only ARPI600 and sensor kit, but no Raspberry Pi, it will not work.
Color Sensor
1) Insert the ARPI600 into the Raspberry Pi.
2) Connect the sensor and ARPI600 pins according to the following table:
Color Sensor Pins | ARPI600 Pins |
---|---|
LED | 3.3V |
OUT | P0 |
S3 | P4 |
S2 | P3 |
S1 | P2 |
S0 | P1 |
GND | GND |
VCC | 3.3V |
- Copy the folder Color_Sensor into the Raspberry Pi system, and then power up the device. Enter the terminal and run the following commands:
cd Color_Sensor sudo ./Color_Sensor
- The program performs the white balance adjustment to the sensor and it may take 2 seconds. When finished, you can see relative data of RGB are outputted on the terminal. A color check list is helpful for finding out what the measured color it is.
- Press the keys Ctrl+C to end the program.
Flame Sensor
- Install the ARPI600 to the RPi board;
- Connect the sensor to the corresponding pins on the ARPI600, according to the following table:
Flame Sensor Pins | ARPI600 Pins |
---|---|
DOUT | P0 |
AOUT | T_A6 |
GND | GND |
VCC | 3.3V |
- Copy the folder Flame_Sensor into the Raspberry Pi system, and then power up the device. Enter the terminal and run the following commands:
cd Flame_Sensor sudo ./General_Sensor
- The signal indicator will turn on, when the sensor is close to a fire. And it will turn off, when the sensor is away from the fire.
- The terminal output changes along with the distance from the sensor to the fire.
- Press the keys Ctrl+C to end the program.
Notice: The flame sensor is designed to detect fire only, but it is not fireproof itself. When using it, please keep a safe distance from the fire to avoid burning out.
Metal Sensor
Plug the ARPI600 into the Raspberry Pi. 2) Connect the sensor and ARPI600 pins according to the following table:
Metal Sensor Pins | ARPI600 Pins |
---|---|
DOUT | P0 |
AOUT | T_A6 |
GND | GND |
VCC | 3.3V |
3) Copy the Metal_Sensor folder to the Raspberry Pi system. After power on, the terminal executes:
cd Metal_Sensor sudo ./General_Sensor
4) When the sensor touches live metal, the signal indicator on the module lights up. When the sensor is away from the metal, the signal indicator on the module goes out.
5) As the sensor contacts and separates from the metal, the data output by the terminal will change accordingly.
6) Press Ctrl+C to end the program.
Hall Sensor
- Install the ARPI600 to the RPi board;
- Connect the sensor to the corresponding pins on the ARPI600, according to the following table:
Hall Sensor Pins | ARPI600 Pins |
---|---|
DOUT | P0 |
AOUT | T_A6 |
GND | GND |
VCC | 3.3V |
- Copy the folder Hall Sensor into the Raspberry Pi system, and then power up the device. Enter the terminal and run the following commands:
cd Hall_Sensor sudo ./General_Sensor
- The signal indicator will turn on, when the sensor is close to a magnet. And it will turn off, when the sensor is away from the magnet.
- The terminal output changes along with the distance from the sensor to the magnet.
- Press the keys Ctrl+C to end the program.
Infrared Reflective Sensor
- Install the ARPI600 to the RPi board;
- Connect the sensor to the corresponding pins on the ARPI600, according to the following table:
Infrared Reflective Sensor Pins | ARPI600 Pins |
---|---|
DOUT | P0 |
AOUT | T_A6 |
GND | GND |
VCC | 3.3V |
- Copy the folder Infrared_Reflective_Sensor into the Raspberry Pi system, and then power up the device. Enter the terminal and run the following commands:
cd Infrared_Reflective_Sensor sudo ./General_Sensor
- The signal indicator will turn on, when the sensor is close to a barrier. And it will turn off, when the sensor is away from the barrier.
- The terminal output changes along with the distance from the sensor to the barrier.
- Press the keys Ctrl+C to end the program.
Laser Sensor
- Install the ARPI600 to the RPi board;
- Connect the sensor to the corresponding pins on the ARPI600, according to the following table:
Laser Sensor Pins | ARPI600 Pins |
---|---|
DOUT | P0 |
GND | GND |
VCC | 3.3V |
- Copy the folder Laser_Sensor into the Raspberry Pi system, and then power up the device. Enter the terminal and run the following commands:
cd Laser_Sensor sudo ./General_Sensor
- The signal indicator will turn on, when a barrier is placed above the sensor. And the signal indicator will turn off, when the barrier is away from the sensor. By reading the status of the indicator, you can get to know whether the sensor has detected the barrier.
- Press the keys Ctrl+C to end the program.
Moisture Sensor
- Install the ARPI600 to the RPi board;
- Connect the sensor to the corresponding pins on the ARPI600, according to the following table:
Moisture Sensor Pins | ARPI600 Pins |
---|---|
DOUT | P0 |
AOUT | T_A6 |
GND | GND |
VCC | 3.3V |
- Copy the folder Moisture_Sensor into the Raspberry Pi system, and then power up the device. Enter the terminal and run the following commands:
cd Moisture_Sensor sudo ./General_Sensor
- Insert the sensor into the soil and water the soil little by little. And then you may find the terminal output changes.
- Press the keys Ctrl+C to end the program.
Rotation Sensor
- Install the ARPI600 to the RPi board;
- Connect the sensor to the corresponding pins on the ARPI600, according to the following table:
Rotation Sensor Pins | ARPI600 Pins |
---|---|
SIA | P0 |
SIB | P1 |
SW | P2 |
GND | GND |
VCC | 3.3V |
- Copy the folder Rotation_Sensor into the Raspberry Pi system, and then power up the device. Enter the terminal and run the following commands:
cd Rotation_Sensor sudo ./Rotation_Sensor
- There are three actions of the rotary encoder: clockwise rotation, anticlockwise rotation, and reset button press. The terminal output of the module varies with different actions.
- Turn right!
- Turn left!
- Turn down!
- Connect the SIA, SIB, and SW of the module to CH0, CH1, and CH2 of a logic analyzer (purchased separately), respectively.
- For clockwise rotation, the waveform outputs are shown as below:
- For anticlockwise rotation, the waveform outputs are shown as below:
- When the reset button is pressed, the waveform outputs are shown below:
- Press the keys Ctrl+C to end the program.
Sound Sensor
- Install the ARPI600 to the RPi board;
- Connect the sensor to the corresponding pins on the ARPI600, according to the following table:
Sound Sensor Pins | ARPI600 Pins |
---|---|
DOUT | P0 |
AOUT | T_A6 |
GND | GND |
VCC | 3.3V |
- Copy the folder Sound_Sensor into the Raspberry Pi system, and then power up the device. Enter the terminal and run the following commands:
cd Sound_Sensor sudo ./General_Sensor
- The signal indicator will turn on, when the microphone of the module is close to a sound source. And it will turn off, when the microphone is away from the magnet.
- The terminal output changes along with the distance from the sensor to the sound source.
- Press the keys Ctrl+C to end the program.
Temperature-Humidity Sensor
- Install the ARPI600 to the RPi board;
- Connect the sensor to the corresponding pins on the ARPI600, according to the following table:
Temperature-Humidity Sensor Pins | ARPI600 Pins |
---|---|
DOUT | P0 |
GND | GND |
VCC | 3.3V |
- Copy the folder Temperature-Humidity_Sensor into the Raspberry Pi system, and then power up the device. Enter the terminal and run the following commands:
cd Temperature-Humidity_Sensor sudo ./DHT11
- The data of temperature and humidity detected are shown on the terminal. For example:
- Humidity=33
- Temperature=28
- Press the keys Ctrl+C to end the program.
MQ-5 Gas Sensor
- Install the ARPI600 to the RPi board;
- Connect the sensor to the corresponding pins on the ARPI600, according to the following table:
MQ-5 Gas Sensor Pins | ARPI600 Pins |
---|---|
DOUT | P0 |
AOUT | T_A6 |
GND | GND |
VCC | 3.3V |
- Copy the folder MQ-5_Gas_Sensor into the Raspberry Pi system, and then power up the device. Enter the terminal and run the following commands:
cd MQ-5_Gas_Sensor sudo ./General_Sensor
- Warn-up the sensor for a minute.
- Put the sensor into a container filled with sensitive gas, you will find the indicator turns on. While taking the sensor out of the container, you can see the indicator turns off. By reading the indicator, you can get to know whether the concentration of the sensitive gas exceeds standard.
- Press the keys Ctrl+C to end the program.
Tilt Sensor
- Install the ARPI600 to the RPi board;
- Connect the sensor to the corresponding pins on the ARPI600, according to the following table:
Tilt Sensor Pins | ARPI600 Pins |
---|---|
DOUT | T_A6 |
GND | GND |
VCC | 3.3V |
- Copy the folder Tilt_Sensor into the Raspberry Pi system, and then power up the device. Enter the terminal and run the following commands:
cd Tilt_Sensor sudo ./General_Sensor
- The signal indicator will turn on, when the sensor is being vibrated or in a tilted state. And it will turn off, when the sensor is laid flat. By reading the indicator, you can get to know whether the module is in a condition of vibrating or tilting.
- Press the keys Ctrl+C to end the program.
UV Sensor
- Install the ARPI600 to the RPi board;
- Connect the sensor to the corresponding pins on the ARPI600, according to the following table::
UV Sensor Pins | ARPI600 Pins |
---|---|
AOUT | T_A6 |
GND | GND |
VCC | 3.3V |
- Copy the folder UV_Sensor into the Raspberry Pi system, and then power up the device. Enter the terminal and run the following commands:
cd UV_Sensor sudo ./General_Sensor
- Place the sensor close to the sunlight. The terminal output changes along with the distance from the sensor to the sunlight source.
- Press the keys Ctrl+C to end the program.
Liquid Level Sensor
- Install the ARPI600 to the RPi board;
- Connect the sensor to the corresponding pins on the ARPI600, according to the following table:
Liquid Level Sensor Pins | ARPI600 Pins |
---|---|
AOUT | T_A6 |
GND | GND |
VCC | 3.3V |
- Copy the folder Liquid_Level_Sensor into the Raspberry Pi system, and then power up the device. Enter the terminal and run the following commands:
cd Liquid_Level_Sensor sudo ./General_Sensor
- Immerse the sensor into the water deeply. The terminal output changes along with the water depth.
- Press the keys Ctrl+C to end the program.
Kits Related
Jetson Nano
Jetson nano provides some demos for use, and others are not currently supported.
Install Library Function
- Open the terminal interface and enter the following command to install the corresponding library function:
sudo apt-get update sudo apt-get install python3-pip sudo pip3 install Jetson.GPIO sudo groupadd -f -r gpio sudo usermod -a -G gpio your_user_name sudo cp /opt/nvidia/jetson-gpio/etc/99-gpio.rules /etc/udev/rules.d/ sudo udevadm control --reload-rules && sudo udevadm trigger
[Note] your_user_name is the username you use, such as waveshare.
- Install I2C
sudo apt-get install python-smbu
- Install Image Processing Libraries
sudo apt-get install python3-pil sudo apt-get install python3-numpy
Download Demo
sudo apt-get install p7zip wget http://www.waveshare.net/w/upload/3/37/ARPI600.7z 7zr x ARPI600.7z -r -o./ARPI600 sudo chmod 777 -R ARPI600 cd ARPI600/JetsonNano/ARPI600_Code
Demo
PCF8563
cd PCF8563
- C
cd C make clear make sudo ./main
- python2
cd python2 sudo python main.py
- python3
cd python3 sudo python3 main.py
TLC1543
cd TLC1543
- C
cd C make clear make sudo ./main
- python2
cd python2 sudo python main.py
- python3
cd python3 sudo python3 main.py
UART
cd UART
- C
cd C make clear make sudo ./main
- python2
cd python2 sudo python main.py
- python3
cd python3 sudo python3 main.py
Resources
Document
Application Notes
Datasheets
Software
FAQ
Support
Support
If you require technical support, please go to the Support page and open a ticket.