sdarpibot - vles'16

27
Sensor Data Acquisition Raspberry Pi Bot - SDARPiBot 20 July 2016 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

Upload: arun-joseph

Post on 13-Apr-2017

53 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SDARPiBot - VLES'16

Sensor Data Acquisition Raspberry Pi Bot - SDARPiBot

20

Ju

ly 2

01

6

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

Page 2: SDARPiBot - VLES'16

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.

20

Ju

ly 2

01

6

2

Page 3: SDARPiBot - VLES'16

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.

20

Ju

ly 2

01

6

3

Page 4: SDARPiBot - VLES'16

Internet of Things – IoT (contd.)

20

Ju

ly 2

01

6

4

Page 5: SDARPiBot - VLES'16

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.

20

Ju

ly 2

01

6

5

Page 6: SDARPiBot - VLES'16

Design and Implementation

20

Ju

ly 2

01

6

6

Page 7: SDARPiBot - VLES'16

Block Diagram

20

Ju

ly 2

01

6

7

Page 8: SDARPiBot - VLES'16

SDARPiBot – Motor Driver Interfacing

20

Ju

ly 2

01

6

8

• L293D can handle two motors independently and each motor can run at different speeds or directions.

Page 9: SDARPiBot - VLES'16

SDARPiBot – Camera Interfacing

20

Ju

ly 2

01

6

9

Page 10: SDARPiBot - VLES'16

SDARPiBot – Sensor tag CC2650 interfacing • Supports 10 Low-Power Sensors

• Ambient Light

• Infrared Temperature

• Ambient Temperature

• Accelerometer

• Gyroscope

• Magnetometer

• Pressure

• Humidity

• Microphone

• Magnetic Sensor

20

Ju

ly 2

01

6

10

Page 11: SDARPiBot - VLES'16

SDARPiBot – 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.

20

Ju

ly 2

01

6

11

Page 12: SDARPiBot - VLES'16

SDARPiBot– 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.

20

Ju

ly 2

01

6

12

Page 13: SDARPiBot - VLES'16

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.

20

Ju

ly 2

01

6

13

Page 14: SDARPiBot - VLES'16

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.

20

Ju

ly 2

01

6

14

Page 15: SDARPiBot - VLES'16

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 –r

• 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.

20

Ju

ly 2

01

6

15

Page 16: SDARPiBot - VLES'16

MQTT Publish & Subscribe (contd.)

20

Ju

ly 2

01

6

16

Page 17: SDARPiBot - VLES'16

MQTT Publish & Subscribe (contd.)

20

Ju

ly 2

01

6

17

Page 18: SDARPiBot - VLES'16

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.

20

Ju

ly 2

01

6

18

Page 19: SDARPiBot - VLES'16

Boot time execution of scripts (contd.)

20

Ju

ly 2

01

6

19

Page 20: SDARPiBot - VLES'16

WebIOPi Framework & Weaved service • WebIOPi can be used to easily access GPIO pins of the

Raspberry Pi.

20

Ju

ly 2

01

6

20

Page 21: SDARPiBot - VLES'16

WebIOPi Framework & Weaved service (contd.)

20

Ju

ly 2

01

6

21

Page 22: SDARPiBot - VLES'16

WebIOPi Framework & Weaved service (contd.)

20

Ju

ly 2

01

6

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.

Page 23: SDARPiBot - VLES'16

20

Ju

ly 2

01

6

23

Conclusion

Page 24: SDARPiBot - VLES'16

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.

20

Ju

ly 2

01

6

24

Page 25: SDARPiBot - VLES'16

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.

20

Ju

ly 2

01

6

25

Page 26: SDARPiBot - VLES'16

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

20

Ju

ly 2

01

6

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/

Page 27: SDARPiBot - VLES'16

THANK YOU

20

Ju

ly 2

01

6

27