You are on page 1of 12

1.

A Raspberry Pi is a small low powered computer. It has an


ARM processor that can run a Linux desktop operating system.
If Microsoft wanted they could release a Windows desktop
operating system for the Raspberry Pi. Microsoft has already
released an Internet of Things version of Windows 10 for the
Raspberry Pi.
If you look at the Raspberry Pi 3 it has:
 4 USB ports for keyboard, mouse and other USB
devices
 1 HDMI port to hook up to a monitor
 1 Audio headphone port
 1 Ethernet port
 WiFi
 Bluetooth
If you look at a standard desktop computer it has:
 4 or more USB ports for keyboard, mouse and other
USB devices
 1 or 2 HDMI ports
 1 Audio headphone port
 1 Audio line out port
 1 Audio microphone port
 1 or 2 Ethernet ports
 WiFi
 Bluetooth
 SATA hard drive ports
 SD Card port
So the differences would be:
 Audio line out port
 Audio microphone port
 SATA hard drive ports
 SD Card port
I don’t include the micro SD card on the Raspberry Pi since it
has to use that for the operating system.
Probably the two biggest barriers to the Raspberry Pi being
used as a desktop replacement are the lack of SATA hard drive
support and the slower/lower power processor

2.
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(13,GPIO.IN) #button
GPIO.setup(21,GPIO.OUT) #led
while True:

# Turn LED off


print ("LED off")
GPIO.output(21, GPIO.LOW)

# waiting for button press


while GPIO.input(13) == 1:
time.sleep(0.2)

# Turn LED on
print ("LED on")
GPIO.output(21, GPIO.HIGH)

# waiting for button release


while GPIO.input(13) == 0:
time.sleep(0.2)

3.
#import mod
import smtplib
from email.mime.text import MIMEText
import RPi.GPIO as GPIO
import time
#setup gpio pins
GPIO.cleanup()
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.IN)
#Print message on screen
print "Push button to send email,"
#start loop
loop = "1"
while loop == "1":
#test GPIO for input
if GPIO.input(17):
#create email
message = """Test email send via RPi and Python"""
msg = MIMEText(message)
msg['subject'] = 'Rpi test'
msg['from'] = 'My email>'
msg['to'] = 'Their email'
# send mail
s = smtplib.SMTP('smtp server')
s.login('user name' , 'Password')
s.sendmail(msg['From'], msg['To'], msg.as_string())
s.quit
print "Email sent"
time.sleep(2)
while GPIO.input(17):
pass

4.
#!/usr/bin/env python
import os
import datetime
import time
import RPi.GPIO as GPIO
GPIO.setwarnings(False)

DEBUG = 1
GPIO.setmode(GPIO.BCM)
def RCtime (RCpin):
reading = 0
GPIO.setup(RCpin, GPIO.OUT)
GPIO.output(RCpin, GPIO.LOW)
time.sleep(.1)

GPIO.setup(RCpin, GPIO.IN)
# This takes about 1 millisecond per loop cycle
while (GPIO.input(RCpin) == GPIO.LOW):
reading += 1
return reading

while True:
GetDateTime =
datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
LDRReading = RCtime(3)
print RCtime(3)

# Open a file
fo =
open("/home/pi/Desktop/gpio_python_code/foo.txt", "wb")
fo.write (GetDateTime)
LDRReading = str(LDRReading)
fo.write ("\n")
fo.write (LDRReading)

# Close opend file


fo.close()
time.sleep(1)

5.
a) Asus Tinker Board

That means the Tinker Board can function as a replacement for


any computer you have around. Features-wise, the Tinker
Board has the edge over the Raspberry Pi, thanks to its more
powerful processor and huge RAM. It comes with a high-
performance quad-core ARM SoC clocked at 1.8GHz, which is
way faster than the one on the RPi. Add this to the all-powerful
Mali T764 GPU and the 2GB RAM, and what you get is a
microcomputer that strikes a perfect balance between speed
and performance.

What’s more, the Tinker Board comes with 4K video support,


while the Raspberry Pi 3 model B only supports 1080p videos.
Audio-wise, the Tinker Board offers support for 192k/24bit
audio playback while the RPi supports up to 48k/16bit. The
Asus Tinker Board is almost $30 more expensive than the RPi
($57.45), but with the price, you get more features and better
speed.

b) ODroid XU4

With specs more akin to a low-end PC, the Odroid-H2 costs


almost three times the price of the $35 Raspberry Pi 3 B+.

