Io T Practical Journal Mumbai Universitys BSC It Semester V Course Includes Iot Subject Uploaded
Io T Practical Journal Mumbai Universitys BSC It Semester V Course Includes Iot Subject Uploaded
Io T Practical Journal Mumbai Universitys BSC It Semester V Course Includes Iot Subject Uploaded
TY Bsc IT Sem V
Internet of Things
Practical
Hardware Requirements
Software Requirements
Raspbian image
SD Card formatter
Windows32 Disk Imager
Pre-requisites
Download SD card formatter Application
https://sd-card-formatter.en.uptodown.com/windows
Download Windows32 Disk Imager Application
https://sourceforge.net/projects/win32diskimager/
2. Download the latest version of Raspbian and unzip the .img file
3) Choose the format type Quick to Full (Erase) & Click on Ok:
4) Formatting will erase all your data from SD Card, so make sure and then
click on Format and click on Ok.
6) Download the latest version of Raspbian OS and unzip the .img file
•Download the OS from Raspberry Pi’s official website using following link
https://www.raspberrypi.org/downloads/
•Now click on Download ZIP .After the download unzip the file
lOMoARcPSD|27781631
12) It takes some time to process the installation 13) Installation is done
lOMoARcPSD|27781631
1) Now Remove SD card from Card Reader and insert it into Raspberry Pi.
2) Connect all devices
a. USB Keyboard and Mouse
b. Ethernet Cable
c. HDMI Cable or HDMI to VGA Connector
d. Power Supply
HDMI
Cable Power
Connection of LAN Cable
raspberry pi
Power
Indicator
Keyboard
SD Card
Active
After power on Raspberry Pi, two light indicators should be blink. In which
Red Light indicates that power supply is provided, whereas Green Light
indicates that SD card is read by Pi.
If green light is not visible, then something is wrong with your SD Card.
Hardware Requirements
Software Requirements
Raspbian image
Putty (Console Mode)
Remote Desktop Connection / VNC Viewer (Graphical Mode)
Pre-requisites
Bootable SD card with Raspbian OS installed in it.
2. Insert SD Card in card reader and connect to PC or Laptop. Open SD Card drive.
lOMoARcPSD|27781631
IMP Note: My Laptop and Raspberry Pi (via Ethernet cable) are connected to
the same router. So both are sharing same network.
lOMoARcPSD|27781631
Now first find the IP address of Raspberry Pi. There are various ways to
do so. Some are listed as follows:
Advanced IP Scanner Application
Download it using https://www.advanced-ip-scanner.com/
Fing App.
Install Fing free app on your Mobile
from Play store.
Fing is a wireless network discovery
and audit tool which can be used to
view the devices connected to your
network.
Using one of them, you will definitely get the IP address of Pi. Use this IP
address to connect remotely to the Pi device from your laptop.
lOMoARcPSD|27781631
Login successful. So here you can perform any operations using Linux
Commands.
lOMoARcPSD|27781631
3. Now from Laptop’s Start Menu, Select and Open Remote Desktop
Connection & give IP address of Raspberry Pi and Click on Connect
lOMoARcPSD|27781631
Provide Username
and Password and
Click on OK
lOMoARcPSD|27781631
Practical No:03
GPIO: Light the LED with Python
1) Using One LED
Code: Output:
LED
ON
LED
OFF
Output:
Code: Green LED
ON
Red LED
ON
Blue LED
On
lOMoARcPSD|27781631
Installation Manual
To display small amount of data with Raspberry Pi, we can use 4 digit 7-segment Display.
7 Segment Display has seven segments in it and each segment has one LED inside it to display
the numbers by lighting up the corresponding segments.
Hardware Requirements
1. Raspberry Pi Model A/B/B+
2. 4 digit 7 Segment Display
3. Jumper wires (Female to Female)
Software Requirements
1. Raspbian Stretch OS
1. Connect your 4 digit 7 segment display with Raspberry Pi's GPIO Pins.
TM1637 Board
Function RPI Physical Pin Raspberry Function
Pin
GND Ground 14 GND
VCC + 5V Power 4 5V
Note: This Script file contains some of the important functions, which are required to add in our
Python script.
import sys
import time
import datetime
import RPi.GPIO as GPIO
import tm1637
Display = tm1637.TM1637(23,24,tm1637.BRIGHT_TYPICAL)
Display.Clear()
Display.SetBrightnes(1)
while(True):
now = datetime.datetime.now()
hour = now.hour
minute = now.minute
second = now.second
currenttime = [ int(hour / 10), hour % 10, int(minute / 10), minute % 10 ]
Display.Show(currenttime)
Display.ShowDoublepoint(second % 2)
time.sleep(1)
The above script needs the tm1637.py script to work, so place both files in the same folder.
Script functions
The clock script uses the following functions, defined in tm1637.py:
Display. Clear () - Clears the display if individual LEDs are still active.
Display.SetBrightnes(x) - After this you can adjust the brightness of the display, at least 0 and
maximum 7.
Display. Show(x,x,x,x) - Show the actual 4 digits (digits), x can be 0 to 9.
Display.ShowDoublepoint (status) - Controlling the ':' between the second and third digit, true
(1) = on / false (0) = off.
Hardware Requirements
1. Raspberry Pi Model A/B/B+
2. ADS1115 ADC
3. Breadboard
4. Jumper Wires
ADS1115 ADC chip is used to convert the analog input signals to digital signals which can be
visualized with the Raspberry Pi. This chip is important because the Raspberry Pi does not have an on-
board analog to digital converter (ADC).
Software Requirements
1. Raspbian Stretch OS
2. Adafruit module for interfacing with the ADS1115 ADC chip
3. Python Module matplotlib used for data visualization
lOMoARcPSD|27781631
Next, clone the Adafruit git folder for the library by running
Change into the cloned file’s directory and run the setup file
With all the dependencies installed, we are now ready to write the code.
At this stage it is important to switch to a monitor or use the VNC viewer (or Remote Desktop
Connection), anything through which you can see your Raspberry Pi’s desktop, as the graph being
plotted won’t show on the terminal.
lOMoARcPSD|27781631
GAIN = 1
val = [ ]
# Start continuous ADC conversions on channel 0 using the previous gain value.
adc.start_adc(0, gain=GAIN)
print('Reading ADS1x15 channel 0')
fig, ax = plt.subplots()
ax.set_ylim(-5000,5000)
ax.set_title('Oscilloscope')
ax.grid(True)
ax.set_ylabel('ADC outputs')
def update(cnt):
# Read the last ADC conversion value and print it out.
value = adc.get_last_result()
print('Channel 0: {0}'.format(value))
# Set new data to line
line.set_data(list(range(len(val))), val)
ax.relim()
ax.autoscale_view()
#Store values for later
val.append(int(value))
if(cnt>50):
val.pop(0)
Thank you….
lOMoARcPSD|27781631
green = 6
yellow = 13
red = 19
blue = 26
now = datetime.datetime.now()
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
##LED Blue
GPIO.setup(blue, GPIO.OUT)
GPIO.output(blue, 0) #Off initially
#LED Yellow
GPIO.setup(yellow, GPIO.OUT)
GPIO.output(yellow, 0) #Off initially
#LED Red
GPIO.setup(red, GPIO.OUT)
GPIO.output(red, 0) #Off initially
#LED green
GPIO.setup(green, GPIO.OUT)
GPIO.output(green, 0) #Off initially
def action(msg):
chat_id = msg['chat']['id']
lOMoARcPSD|27781631
command = msg['text']
if 'on' in command:
message = "on"
if 'blue' in command:
message = message + "blue "
GPIO.output(blue, 1)
if 'yellow' in command:
message = message + "yellow "
GPIO.output(yellow, 1)
if 'red' in command:
message = message + "red "
GPIO.output(red, 1)
if 'green' in command:
message = message + "green "
GPIO.output(green, 1)
if 'all' in command:
message = message + "all "
GPIO.output(blue, 1)
GPIO.output(yellow, 1)
GPIO.output(red, 1)
GPIO.output(green, 1)
message = message + "light(s)"
telegram_bot.sendMessage (chat_id, message)
if 'off' in command:
message = "off "
if 'blue' in command:
message = message + "blue "
GPIO.output(blue, 0)
if 'yellow' in command:
message = message + "yellow "
GPIO.output(yellow, 0)
if 'red' in command:
message = message + "red "
GPIO.output(red, 0)
if 'green' in command:
message = message + "green "
GPIO.output(green, 0)
if 'all' in command:
message = message + "all "
GPIO.output(blue, 0)
GPIO.output(yellow, 0)
GPIO.output(red, 0)
GPIO.output(green, 0)
message = message + "light(s)"
telegram_bot.sendMessage (chat_id, message)
lOMoARcPSD|27781631
telegram_bot = telepot.Bot('677951290:AAE57TbLoJT3rz7out0W2udQU0MC2AN1wbs')
Access Token Key
print (telegram_bot.getMe())
MessageLoop(telegram_bot, action).run_as_thread()
print ('Up and Running ...')
while 1:
time.sleep(10)
Thank you….
lOMoARcPSD|27781631
Software Requirements
• Connect LAN Cable coming out from your Network Provider into Raspberry Pi.
• Make sure your Laptop/PC is also connected with the same network.
• Connect Power Supply to Raspberry Pi.
• Check IP address of Raspberry Pi using IP Scanner Software or Fing App
• Then connect your Laptop/PC to Raspberry Pi using a terminal software like Putty.
lOMoARcPSD|27781631
• Update the Raspberry Pi to ensure we have the latest version of everything. This is done
by using following commands:
This will result in the Pi using DHCP which means it can be used in any network.
6. To effect the changes made to the Raspberry Pi, reboot the system.
Note : From now on hostapd will start whenever your Pi boots up.
There should now be a functioning bridge between the wireless LAN and the Ethernet connection
on the Raspberry Pi, and any device associated with the Raspberry Pi access point will act as if it
is connected to the access point's wired Ethernet.
It is possible to use a static IP address for the bridge if required, but generally, if the Raspberry
Pi access point is connected to a ADSL router, the DHCP address will be fine.
One of the advantage of fingerprint-based systems is that passwords and / or number codes can
be completely omitted.
Hardware Requirements
1. Raspberry Pi Model A/B/B+
2. Fingerprint Module
3. Serial USB Converter
4. Jumper Wires
R307 Fingerprint Module consists of optical fingerprint sensor, Supply voltage: DC 4.2 ~ 6.0V
Software Requirements
1. Raspbian Stretch OS
1. Now, just connect fingerprint module to Raspberry Pi USB port by using USB to
Serial converter.
Step 1: To install this library, root privileges are required. So login with root user.
lOMoARcPSD|27781631
Step 5: To return to the normal shell (under the Pi user), type exit
Step 6: Now check USB port on which your finger print sensor is connected. Use this USB
port in our Python script.
Step 8: Run sample file, to test to see if the sensor is detected and ready for access
The above data should appear, which allows you to display the positions under which an imprint
is stored by selecting a page (0-3).
If here you get Exception message, then something is wrong with the cabling or the sensor.
Check it again.
Step 9: Now execute other scripts, to make sure Fingerprint module is working.
Script Usage
Put your finger on the glass surface, wait for the instruction in the terminal and remove your finger
as soon as it is written there. Afterwards you have to put your finger a second time for the
verification and the imprint is stored in the next number.
Execute same script again, this time use other finger which is not previously stored.
If fingerprint is not detected, then gives "No match Found" message
That's all!!!
Thank you….
lOMoARcPSD|27781631
Sr Sr
No Identifier Description No Identifier Description
Direction E= East,
6 E 12 Height Height
W=West
Connect GPS module to Raspberry Pi’s GPIO Pins by using Female to Female Jumper wires
Connect 2x16 LCD Display to Raspberry Pi’s GPIO Pins with the help of breadboard and
jumper wires.
The dtoverlay=pi3-disable-bt disconnects the bluetooth from the ttyAMA0, this is to allow us access to
use the full UART power available via ttyAMAO instead of the mini UART ttyS0.
Save with Ctrl+X, yes and press Enter.
lOMoARcPSD|27781631
Step 9: Use minicom command to test our GPS module is working fine.
9600 represents the baud rate at which the GPS module communicates.
Here, we can see NMEA sentences .NMEA format consist several sentences, in which we only need
one sentence. This sentence starts from $GPGGA and contains the coordinates
Sometimes we received sentences which contains unknown msg*58, but this is not an error, actually it
may takes some time to track your GPS module. (Even for the first time more than 20-30 minutes.)
I suggest keep your GPS module's antenna in open space (e.g. near the window)
To exit from above window, Press Ctrl+A, and Press x and Enter Key.
Step 10: The above same test can also be done using cat command
This sentence gives you Latitude found after two commas and Longitude found after four commas.
lOMoARcPSD|27781631
Step 11: Write Python script to display your current Latitude and Longitude on LCD Display.
gpio.setmode(gpio.BCM)
try:
while 1:
try:
data = ser.readline()
except:
print("loading")
#wait for the serial port to churn out data
if data[0:6] == '$GPGGA': # the long and lat data are always contained in the GPGGA string of
the NMEA data
msg = pynmea2.parse(data)
latval = msg.lat #parse the latitude and print
concatlat = "Lat:" + str(latval)
print(concatlat)
lcd.set_cursor(0,0)
lcd.message(concatlat)
lOMoARcPSD|27781631
That's all!!!
Thank you….
lOMoARcPSD|27781631
Installation Manual
Controlling AC appliances with the click of buttons on a webpage using internet. It is possible
to control your Home appliances from anywhere in the world. This web server can be run from
any device which can run HTML applications, like Smart Phone, tablet, computer etc.
Hardware Requirements
1. Raspberry Pi Model B/B+ 5v Relays
2. LEDs to test.
3. Breadboard
4. AC lamp to Test
5. Jumper wires
Software Requirements
1. Raspbian Stretch OS
2. WebIOPi frame work
1. Connect your 5v Relay with Raspberry Pi's GPIO Pins using Jumper wires (Female-
Female).
+5v + 5V Power 4 5V
LED Terminal RPI Physical Pin LED Terminal RPI Physical Pin
Positive 37 Negative 39
lOMoARcPSD|27781631
Keep saying yes if asked to install any dependencies during setup installation. When done, reboot
your pi
After the login, click on the GPIO header link. Test your LED which is connected to raspberry Pi’s
GPIO Pins. In my case, I have used Physical Pin no 37 of Pi. So set it as output. Click the pin 37
button to turn on or off the LED. This way we can control the Raspberry Pi GPIO using WebIOPi.
After the test, if everything worked as described, then we can go back to the terminal and stop the
program with CTRL + C.
Smarthome.js file
webiopi().ready(function() {
webiopi().setFunction(4,"out");
var content, button;
content = $("#content");
Smarthome.css file
body {
background-color:#fff;
background-repeat:no-repeat;
background-position:center;
background-size:cover;
font: bold 18px/25px Arial, sans-serif;
h1 {
font: bold 40px Arial, sans-serif;
background-color:#000;
lOMoARcPSD|27781631
color:white;
}
button {
display: block;
position: absolute;
margin: 40px 610px;
padding: 0 10px;
text-align: center;
text-decoration: none;
width: 130px;
height: 40px;
font: bold 18px/25px Arial, sans-serif;
color: black;
-webkit-box-shadow: 1px 1px 1px rgba(0,0,0, .29), inset 1px 1px 1px rgba(255,255,255,
.44);
-moz-box-shadow: 1px 1px 1px rgba(0,0,0, .29), inset 1px 1px 1px rgba(255,255,255, .44);
box-shadow: 1px 1px 1px rgba(0,0,0, .29), inset 1px 1px 1px rgba(255,255,255, .44);
input[type="range"] {
display: block;
width: 160px;
height: 45px;
}
#gpio4.LOW {
background-color: White;
color: Black;
}
#gpio4.HIGH {
background-color: Black;
color: LightGray;
}
lOMoARcPSD|27781631
</body>
</html>
We need to edit the config file of the webiopi service so it’s pointed to use data from our html folder
instead of the config files that came with it.
Under http section of the config file, comment out doc-root line and change the path to your project
file
lOMoARcPSD|27781631
Note that you can change the password of the WebIOPi service using the command if you want. Or
skip this step.
When you Click on button Room1 ,it switch on AC Lamp, again clicking on same button ,it
will switch off AC Lamp.
Note : It is possible to open same URL http://PI’s IP address:8000 on smart phone , tablet
over local network.
That's all !!!
Thank you….
lOMoARcPSD|27781631
Installation Manual
In this tutorial, we are demonstrating Visitors Monitoring System with Image capture and
recording functionality. This Monitoring system will digitize and automate the whole visitor
entries, and there will be no need to maintain them manually.
We are interfacing Pi camera with Raspberry Pi to capture the image and record videos of every
visitor which has entered through the Gate or door. This captured image is saved in the system
with the Date and time of the entry.
This system is very useful in offices, factories where visitor entry record is maintained for visitors,
employees. So this can be very useful for security purpose.
Hardware Requirements
Raspberry Pi , SD Card
Pi camera
Buzzer
2 Push Buttons
LED
Bread Board
Jumper Wires
Power supply
Ethernet Cable / Wi Fi
Monitor , Keyboard, Mouse (Optional ,For without headless connection)
Software Requirements
1. Raspbian Stretch OS
2. Python Script
lOMoARcPSD|27781631
System Explanation
Pi camera is used to capture the images and record the videos of visitors, when a push button
is pressed or triggered.
After pushing the one button, Raspberry Pi sends command to Pi Camera to click the
picture and save it.
Similarly, after pushing another button, Raspberry Pi sends command to Pi Camera to
record the video and save it.
The buzzer is used to generate sound when button pressed.
LED is used for indicating that Raspberry Pi is ready to accept Push Button press, means
when LED is ON, and system is ready for operation.
Circuit Explanation
Connect Camera to Raspberry Pi
The Camera Module is a great accessory
for the Raspberry Pi, allowing users to
take still pictures and record video in full
HD. Connect the Camera Module to the
Raspberry Pi’s camera port (Blue side of
cable to face Ethernet connection).
I used following GPIO pins to connect above three components to Raspberry Pi.
Component Terminal RPI Raspberry
Physical Pin Function
Buzzer Positive Terminal Pin 32 GPIO 12
Push Button1 Positive Terminal Pin 36 GPIO 16
Push Button2 Positive Terminal Pin 38 GPIO 20
LED Positive Terminal Pin 40 GPIO 21
all Negative Terminal Pin 20 GND
Note that the camera preview only works when a monitor is connected to the Pi,
so remote access (such as SSH and VNC) will not allow you to see the camera
preview.
Complete Connection
Camera
LED
Buzzer
Push Button
Step 5: Write a Python Script to capture images and save them in folder.
(capture_record_picamera.py)
led=21 #pin no 40
buz=12 #pin no 32
butcapture=16 #pin no 36
butrecord=20 #pin no 38
lOMoARcPSD|27781631
HIGH=1
LOW=0
gpio.setwarnings(False)
gpio.setmode(gpio.BCM)
gpio.setup(led, gpio.OUT)
gpio.setup(buz, gpio.OUT)
gpio.setup(butcapture, gpio.IN, pull_up_down=gpio.PUD_UP)
gpio.setup(butrecord, gpio.IN, pull_up_down=gpio.PUD_UP)
gpio.output(led , 0)
gpio.output(buz , 0)
data=""
def capture_image():
print('Please Wait...')
data= time.strftime("%d_%b_%Y\%H:%M:%S")
camera.start_preview()
time.sleep(5)
print(data)
camera.capture('/home/pi/Desktop/Visitors/%s.jpg'%data)
camera.stop_preview()
print('Image Captured successfully')
time.sleep(2)
def record_video():
print('Please Wait...')
data= time.strftime("%d_%b_%Y\%H:%M:%S")
camera.start_preview()
camera.start_recording('/home/pi/Desktop/Visitors/rec.h264')
time.sleep(5)
print(data)
camera.stop_recording()
camera.stop_preview()
print('Video recorded successfully')
time.sleep(2)
print('Welcome to my System')
time.sleep(2)
camera = picamera.PiCamera()
camera.rotation=180
camera.awb_mode= 'auto'
camera.brightness=55
lOMoARcPSD|27781631
if gpio.input(butrecord)==False:
gpio.output(buz, 1)
gpio.output(led, 0)
time.sleep(0.5)
gpio.output(buz, 0)
record_video()
time.sleep(0.5)
except KeyboardInterrupt:
print("Done .......")
time.sleep(3)
gpio.output(led, 0)
finally:
exit(0)
Effects
The resolution of the capture is configurable. By default it’s set to the resolution of your
monitor, but the maximum resolution is 2592 x 1944 for still photos and 1920 x 1080 for
video recording. The minimum resolution allowed is 64 x 64. To set the resolution to max
use following method. Note that you’ll also need to set the frame rate to 15 to enable this
maximum resolution.
camera.resolution = (2592, 1944)
camera.framerate = 15
camera.start_preview()
sleep(5)
camera.capture('/home/pi/Desktop/Visitors/max.jpg')
camera.stop_preview()
camera.start_preview()
camera.annotate_text = "Hello world!"
sleep(5)
camera.capture('/home/pi/Desktop/Visitors/text.jpg')
camera.stop_preview()
lOMoARcPSD|27781631
To set the annotation text size with the following code. Valid sizes are 6 to 160. The
default is 32
camera.annotate_text_size = 50
To alter the annotation colors. First of all, ensure that Color is imported by amending
your import line at the top.
from picamera import PiCamera, Color
Then amend the rest of your code as follows:
camera.start_preview()
camera.annotate_background = Color('blue')
camera.annotate_foreground = Color('yellow')
camera.annotate_text = " Hello world "
sleep(5)
camera.stop_preview()
To alter the brightness setting, which can be set from 0 to 100. The default is 50. Try
setting it to another value.
camera.start_preview()
camera.brightness = 70
sleep(5)
camera.capture('/home/pi/Desktop/Visitors/bright.jpg')
camera.stop_preview()
To alter the Contrast setting, which can be set from 0 to 100. The default is 50. Use similar
to brightness
camera.start_preview()
camera.contrast = 70
sleep(5)
camera.capture('/home/pi/Desktop/Visitors/contrast.jpg')
camera.stop_preview()
You can use camera.exposure_mode to set the exposure to a preset mode to apply a particular
effect. The options
are: off, auto, night, nightpreview, backlight, spotlight, sports, snow, beach, verylong, fixedfps, anti
shake, and fireworks. The default is auto. Pick one and try it out:
camera.start_preview()
camera.exposure_mode = 'beach'
sleep(5)
camera.capture('/home/pi/Desktop/Visitors/beach.jpg')
camera.stop_preview()
Installation Manual
RFID stands for Radio Frequency Identification uses radio frequency to read information stored
in a RFID card or tag. Each card has a unique ID and this makes it a perfect choice for many
authentication applications. The RFID authentication systems are easy to design and are cheap in
cost. Interfacing RFID Reader with Raspberry Pi can be very useful as you can implement a wide
range of applications like:
Access Control
Authentication
e-Ticket ,e-Payment ,e-Toll
Attendance System
Hardware Requirements
1. Raspberry Pi Model 3 B/B+
2. RFID Reader (RC 522)
3. RFID Tags or Cards
4. Jumper wires (Female to Male)
5. Breadboard
Software Requirements
1. Raspbian Stretch OS
2. SPI Supporting Libraries
3. RC522 Python Library
Connect your RFID reader with Raspberry Pi's GPIO Pins.
RFID Reader
RPI Physical Pin Raspberry Function
Board Pin
SDA 24 GPIO8 (SPI_CE0_N)
IRQ UNUSED
GND 6 GND
Step 6: Install spidev to Raspberry Pi using pip. The spidev library helps to handle
interactions with the SPI
Step 7: Install the MFRC522 library using pip that helps talk to the RC522 module over
the SPI interface
Step 8: Write Python script which is used to write data from the RC522 to your RFID tags.
When you run script, it asked to write in the new data, in my case I am going to just type in msd
gurukul. Press Enter when you are happy with what you have written.
With that done, simply place your RFID Tag on top of your RFID RC522 circuit. As soon as it
detects it, it will immediately write the new data to the tag. You should see “Data Written
successfully” appear in your command line if it was successful.
Step 8: Write Python script which is used to read this data back off the RFID tag.
lOMoARcPSD|27781631
With the script now running, all you need to do is place your RFID Tag on top of your RFID
RC522 circuit. As soon as the Python script detects the RFID tag being placed on top, it will
immediately read the data and print it back out to you.
If you successfully receive data back from your read.py script with the text that you pushed to
the card using your write.py script then you have successfully set up your Raspberry Pi to
connect with your RFID RC522 Circuit.
Hardware Requirements
1. Raspberry Pi Model A/B/B+
2. SD Card
3. Ethernet Cable / Wi-Fi
4. Power Supply
5. USB Microphone
6. Speakers
Software Requirements
1. Raspbian Stretch OS
$ arecord -l
$ aplay -l
lOMoARcPSD|27781631
pcm.!default {
type asym
capture.pcm "mic"
playback.pcm "speaker"
}
pcm.mic {
type plug
slave {
pcm "hw:<card number>,<device number>"
}
}
pcm.speaker {
type plug
slave {
pcm "hw:<card number>,<device number>"
}
}
Replace <card number> and <device number> with the numbers you wrote down in the previous
step. Do this for both pcm.mic and pcm.speaker.
$ alsamixer
6. Play a test sound (this will be a person speaking). Press Ctrl+C when done.
If you don't hear anything when you run this, check your speaker connection.
$ speaker-test –t wav
lOMoARcPSD|27781631
Note that…
If recording and playback are working, then you are done configuring audio.
If not, check that the microphone and speaker are properly connected.
If this is not the issue, then try a different microphone or speaker.
That's all!!!
Thank you….
lOMoARcPSD|27781631
Installation Manual
The Google Assistant is a virtual assistant powered by artificial intelligence and developed
by Google that is primarily available on mobile and smart home devices.
The Google Assistant can engage in two-way conversations.
Hardware Requirements
1. Raspberry Pi Model A/B/B+
2. SD Card
3. Ethernet Cable / Wi-Fi
4. Power Supply
5. USB Microphone
6. Speakers
Software Requirements
1. Raspbian Stretch OS
2. Google Account
Note that…
If recording and playback are working, then you are done configuring audio.
If not, check that the microphone and speaker are properly connected.
If this is not the issue, then try a different microphone or speaker.
Once you have your Google account ready, go to the following web address.
https://console.cloud.google.com/project
The project creation process can take some time. You should receive a notification in the top
right-hand corner of the screen when it’s complete. If it doesn’t automatically appear after some
time, try refreshing the page.
Click on Save
lOMoARcPSD|27781631
15. Now Download the Credentials file for our newly created oauth credential.
2. Create a directory, and then Copy credential file (downloaded in previous step) to your
directory (with new name credentials.json)
3. Install Python3 and the Python 3 Virtual Environment to our Raspberry Pi.
$ source env/bin/activate
8. Now Install all the packages that we need to install the Google Assistant Library
10. To run the installed Google Authentication library, use following command.
This command will generate a URL, Right Click on above URL, Copy it.
You will need to go to in your web browser, Paste above URL in address bar.
On this screen login to your Google account, if you have multiple accounts make sure you
select the one you set up your API key with.
Click on Allow
11. Copy the authentication code and paste it back into your terminal and press enter.
lOMoARcPSD|27781631
12. if the authentication was accepted, you received a message credentials saved
That's all!!!
Thank you….
lOMoARcPSD|27781631
Hardware Requirements
Raspberry Pi , SD Card
LED
Bread Board
Jumper Wires
Power supply
Ethernet Cable / Wi Fi
Monitor , Keyboard, Mouse
Software Requirements
• Visual Studio 2015 / 2017 (Community Edition - Free) with Universal Windows Platform
Development component installed.
Circuit Explanation
Connect LED to Raspberry Pi
lOMoARcPSD|27781631
• Open Visual Studio 2015/ 2017 installed in your Laptop / PC with Universal
Windows Platform Development component.
• Create a New Project and add some code in it.
• Execute this Project on Raspberry Pi as remote machine.
using Windows.Devices.Gpio;
namespace LED_Blink_win
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page
{
private int red_state = 1;
private const int RED = 4;
private GpioPin redPin;
public MainPage()
{
this.InitializeComponent();
InitGPIO();
}
}
}