際際滷

際際滷Share a Scribd company logo
Sensor Data Acquisition
Raspberry Pi Bot - SDARPiBot
20July2016
1
Project Guide:
Prof. Sunny Thomas Presented by
Head of the Department ARUN JOE JOSEPH
Dept. Of ECE Roll No: 8
S4 M.Tech VLSI & ES
Introduction
? In this project, we implement an IoT powered surveillance
bot, SDARPiBot that can capture various environment
variables and can be accessed remotely over the internet,
which finds application in planetary and deep space probes.
? The primary objective is to implement a surveillance bot that
can capture various environment variables and can be
accessed remotely over the internet.
? Bidirectional data flow:
? Sensor and visual data flow in one direction and,
? Control information for remote access in the opposite direction.
20July2016
2
Internet of Things - IoT
? The Internet of Things (IoT) is an environment in which
objects, animals or people are provided with unique
identifiers and the ability to transfer data over a network
without requiring human-to-human or human-to-computer
interaction. IoT has evolved from the convergence of wireless
technologies, micro-electromechanical systems (MEMS) and
the Internet. The concept may also be referred to as the
Internet of Everything.
20July2016
3
Internet of Things C IoT (contd.)
20July2016
4
Raspberry Pi - Motor Driver
? This motor driver IC can simultaneously control two small
motors in either direction; forward and reverse with just 4
microcontroller pins (if you do not use enable pins).
? Each chip contains two full H-bridges (four half H-bridges).
That means you can drive four solenoids, two DC motors bi-
directionally, or one stepper motor.
20July2016
5
Design and
Implementation
20July2016
6
Block Diagram
20July2016
7
SDARPiBot C Motor Driver
Interfacing
20July2016
8
? L293D can handle two motors independently and each motor
can run at different speeds or directions.
SDARPiBot C Camera
Interfacing
20July2016
9
SDARPiBot C Sensor tag CC2650
interfacing
? Supports 10 Low-Power Sensors
? Ambient Light
? Infrared Temperature
? Ambient Temperature
? Accelerometer
? Gyroscope
? Magnetometer
? Pressure
? Humidity
? Microphone
? Magnetic Sensor
20July2016
10
SDARPiBot C Sensor tag
CC2650 interfacing (contd.)
? The SensorTag MUST be advertising for the device to be
discoverable by the SDARPiBot.
? In the advertising state the SDARPiBot can:
? Scan and discover the Sensor Tag. (Scan response contain name
^CC2650 SensorTag ̄).
? Establish connection based on user defined Connection
Parameters.
20July2016
11
SDARPiBotC Sensor tag
CC2650 interfacing (contd.)
? When connected the central device can:
? Discover Characteristic by UUID.
? Write to and read from Characteristic Value (configure sensors and
read data).
? Disconnect the device and return it to an advertising state.
? When an enable command (0x01) is written to
the configuration characteristic, the sensor starts to perform
measurements each second (average over four
measurements) and the data is stored in
the data characteristic.
? When the disable command (0x00) is issued, the sensor is put
in stand-by mode and no data are cleared and no longer
reported.
20July2016
12
MQTT Publish & Subscribe
? Data obtained from the sensor tag is converted into a format
known as JSON (Java Script Object Notation) format.
? Why JSON?
? JSON is a valid subset of JavaScript, Python, and YAML.
? JSON parsing is generally faster than XML parsing.
? JSON is a more compact format, meaning it weighs far less on the
wire than the more verbose XML.
? JSON is easier to work with in some languages (such as javascript,
python, and php).
? Formatted JSON is generally easier to read than formatted XML.
? JSON specifies how to represent complex datatypes, there is no
single best way to represent a data structure in XML.
20July2016
13
MQTT Publish & Subscribe (contd.)
? This JSON data is published to the cloud using MQTT (Message
Queue Telemetry Transport) protocol.
? Why MQTT?
? Easy, Binary, Minimal overhead.
? Data agnostic.
? Publish / Subscribe.
? Push instead of Pull.
? Reliable even when used with unreliable networks, constrained
devices.
? Low bandwidth, high latency use case.
20July2016
14
MQTT Publish & Subscribe (contd.)
? mosquitto_sub -t ^CC2650 ̄
? The client can subscribe to multiple topics, downgrade topic
subscriptions to a lower QoS, provide an ID for persistent
sessions, define a will message, and many other options.
(mosquitto_sub -h will list them.)
? mosquitto_pub -t ^CC2650" -m "message payload" -q 1 Cr
? This will publish a message to a given topic at QoS 1, retained.
Many options will be listed by mosquitto_pub -h.
? Mosquitto is an open source message broker that implements
the MQTT protocol.
20July2016
15
MQTT Publish & Subscribe (contd.)
20July2016
16
MQTT Publish & Subscribe (contd.)
20July2016
17
Boot time execution of scripts
? The python and shell scripts may be run at boot time using a
crontab utility, using which scripts can be scheduled to be
executed after booting.
? The crontab is a list of commands that you want to run on a
regular schedule, and also the name of the command used to
manage that list.
? The below commands are appended to the crontab.
? @reboot sh /home/pi/launcher.sh >/home/pi/logs/cronlog 2>&1
? @reboot sleep 60 && sh /home/pi/livestream.sh
? Here, launcher.sh is executed at boot time and creates a
cronlog, while livestream.sh is executed 60 seconds after the
boot.
20July2016
18
Boot time execution of scripts
(contd.)
20July2016
19
WebIOPi Framework &
Weaved service
? WebIOPi can be used to easily access GPIO pins of the
Raspberry Pi.
20July2016
20
WebIOPi Framework &
Weaved service (contd.)
20July2016
21
WebIOPi Framework &
Weaved service (contd.)
20July2016
22
? We setup a web server on the SDARPiBot using WebIOPi
framework to create a web user interface for data monitoring
and remote access . This web server is made accessible from
the internet with the help of Weaved service.
20July2016
23
Conclusion
Conclusion (contd.)
? The objectives of this project have been accomplished.
? Published sensor data into the cloud using MQTT protocol via
Raspberry Pi as the gateway device.
? Subscribed to the sensor data in the cloud using MQTT via a
remote terminal.
? Implemented Live streaming of Low light visual data for
surveillance application.
? Implemented remote access of the SDARPiBot using internet.
? Thus, the bidirectional data communication over the internet in
order to monitor the environment variables and to control the
SDARPiBot has been implemented.
20July2016
24
Future scope
? Using 3D cameras for depth perception and indoor
navigation.
? Implementing virtual reality (VR) mapping into
SDARPiBot .
? More user friendly interaction between user and
SDARPiBot.
20July2016
25
References
1. http://zacharybears.com/
2. https://www.raspberrypi.org
3. http://processors.wiki.ti.com/
4. http://mqtt.org/
5. https://github.com/
6. http://hackaday.com/
7. http://spin.atomicobject.com/
8. https://en.wikipedia.org
20July2016
26
9. http://www.stuffaboutcode.com/
10. http://coderewind.com/
11. http://weaved.com/
12. http://webiopi.trouch.com/
13. http://connectedly.com/
14. http://instructables.com/
15. http://hackster.io/
THANK YOU
20July2016
27