As an x86 Intel Celeron based board, it can run a wider range


of Linux-based operating systems than a typical Arm-based,
single-board computer.

Its specs stand out from the crowd too, with the ability to add
fast SSD storage via its 4 x PCIe 2.0 NMVe interface and SATA
3.0 ports, and support for up to 32GB of DDR4 RAM.
Additionally, there is fast network connectivity via the two
gigabit Ethernet ports, although no mention of Wi-Fi support.
However, while Odroid boards have a good reputation for
software support, this board doesn't appear to be targeting
hardware hackers, with only a 20-pin expansion header.

The board's 2.3GHz Intel J4105 processor — a "Gemini Lake"


system-on-a-chip dating from 2017 — is also faster than the
Arm Cortex A53 / A72-based CPUs found in recent SBCs.
c) Banana Pi-M64

Banana pi provides an open source hardware platform


which was produced to run Elastos.org open source
operating system. It is dual core, Android 4.2 product
which is better than Raspberry Pi. It is highly efficient with
several Linux distributions in the market like Debian,
Ubuntu, OpenSuse and images that run on Raspberry Pi
and Cubieboard. It consists of a Gigabit Ethernet port and
a SATA socket. The size of Banana pi M1 is about the same
size as a credit card. It has a potential to run the games
smoothly as it supports 1080P high definition video output.
The GPIO is compatible with Raspberry Pi and it can run
Raspberry pi images directly. Several versions of Banana
pi are available in the market like Banana pi M1, Banana pi
M+, Banana pi Pro, Banana pi G1 etc. All versions come
along with the enhanced capabilities like operating system
support, available RAM, GPIO capabilities.

d) NanoPi NEO4

The NanoPi M4 is almost double the price the $35 Raspberry


Pi but ups its specs across the board.

Notable features include four USB 3.0 ports, a USB Type-C


port, 2GB DDR3 memory, a six-core processor, support for 4K
displays and hardware-accelerated 4K video playback, and 64
general-purpose input-output (GPIO) pins for hooking up
hardware. It also includes an interface that supports two 13-
megapixel cameras.

While the Pi supports a far wider range of open-source


operating systems, the NanoPi M4 is listed as supporting
Android 7.1, alongside Ubuntu 18.04 Desktop and Ubuntu
Core.

It's worth noting that some users of recent NanoPi boards have
also encountered driver problemsand system setup issues, so
this board and the NEO4 may be one for the more technically
proficient.

e) Rock64

ROCK64 is a credit card size 4K60P HDR10 Single Board


Computer powered by Rockchip RK3328 Quad-Core ARM
Cortex A53 64-Bit Processor and support up to 4GB 1600MHz
LPDDR3 memory. It provides eMMC module socket, MicroSD
Card slot, Pi-2 Bus, Pi-P5+ Bus, USB 3.0 and many others
peripheral devices interface for makers to integrate with
sensors and devices. Various Operating System (OS) are
made available by open source community such Android 7.1,
Debian, and many more to come.

UNIT-V
1.
MapReduce framework which allows us to perform such parallel
computations without bothering about the issues like reliability,
fault tolerance etc. Therefore, MapReduce gives you the
flexibility to write code logic without caring about the design
issues of the system.
MapReduce Tutorial: What is MapReduce?
 MapReduce consists of two distinct tasks – Map and
Reduce.
 As the name MapReduce suggests, reducer phase takes
place after mapper phase has been completed.
 So, the first is the map job, where a block of data is read
and processed to produce key-value pairs as intermediate
outputs.
 The output of a Mapper or map job (key-value pairs) is input
to the Reducer.
 The reducer receives the key-value pair from multiple map
jobs.
 Then, the reducer aggregates those intermediate data
tuples (intermediate key-value pair) into a smaller set of
tuples or key-value pairs which is the final output.

2.
Use:
1.better performance
2.increased reliability
3. Granular Scalability
4. Simplifed Decoupling

Amazon SQS:
Amazon SQS supports the logical data types String, Number,
and Binary with optional custom data type labels with the
format .custom-data-type

 String – String attributes can store Unicode text with UTF-


8 binary encoding. For more information, see ASCII
Printable Characters.
 Number – Number attributes can store positive or
negative numerical values. A number can have up to 38
digits of precision, and it can be between 10^-128 and
10^+126.
Note
Amazon SQS removes leading and trailing zeroes.
 Binary – Binary attributes can store any binary data such
