Raspberry Pi4 Project Board User Manual VTU
Raspberry Pi4 Project Board User Manual VTU
ALS-XT-IoT-PRJBRD-RBPi-01
RASPBERRY Pi IoT
PROJECT BOARD
USER MANUAL
1 of 27
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
TABLE OF CONTENTS
1. INTRODUCTION........................................................................3
2. RASPBERRY Pi 4 PROJECT BOARD SPECIFICATIONS....................4
3. HARDWARE DETAILS.................................................................6
3.1. Raspberry Pi 4 Model B.......................................................6
3.2. Connection Details..............................................................7
4. INSTALLATION PROCEDURE...................................................11
5. ON BOARD INTERFACE...........................................................13
5.1 OLED Display.....................................................................13
5.2 MCP3008...........................................................................13
5.3 Switches and LED's............................................................14
5.4 Stepper Motor...................................................................15
5.5 Buzzer...............................................................................15
5.6 Relays...............................................................................16
5.7 LM35.................................................................................16
5.8 Light Sensor.......................................................................17
5.9 Temperature and Humidity Sensor....................................18
6. LIST OF EXPERIMENTS...........................................................19
7. EXTERNAL SENSORS SUPPORT..............................................22
8. THINGSPEAK CLOUD.............................................................23
9. TROUBLESHOOTING..............................................................27
10. REFERENCES.........................................................................27
2 of 27
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
1. INTRODUCTION
The Raspberry Pi IoT Project Board designed to be a comprehensive tool to accelerate
learning of IoT Fundamentals and apply the concepts to get 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 has a Raspberry Pi 4 Model B Controller. It helps the
students perform IoT related experiments based on the requirement. It provides all the
open ports to connect various multiple sensors which helps the students to develop number
of applications based on IoT. It also supports different hardware communications protocols
like i2C and SPI. The kit has two on board sensors like temperature sensor; light sensor and
an externally connected DHT11 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.
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
3 of 27
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
Hardware Description:
1. Raspberry Pi 4 Model B.
2. 5V & 3.3V Power Supply Section.
3. MCP3008.
4. OLED.
5. Stepper Motor Interface.
6. Relay Modules – 2 nos.
7. Buzzer.
8. Switches – 2 nos.
9. LEDs – 2 nos.
10. Light Sensor.
11. LM35 Temperature Sensor.
12. DHT11 Humidity and Temperature Sensor (External).
13. DC Motor (External).
4 of 27
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
Specifications:
The Board is driven using Raspberry Pi 4 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.
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.
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 Relay to drive external device (DC Motor).
DHT11 Sensor (External Interface).
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.
5 of 27
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
3. HARDWARE DETAILS
3.1. Raspberry Pi 4 Model B.
Specifications:
Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.8GHz
1GB, 2GB, 4GB or 8GB LPDDR4-3200 SDRAM (depending on model)
2.4 GHz and 5.0 GHz IEEE 802.11ac wireless, Bluetooth 5.0, BLE
Gigabit Ethernet
2 USB 3.0 ports; 2 USB 2.0 ports.
Raspberry Pi standard 40 pin GPIO header (fully backwards compatible with
previous boards)
2 × micro-HDMI® ports (up to 4kp60 supported)
2-lane MIPI DSI display port
2-lane MIPI CSI camera port
4-pole stereo audio and composite video port
H.265 (4kp60 decode), H264 (1080p60 decode, 1080p30 encode)
OpenGL ES 3.1, Vulkan 1.0
Micro-SD card slot for loading operating system and data storage
5V DC via USB-C connector (minimum 3A*)
5V DC via GPIO header (minimum 3A*)
Power over Ethernet (PoE) enabled (requires separate PoE HAT)
Operating temperature: 0 – 50 degrees C ambient
6 of 27
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
Pin Description
1 A1
2 VCC
3.2.6 J3 Connector: 4 Pin Male Burg Pins from OLED.
Pin Description
1 GND
2 VCC
3 SCL
4 SDA
3.2.7 J3A Connector: 4 Pin Male Burg Pins to Raspberry Pi 4 from OLED.
Pin Description
1 VCC (GND)
2 GND(VCC)
3 SCL
4 SDA
3.2.8 J4 Connector: 5 Pin Male Burg Pins from LED & Switches.
Pin Description
1 L1
2 L2
3 S1
4 S2
5 VCC
3.2.9 J4A Connector: 5 Pin Male Burg Pins to Raspberry Pi 4 from LED & Switches.
Pin Description
1 P31
2 P33
3 P35
4 P37
5 VCC
3.2.10 J8 Connector: 4 Pin Male Burg Pins from Relays & Buzzer.
Pin Description
1 RLY1
2 RLY2
3 BUZ
4 VCC
3.2.11 J8A Connector: 4 Pin Male Burg Pins to Raspberry Pi 4 from Relays & Buzzer.
8 of 27
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
Pin Description
1 P36
2 P12
3 P38
4 VCC
3.2.12 J9 Connector: 5 Pin Male Burg Pins from Stepper Motor.
Pin Description
1 IN1
2 IN2
3 IN3
4 IN4
5 VCC
3.2.13 J9A Connector: 5 Pin Male Burg Pins to Raspberry Pi 4 from Stepper Motor.
Pin Description
1 P16
2 P18
3 P22
4 P32
5 VCC
3.2.14 J12 & J13 Connectors: 2 Pin Male Burg Pins for I2C
Pin Description
1 SDA
2 SCL
3.2.15 J10 & J11 Connectors: 4 Pin Male Burg Pins for SPI Connection.
Pin Description
1 D10 (P23)
2 D11(P21)
3 D12(P19)
4 D13(P24)
3.2.16 J14 & J15 Connector: 15 Pin Male Burg Pins for External GPIO Pins.
Pin Description
1 P11
2 P13
3 P15
4 P29
9 of 27
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
5 SDA
6 SCL
7 P16
8 P18
9 P22
10 P26
11 P27
12 P28
13 P32
14 P40
15 P12
3.2.17 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
10 of 27
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
4. INSTALLATION PROCEDURE
Installing Raspbian OS for Raspberry Pi 4 Model B using Raspbian Stretch OS Image
Downloaded in. zip format.
1. Download the image file in the form Zip file from the following link
https://www.raspberrypi.org/downloads/raspbian/
1. Once Raspberry Pi 4 B is booted up to GUI, Connect the keyboard and Mouse to USB
slots.
2. Change the following
a. language: English
b. Country and Time Zone: India and Kolkata
3. From menu-->Preferences-->Raspberry Pi 4 B Configuration.
Then Go To Interfaces
Enable Camera, SSH, VNC, SPI, I2C, Serial Port. Don't Enable Remaining Things.
4. Connect to WiFi.
5. Check the date and Time.
6. Open the Terminal.
Execute following default commands.
a. sudo apt-get update
b. sudo apt-get upgrade
c. sudo apt-get install build-essential python-dev python-smbus python-pip
11 of 27
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
12 of 27
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
5. ON BOARD INTERFACE
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-imazing python-smbus
sudo apt-get install 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.
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.
13 of 27
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
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.
Run the following commands to install Adafruit MCP3008 library to communicate MCP3008
with Raspberry Pi.
sudo pip install adafruit-mcp3008
14 of 27
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
Fig. 5.3A:
Schematic Pin Diagram of Switches and LED's.
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.
15 of 27
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
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.
5.7 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 tempera-
ture sensor from National semiconductors. It can measure temperature from -55 degree
Cel- sius to +150 degree Celsius. The voltage output of the LM35 increases 10mV per degree
Cel- sius 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
16 of 27
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
Operates from 4 V to 30 V
Less than 60-μA Current Drain
Low Self-Heating, 0.08°C in Still Air
Non-Linearity Only ±¼°C Typical
Low-Impedance Output, 0.1 Ω for 1-mA Load
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:
17 of 27
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
Specifications:
Operating Voltage: 3.5V to 5.5V
Operating current: 0.3mA (measuring) 60uA (standby)
Output: Serial data
Temperature Range: 0°C to 50°C
Humidity Range: 20% to 90%
Resolution: Temperature and Humidity both are 16-bit
Accuracy: ±1°C and ±1%
Fig. 5.24: A) Temperature and Humidity Sensor. B )Schematic Pin Diagram of Temperature and Humidity
Sensor
18 of 27
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
6. LIST OF EXPERIMENTS.
6.1 A) To interface LED/Buzzer: To “turn ON” LED/Buzzer for 1 second after
every 2 seconds.
Connection: For LED Connect J4A PIN-1,3,5 to J4 PIN-1,3,5/For Buzzer connect J8A PIN-
3,4 to J8 PIN-3,4
Connected Pin details: LED1 – P31/ BUZ – P38
Result: LED1 will turn On-Off / Buzzer will turn ON- OFF.
sudo python3 EC581_01_Buzzer_001.py
6.3To interface motor Relay 1 and “turn ON” when switch is pressed.
Connection: Connect J8A PIN 1, 4 to J8 PIN 1, 4; J4A PIN-1,3,5 to J4 PIN-1,3,5
Connected Pin details: RLY1 – P36, SWITCH1 – P35
Result: Relay1 will turn ON when Switch 1 is pressed.
sudo python3 EC581_03_Relay_Switch_001.py
19 of 27
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
(Follow instruction mentioned in the program to update Bluetooth driver if error occurs)
sudo python3 EC581_04_05_BluetoothSend.py
6.5To interface Bluetooth and turn ON/OFF LED when on/off is received from
smartphone.
Connection: For LED Connect J4A PIN-1,3,5 to J4 PIN-1,3,5
Connected Pin details: LED1 – P31
Result: LED1 will turn On-Off when on/off is received from the phone via bluetooth.
(Follow instruction mentioned in the program to update Bluetooth driver if error occurs)
sudo python3 EC581_04_05_BluetoothSend.py
20 of 27
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
6.10 To create UDP server and respond with temperature and humidity data
to UDP client when requested.
Connection: Connect Data pin to PIN-7 on the board.
Connected Pin details: Data to J16 PIN-7, GND to J18, Vcc to J19.
Result: Temperature and humidity readings will be available to UDP client(s) when
server is running and on same network.
(Make sure to enter server IP address in client program. Run server program in terminal
and client program in IDE.)
sudo python3 EC581_10_udp_server.py ; sudo python3 EC581_10_udp_client.py
6.11 To create TCP server and respond with temperature and humidity data
to TCP client when requested.
Connection: Connect Data pin to PIN-7 on the board.
Connected Pin details: Data to J16 PIN-7, GND to J18, Vcc to J19.
Result: Temperature and humidity readings will be available to TCP client(s) when server
is running and on same network.
(Use IP address generated by program to view data in browser on any device on same
network.)
sudo python3 EC581_11_DHT_webServer.py
6.12 To subscribe to MQTT broker for temperature data and print it.
Connection: Connect Data pin to PIN-7 on the board.
Connected Pin details: Data to J16 PIN-7, GND to J18, Vcc to J19.
Result: Temperature and humidity readings will be will be retrieved from local Broker.
(Install Mosquitto MQTT Broker using sudo pip3 install mosquitto mosquitto-clients
Step1: Run EC581_12_mqtt_Subscribing_test_mosquitto_org.py in a new terminal
window.
Step2: Run EC581_12_mqtt_subscribing_localBroker.py in the IDE.
Step3: Run EC581_12_mqtt_publishingDHT_localBroker.py in another terminal window.
Data should be printed in the IDE.)
sudo python3 EC581_12_mqtt_publishingDHT_localBroker.py
sudo python3 EC581_12_mqtt_subscribing_localBroker.py
sudo python3 EC581_12_mqtt_Subscribing_test_mosquitto_org.py
21 of 27
Inter
TMI-ALS. 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.
22 of 27
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
8. THINGSPEAK CLOUD.
8.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.
23 of 27
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
Channels:
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.
24 of 27
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
REST API: Use REST API calls to Create and update ThingSpeak Channels and Charts.
MQTT API: Use the MQTT API to update ThingSpeak channels.
Publish:
Publish to Channel Feed Publish message to update multiple channel
field simultaneously.
25 of 27
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
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/
26 of 27
Inter
TMI-ALS. ALS-XT-IoT-PRJBRD-RBPi-01
9. TROUBLESHOOTING.
Here are some guidelines to troubleshoot some typical problems. Problems in field,
however, can vary, depending on field conditions.
10. REFERENCES.
1. https://www.raspberrypi.org
2. https://thingspeak.com/
3. https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
27 of 27
Inter