More Related Content

SDARPiBot - VLES'16

  • 1. Sensor Data Acquisition Raspberry Pi Bot - SDARPiBot 20July2016 1 Project Guide: Prof. Sunny Thomas Presented by Head of the Department ARUN JOE JOSEPH Dept. Of ECE Roll No: 8 S4 M.Tech VLSI & ES
  • 2. Introduction ? In this project, we implement an IoT powered surveillance bot, SDARPiBot that can capture various environment variables and can be accessed remotely over the internet, which finds application in planetary and deep space probes. ? The primary objective is to implement a surveillance bot that can capture various environment variables and can be accessed remotely over the internet. ? Bidirectional data flow: ? Sensor and visual data flow in one direction and, ? Control information for remote access in the opposite direction. 20July2016 2
  • 3. Internet of Things - IoT ? The Internet of Things (IoT) is an environment in which objects, animals or people are provided with unique identifiers and the ability to transfer data over a network without requiring human-to-human or human-to-computer interaction. IoT has evolved from the convergence of wireless technologies, micro-electromechanical systems (MEMS) and the Internet. The concept may also be referred to as the Internet of Everything. 20July2016 3
  • 4. Internet of Things C IoT (contd.) 20July2016 4
  • 5. Raspberry Pi - Motor Driver ? This motor driver IC can simultaneously control two small motors in either direction; forward and reverse with just 4 microcontroller pins (if you do not use enable pins). ? Each chip contains two full H-bridges (four half H-bridges). That means you can drive four solenoids, two DC motors bi- directionally, or one stepper motor. 20July2016 5
  • 8. SDARPiBot C Motor Driver Interfacing 20July2016 8 ? L293D can handle two motors independently and each motor can run at different speeds or directions.
  • 10. SDARPiBot C Sensor tag CC2650 interfacing ? Supports 10 Low-Power Sensors ? Ambient Light ? Infrared Temperature ? Ambient Temperature ? Accelerometer ? Gyroscope ? Magnetometer ? Pressure ? Humidity ? Microphone ? Magnetic Sensor 20July2016 10
  • 11. SDARPiBot C Sensor tag CC2650 interfacing (contd.) ? The SensorTag MUST be advertising for the device to be discoverable by the SDARPiBot. ? In the advertising state the SDARPiBot can: ? Scan and discover the Sensor Tag. (Scan response contain name ^CC2650 SensorTag ̄). ? Establish connection based on user defined Connection Parameters. 20July2016 11
  • 12. SDARPiBotC Sensor tag CC2650 interfacing (contd.) ? When connected the central device can: ? Discover Characteristic by UUID. ? Write to and read from Characteristic Value (configure sensors and read data). ? Disconnect the device and return it to an advertising state. ? When an enable command (0x01) is written to the configuration characteristic, the sensor starts to perform measurements each second (average over four measurements) and the data is stored in the data characteristic. ? When the disable command (0x00) is issued, the sensor is put in stand-by mode and no data are cleared and no longer reported. 20July2016 12
  • 13. MQTT Publish & Subscribe ? Data obtained from the sensor tag is converted into a format known as JSON (Java Script Object Notation) format. ? Why JSON? ? JSON is a valid subset of JavaScript, Python, and YAML. ? JSON parsing is generally faster than XML parsing. ? JSON is a more compact format, meaning it weighs far less on the wire than the more verbose XML. ? JSON is easier to work with in some languages (such as javascript, python, and php). ? Formatted JSON is generally easier to read than formatted XML. ? JSON specifies how to represent complex datatypes, there is no single best way to represent a data structure in XML. 20July2016 13
  • 14. MQTT Publish & Subscribe (contd.) ? This JSON data is published to the cloud using MQTT (Message Queue Telemetry Transport) protocol. ? Why MQTT? ? Easy, Binary, Minimal overhead. ? Data agnostic. ? Publish / Subscribe. ? Push instead of Pull. ? Reliable even when used with unreliable networks, constrained devices. ? Low bandwidth, high latency use case. 20July2016 14
  • 15. MQTT Publish & Subscribe (contd.) ? mosquitto_sub -t ^CC2650 ̄ ? The client can subscribe to multiple topics, downgrade topic subscriptions to a lower QoS, provide an ID for persistent sessions, define a will message, and many other options. (mosquitto_sub -h will list them.) ? mosquitto_pub -t ^CC2650" -m "message payload" -q 1 Cr ? This will publish a message to a given topic at QoS 1, retained. Many options will be listed by mosquitto_pub -h. ? Mosquitto is an open source message broker that implements the MQTT protocol. 20July2016 15
  • 16. MQTT Publish & Subscribe (contd.) 20July2016 16
  • 17. MQTT Publish & Subscribe (contd.) 20July2016 17
  • 18. Boot time execution of scripts ? The python and shell scripts may be run at boot time using a crontab utility, using which scripts can be scheduled to be executed after booting. ? The crontab is a list of commands that you want to run on a regular schedule, and also the name of the command used to manage that list. ? The below commands are appended to the crontab. ? @reboot sh /home/pi/launcher.sh >/home/pi/logs/cronlog 2>&1 ? @reboot sleep 60 && sh /home/pi/livestream.sh ? Here, launcher.sh is executed at boot time and creates a cronlog, while livestream.sh is executed 60 seconds after the boot. 20July2016 18
  • 19. Boot time execution of scripts (contd.) 20July2016 19
  • 20. WebIOPi Framework & Weaved service ? WebIOPi can be used to easily access GPIO pins of the Raspberry Pi. 20July2016 20
  • 21. WebIOPi Framework & Weaved service (contd.) 20July2016 21
  • 22. WebIOPi Framework & Weaved service (contd.) 20July2016 22 ? We setup a web server on the SDARPiBot using WebIOPi framework to create a web user interface for data monitoring and remote access . This web server is made accessible from the internet with the help of Weaved service.
  • 24. Conclusion (contd.) ? The objectives of this project have been accomplished. ? Published sensor data into the cloud using MQTT protocol via Raspberry Pi as the gateway device. ? Subscribed to the sensor data in the cloud using MQTT via a remote terminal. ? Implemented Live streaming of Low light visual data for surveillance application. ? Implemented remote access of the SDARPiBot using internet. ? Thus, the bidirectional data communication over the internet in order to monitor the environment variables and to control the SDARPiBot has been implemented. 20July2016 24
  • 25. Future scope ? Using 3D cameras for depth perception and indoor navigation. ? Implementing virtual reality (VR) mapping into SDARPiBot . ? More user friendly interaction between user and SDARPiBot. 20July2016 25
  • 26. References 1. http://zacharybears.com/ 2. https://www.raspberrypi.org 3. http://processors.wiki.ti.com/ 4. http://mqtt.org/ 5. https://github.com/ 6. http://hackaday.com/ 7. http://spin.atomicobject.com/ 8. https://en.wikipedia.org 20July2016 26 9. http://www.stuffaboutcode.com/ 10. http://coderewind.com/ 11. http://weaved.com/ 12. http://webiopi.trouch.com/ 13. http://connectedly.com/ 14. http://instructables.com/ 15. http://hackster.io/