Raspberry Pi Project Board User Manual v1.0
Raspberry Pi Project Board User Manual v1.0
ALS-XT-IoT-PRJBRD-RBPi-01
Raspberry Pi IoT
Project Board
User Manual
www.alsindia.net Sheet 1 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
1. INTRODUCTION 3
2. RASPBERRY PI 3 IOT PROJECT BOARD SPECIFICATIONS 4
3. HARDWARE DETAILS 6
3.1. Raspberry Pi 3 Model B+ 6
3.2. Connection Details 7
4. INSTALLATION PROCEDURE 11
4.1. Install the Raspbian OS on SD CARD 11
5. ON BOARD INTERFACES 13
5.1. OLED 13
5.2. MCP3008 14
5.3. Switches & LEDs 15
5.4. Stepper Motor 16
5.5. Buzzer 16
5.6. Relays 17
5.7. UART 17
5.8. ZigBee Module 18
5.8.1 Configuring ZigBee Modules 19
5.9 LM35 24
5.10 Light Sensor 25
6. DEMO PROGRAMS 26
7. EXTERNAL SENSORS SUPPORT 28
8. XTRANS IoT CLOUD 29
8.1. Introduction to Xtrans IoT Cloud 29
8.2. Connecting the device to Xtrans IoT Cloud 31
9. THINGSPEAK CLOUD 32
9.1. Introduction to ThingSpeak Cloud 32
9.2. API Reference 33
10. TROUBLESHOOTING 35
11. REFERENCES 35
www.alsindia.net Sheet 2 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
1. INTRODUCTION
The Raspberry Pi IoT Project Board designed to be a comprehensive tool to accelerate
learning IoT Fundamentals and apply the concepts to get a Hands-On experience by
performing different experiments. It can also be used by students and faculty alike to
implement projects based on IoT concepts. Flexibility is at the heart of the Kit, and
accordingly the students and faculty can not only use the hardware on the board in
imaginative ways, but also innovatively write programs to try their own use cases. This user
manual provides the descriptions of the features and also examples of use cases, to guide
the students to use it effectively.
This Raspberry Pi Project Board can have a Raspberry Pi 3 Model B+ Controller with wireless
device ZigBee to enable wireless mesh communication. It helps the students to perform IoT
related experiments based on their requirement. It provides all the open ports to connect
various multiple sensors which helps the students to develop number of applications on IoT.
It also supports different hardware communications protocols like i2C, SPI and UART. The kit
has two on board sensors like temperature sensor and light sensor to perform IoT end to
end operation from sensors to cloud. As the kit has internal Wi-Fi module the students can
send the different sensors information to the cloud. One can write the code using different
Python IDEs like Thonny, IDLE and Geany.
www.alsindia.net Sheet 3 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
Hardware Description:
1. RS232 UART Module
2. OLED
3. Raspberry Pi 3 Model B+
4. MCP3008
5. 5V & 3.3V Power Supply Section
6. Stepper Motor Interface
7. Relay Modules – 2
8. Buzzer
9. ZigBee Module
10. Switches – 2
11. LEDs – 2
12. Light Sensor
13. LM35 Temperature Sensor.
www.alsindia.net Sheet 4 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
Specifications:
• Board is driven using Raspberry Pi 3 Controller.
• Facilitates MQTT or HTTP application protocol connection to various IoT cloud
platforms such as Thingspeak, AWS.
• It can be connected to a Private Cloud like Xtrans Cloud.
• On board voltage regulator for generating 3.3V from +5V input through power
supply /adapter.
• Internal Wi-Fi connectivity through which board can be connected to internet
through Router.
• Onboard ZigBee device to enable wireless communication.
• On board simple analog sensors like Temperature and Light.
• Onboard ADC MCP3008 to connect analog sensors to raspberry pi 3.
• On board Organic LED Display to display colorful text as well as images.
2 LED's and 2 Switches.
• On board stepper motor driver to drive 5V stepper motor.
• One Buzzer.
• Internal Bluetooth 4.2 to communicate with other Bluetooth modules or mobile
Apps.
• Provided extra connectors for connecting external analog and digital sensors so that
students can explore their projects.
• I2C, SPI communication protocols.
• On board UART connector.
• UART Software serial communication.
• On board Relay to drive external device.
• Several onboard outputs can be accomplished through events from cloud such as
turning on LED’s or sending a test message to the display is possible.
• Outputs can be programmed to be event or threshold driven.
• Performance of IoT experiments and design / implementation of student projects
possible including provision to write their own programs.
• Wireless Mesh Communication is possible.
www.alsindia.net Sheet 5 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi
RBPi-01
3. HARDWARE DETAILS
3.1. Raspberry Pi 3 B+
Specifications:
3.2.3 J1A Connector: 2 Pin Male Burg connector to Raspberry Pi 3 from LM35.
Pin Description
1 A0
2 VCC
www.alsindia.net Sheet 7 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
www.alsindia.net Sheet 8 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
www.alsindia.net Sheet 9 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
4 IN4
5 VCC
3.2.17 J9A Connector : 5 Pin Male Burg Pins to Raspberry Pi 3 from Stepper
Motor
Pin Description
1 P16
2 P18
3 P22
4 P32
5 VCC
3.2.18 J12 & J13 Connectors : 2 Pin Male Burg Pins for I2C
Pin Description
1 SDA
2 SCL
3.2.19 J10 & J11 Connectors : 4 Pin Male Burg Pins for SPI Connection
Pin Description
1 D10
2 D11
3 D12
4 D13
3.2.20 J14 & J15 Connector : 15 Pin Male Burg Pins for External GPIO Pins
Pin Description
1 P11
2 P13
3 P15
4 P29
5 SDA
6 SCL
7 P16
8 P18
9 P22
10 P26
11 P27
12 P28
www.alsindia.net Sheet 10 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
13 P32
14 P40
15 P12
3.2.21 J16 & J17 Connector : 12 Pin Male Burg Pins for External GPIOs
Pin Description
1 P29
2 P31
3 P7
4 P33
5 P35
6 P37
7 P36
8 P38
9 P24
10 P19
11 P21
12 P23
3.2.22 J19 Connector : 10 Pin Male Burg Pins for VCC (5V)
3.2.23 J18 Connector : 10 Pin Male Burg Pins for GND
3.2.24 J20 Connector : 10 Pin Male Burg Pins for 3.3V
4 INSTALLATION PROCEDURE
www.alsindia.net Sheet 11 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi
RBPi-01
5. ON BOARD INTERFACES
5.1 OLED Display
The term OLED stands for “Organic Light emitting diode” it uses the same technology that is
used in most of our televisions but has fewer pixels compared to them. It is real fun to have
these cool looking display modules to be interfaced with the Raspberry Pi .In this Kit, we are
using a Monochrome 4-pin SSD1306 0.96” OLED display. This LCD can only work with the
I2C mode. To work with OLED with raspberry pi 3 you have to execute following commands
sudo apt-get install python-imaging python-smbus git
git clone https://github.com/adafruit/Adafruit_Python_SSD1306.git
cd Adafruit_Python_SSD1306
sudo python setup.py install
After open any one the example program from folder and execute it. It will display either
text or Images on OLED.
www.alsindia.net Sheet 13 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
5.2 MCP3008
The MCP3008 is a low cost 8-channel 10-bit analog to digital converter. The precision
of this ADC is similar to that of an Arduino Uno, and with 8 channels you can read quite
a few analog signals from the Pi. This chip is a great option if you just need to read
simple analog signals, like from a temperature or light sensor. The MCP3008 connects
to the Raspberry Pi using a SPI serial connection. You can use either the hardware SPI
bus, or any four GPIO pins and software SPI to talk to the MCP3008. Software SPI is a
little more flexible since it can work with any pins on the Pi, whereas hardware SPI is
slightly faster but less flexible because it only works with specific pins.
Hardware SPI
To use hardware SPI first make sure you've enabled SPI using the raspi-config tool. Be
sure to answer yes to both enabling the SPI interface and loading the SPI kernel
module, then reboot the Pi. Check you can see a /dev/spidev0.0 and /dev/spidev0.1
device when you run the ls -l /dev/spi* command before continuing.
Internal wiring the MCP3008 to the Raspberry Pi as follows:
Run the following commands to install Adafruit MCP3008 library to communicate MCP3008
with Raspberry Pi.
sudo pip install Adafruit_MCP3008
www.alsindia.net Sheet 14 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
www.alsindia.net Sheet 15 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
5.5 Buzzer
Buzzer is an output module which can be used to show the result of any program as a
sound. Providing VCC to BUZZ
pin will blow the Buzzer.
5.6 Relays
A relay works to isolate or change the state of an electric circuit from one state to another.
Relays use an electromagnet to mechanically operate a switch, but other operating
principles are also used, such as solid-state relays. Relay are used to to control a circuit by a
separate low-power signal.
www.alsindia.net Sheet 16 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
www.alsindia.net Sheet 17 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
The XBee module can act as a Coordinator, Router or an End device but it need to be
configured to work in desired mode. So before using the XBee modules with Raspberry
Pi 3, we have to configure these modules using XCTU software.
To connect XBee module with the laptop, a USB to serial cable is used.
NOTE :- CONNECT SERIAL CABLE FROM 9 PIN DB1 FEMALE CONNECTOR IN RASPBERRY PI
BOARD TO PC OR LAPTOP AND SHORT JUMPERS JP1 PIN-2,3 , JP2 PIN-2,3 AND JP3,JP4
SHOULD BE OPENED.
www.alsindia.net Sheet 18 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
Download the XCTU software from this link and install it. After downloading and installing
the XCTU software, open it and make sure your XBee module is properly connected. Check
the COM port of the Arduino board in device manager.
Step 1:- Now, click on the search button. This will show you all the RF devices connected
with your laptop. In our case, it will show only one XBee module.
Step 2:- Select the Serial port of the Explorer board/Arduino board and click on Next.
Step 3:- In the next window, set the USB port parameters as shown below and click on Finish.
www.alsindia.net Sheet 19 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
Step 4:- Select the Discovered device and click on Add selected device. This process will add
your XBee module to XCTU dashboard.
www.alsindia.net Sheet 20 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
Step 5:- Now, you can configure your XBee module in this window. Use either AT commands
or put the data manually. As you can see, there is R showing on the left panel which means
Xbee is in router mode. We have to make it Coordinator for the transmitter part.
Step 6:- Choose the Product family of your device which is available on back of XBee
module. Select function set and firmware version as highlighted below and click on Update.
Step 7:- Now, you have to give ID, MY and DL data to make connection with other XBee. ID
remain same for both the modules. Only MY and DL data interchange i.e. MY for the
www.alsindia.net Sheet 21 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
receiver XBee becomes DL of the transmitter XBee (coordinator) and DL for the receiver
XBee becomes MY of the transmitter XBee. Make CE as Coordinator and then hit
the Write button. As shown below.
Step 8:- After writing the above data to the transmitter part, plug out it from the explorer
board and plug it in the second XBee module. Repeat the same process as above only
changes are the DL, MY, and CE. As we will make the second XBee as End device so in CE
drop down menu, select the End device and hit the Write button.
Connections:
www.alsindia.net Sheet 22 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
Sensors are the devices that are used to detect and respond to electrical or optical signals.
Sensors converts the physical parameter into a signal which can be measured electrically.
Let’s explain the example of temperature. The mercury in the glass thermometer expands
and contracts the liquid to convert the measured temperature which can be read by a
viewer on the calibrated glass tube.
5.9 LM35
The LM35 series are precision integrated-circuit temperature devices with an output voltage
linearly proportional to the Centigrade temperature. LM35 is three terminal linear
temperature sensor from National semiconductors. It can measure temperature from -55
degree Celsius to +150 degree Celsius. The voltage output of the LM35 increases 10mV per
degree Celsius rise in temperature. LM35 can be operated from a 5V supply and the stand
by current is less than 60uA. The pin out of LM35 is shown in the figure below.
Features
Calibrated Directly in Celsius (Centigrade)
www.alsindia.net Sheet 23 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
Operates from 4 V to 30 V
The light sensor converts this “light energy” whether visible or in the infrared parts of the
spectrum into an electrical signal output. From “Infrared” to “Visible” up to “Ultraviolet”
light spectrum. Sensitivity can be adjusted through potentiometer.
Specifications:
www.alsindia.net Sheet 24 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
6. DEMO PROGRAMS
6.1 To Test LM35 – Temperature Sensor
Connection: Connect J1 to J1A using flying leads
Connected pin details: OUT – MCP3008 Channel0 –A0
Execute the following commands
sudo pip install Adafruit_MCP3008
sudo python lm35.py
Result: It will Display Temperature in Degrees.
www.alsindia.net Sheet 25 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
www.alsindia.net Sheet 26 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
1. IR distance sensor
2. Thermal detection sensor
1. SW-420 Motion Sensor/ Vibration switch
2. Humidity and Rain Detection Sensor
3. Speed Sensor
4. IR Flame Detection Sensor
5. SEN-0052 Magnetic Reed Sensor
6. Touch sensor
7. R305 Optical Fingerprint Sensor
8. Sound detector
9. Magnetic switch
10. Non-invasive AC current sensor
11. 3-Axis Accelerometer Sensor
12. Optical Dust Sensor
13. RFID Reader
14. Voltage / current meter
15. Hydrogen Gas Sensor
16. pH Sensor
17. Muscle Sensor
18. Pulse Sensor
19. Single Lead Heart Rate Monitor
20. Gyroscope
21. Sunlight Sensor
22. Water Temperature-DS18B20
23. Body Temperature
www.alsindia.net Sheet 27 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi
RBPi-01
Device:
Sensor:
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi
RBPi-01
Welcome to Xtrans IoT Cloud REST API documentation. API allows for programmatic access
to your accounts resources, including devices, variables, values and others.
There are two ways to connect your device to Xtrans IoT Cloud. They are
1. Using HTTP
2. Using MQTT
Domain: "alpha.iot.xtranssolutions.com"
End-point:
point: "/device/(device-label)?id=(device-id)”
"/device/(device
Port: "3000"
Body: "[{"sensor": (sensor
(sensor-label), "value": (sensor value)}]"
Where:
device-name:
name: label of the device.
Device-id: ID of the device.
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
Domain: "alpha.iot.xtranssolutions.com"
Topic: "/device/(device-id)"
Port: "1883"
Body: "[{"sensor": (sensor-label), "value": (sensor value)}]"
Where:
Device-label: label of the device.
Device-id: ID of the device.
9. THINGSPEAK CLOUD
9.1 Introduction
ThingSpeak is a cloud platform providing various services exclusively targeted for building
IoT applications. It offers the capabilities of real-time data collection, visualizing the
collected data in the form of charts, ability to create plugins and apps for collaborating with
web services, social network and other APIs. We will consider each of these features in
detail below.
The core element of ThingSpeak is a ‘ThingSpeak Channel’. A channel stores the data that
we send to ThingSpeak and comprises of the below elements:
• 8 fields for storing data of any type – These can be used to store the data from a
sensor or from an embedded device.
• 3 location fields – Can be used to store the latitude, longitude and the elevation.
These are very useful for tracking a moving device.
• 1 status field – A short message to describe the data stored in the channel.
To use ThingSpeak, we need to sign up and create a channel. Once we have a channel, we
can send the data, allow ThingSpeak to process it and also retrieve the same. Let us start
exploring ThingSpeak by signing up and setting up a channel.
Usinghttps://thingspeak.com/the link user can connect to the ThingSpeak Cloud.
www.alsindia.net Sheet 30 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi
RBPi-01
Channels
Fields Data
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
MATLAB analysis and visualization apps enable you to explore and view your channel data.
ThingSpeak enables you to interact with social media, web services, and devices.
REST API: Use REST API calls to Create and update ThingSpeak Channels and Charts.
MQTT API: Use the MQTT API to update ThingSpeak channels.
www.alsindia.net Sheet 32 of 33
ADVANCED ELECTRONIC SYSTEMS. ALS-XT-IoT-PRJBRD-RBPi-01
with SSL. A client device connects to the MQTT broker and can publish to a channel or
subscribe to updates from that channel.
Publish:
Subscribe:
Subscribe to Channel Feed Subscribe to updates from a channel feed
with MQTT
User can refer the below link for the complete information of ThingSpeak cloud document.
https://in.mathworks.com/help/thingspeak/
10 TROUBLESHOOTING:
Here are some guidelines to troubleshoot some typical problems. Problems in field,
however, can vary, depending on field conditions.
11 REFERENCES
1. https://www.raspberrypi.org
2. https://thingspeak.com/
3. https://xtranssolutions.com/
4. https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
www.alsindia.net Sheet 33 of 33