as compressed data, encrypted data, or images.
 Custom – To create a custom data type, append a
custom-type label to any data type. For example:
o Number.byte, Number.short, Number.int,
and Number.float can help distinguish between
number types.
o Binary.gif and Binary.png can help distinguish
between file types.
3.

Amazon DynamoDB is a fully managed NoSQL database


service that provides fast and predictable performance with
seamless scalability. DynamoDB lets you offload the
administrative burdens of operating and scaling a distributed
database, so that you don't have to worry about hardware
provisioning, setup and configuration, replication, software
patching, or cluster scaling. Also, DynamoDB offers encryption
at rest, which eliminates the operational burden and complexity
involved in protecting sensitive data. For more information,
see Amazon DynamoDB Encryption at Rest.

With DynamoDB, you can create database tables that can store
and retrieve any amount of data, and serve any level of request
traffic. You can scale up or scale down your tables' throughput
capacity without downtime or performance degradation, and
use the AWS Management Console to monitor resource
utilization and performance metrics.

Amazon DynamoDB provides on-demand backup capability. It


allows you to create full backups of your tables for long-term
retention and archival for regulatory compliance needs. For
more information, see On-Demand Backup and Restore for
DynamoDB.

You can create on-demand backups as well as enable point-in-


time recovery for your Amazon DynamoDB tables. Point-in-time
recovery helps protect your Amazon DynamoDB tables from
accidental write or delete operations. With point-in-time
recovery, you can restore that table to any point in time during
the last 35 days. For more information, see Point-in-Time
Recovery: How It Works.

DynamoDB allows you to delete expired items from tables


automatically to help you reduce storage usage and the cost of
storing data that is no longer relevant. For more information,
seeTime To Live.
4.
In the world of Internet of Things (IoT) when we have all the
technologies to revolutionize our life, it's a great idea to develop
a system which can be controlled and monitored from
anywhere. There are many types of good security systems and
cameras out there for home security but they are much
expensive so today we will build a low cost simple Raspberry
Pi based Intruder Alert System, which not only alert you
through an email but also sends the picture of Intruder when it
detects any.
In this IoT based Project, we will build a Home Security System
using PIR Sensor and PI Camera. This system will detect the
presence of Intruder and quickly alert the user by sending him a
alert mail. This mail will also contain the Picture of the Intruder,
captured by Pi camera. Raspberry Pi is used to control the whole
system. This system can be installed at the main door of your
home or office and you can monitor it from anywhere in the world
using your Email over internet.

Components Required:

 Raspberry Pi
 Pi Camera
 PIR Sensor
 LED
 Bread Board
 Resistor (1k)
 Connecting wires
 Power supply

Working Explanation:

Working of this Project is very simple. A PIR sensor is used to


detect the presence of any person and a Pi Camera is used to
capture the images when the presence it detected.
Whenever anyone or intruder comes in range of PIR sensor, PIR
Sensor triggers the Pi Camera through Raspberry Pi.
Raspberry pi sends commands to Pi camera to click the picture
and save it. After it, Raspberry Pi creates a mail and sends it to
the defined mail address with recently clicked images. The mail
contains a message and picture of intruder as attachment. Here
we have used the message “Please find the attachment”, you
can change it accordingly in the Code given at the end.
Here the pictures are saved in Raspberry Pi with the name which
itself contains the time and date of entry. So that we can check
the time and date of intruder entry by just looking at the Picture
name, check the images below. If you are new with Pi Camera
then check our previous tutorial on Visitor Monitoring System
with Pi Camera.

5.
Air quality nowadays has been degraded to a large extent that
it has become a necessary criteria for us to monitor its quality.
The quality of air has been affected by various factors like
industrial emission, vehicular transmission etc.
The evolution of various technology like the Internet of Things,
Raspberry Pi, it has become easier for us to deploy sensors
and allow to detect the quality of air in real time.
The Internet Of things is a term for various devices
communicating with each other which was not possible before
since the different devices use different kind of data which has
been overcome by the use of single board computer
(Raspberry Pi).
Integration of IOT with Sensor nodes with the help of Raspberry
Pi for Air Quality Monitoring provides an effective way than the
approaches that were previously used.
Sensor web node is proposed with commercial gas sensors for
detecting the gases like CO, CO2 etc to monitor both indoor
and outdoor air quality.
The results obtained through these sensors are then evaluated
by Ruby on Rails Server through web socket.

You might also like