Monday, January 25, 2016

Week - 1

NOOBS OS installation in Raspberry Pi:

   I will explain my first experience with Raspberry Pi. I got my kit, opened it and took out all the different things from box. I understood most of things that are included in the box and their functionality. I started reading first 2 chapters from users Manuel understood history, purpose, basic organization, usage of Raspberry Pi. Installed NOOBS operating system in Raspberry Pi. Procedure for installation:

Equipment:

Raspberry Pi kit
HDMI Monitor
Keyboard and Mouse
SD card with NOOBS OS

Procedure:

   Connect the Raspberry Pi kit to TV/Monitor using HDMI cable, insert SD card into the kit. Connect power cable and turn it on. Screen will be displayed with options, select first option which is Raspbian for NOOBS os installation. It will take a while for installing os, after 100% procedure is completed it will display Finish message on screen. Enter startx command and give username and password to get GUI for current os. This will take you to Graphical User Interface which means installation is completed.

How to connect to WIFI???

   Connect WIFI dongle to Raspberry Pi. You can see the network connectivity symbol on the right top of the screen. Select the option, we will get the list of all the available connections, connect to WIFI by entering the password.


Remote desktop connection for Raspberry Pi:

    I used very interesting and simple protocol "XRDP" for remote desktop connection. 
Install package in Raspberry Pi by following command: sudo apt-get install xrdp

    First we need to find Physical address of Raspberry Pi so that we can find out IP Address from windows system and connect to Raspberry Pi using remote desktop connection. 
We can search IP address for corresponding Physical address using command: arp -a 

    Open Remote desktop connection from windows and enter IP address obtained using Physical address. This will take you to login page where you have to enter username and password this will take to Raspberry Pi GUI on the windows system.





Experiment 1:

Standalone light and Blinking light

Equipment:

Raspberry Pi kit
1 LED
1 330 ohms Resistor
Connectors
Breadboard

    Connect the T board on the breadboard and make connection in such a way that LED, resistor, Raspberry Pi are all connected in series. Pic below shows all the connections. Used GPIO2 and Ground pins for connecting LED output pin and the other circuit. I followed instructions from chapter 7 and made connections. This is very easy to do the setup. I did this successfully, finally I was able to programmatically make the light blinking. 




Experiment 2:

3 LED lights whose frequency of blinking can be changed by push down button 

Equipment:

Raspberry Pi kit
3 LED
3 330 ohms resistor
Push down button
Connectors
Breadboard

   Connect 3 LEDs with same GPIO and different resistors, connect one push down button to the breadboard. In this experiment we will read input from button and then change the blinking frequency of the lights. This is a process of taking input from user and changing the frequency of output. By default LED will blink at a frequency of 0.25 seconds. When the button is pushed down then the blinking frequency will increase to 2 seconds. Till you keep pressing the button output will remain same. Once the button is released again the frequency changes to 0.25 seconds. This remains blinking until the program is interrupted. Attached code of project.






Code :

import RPi.GPIO
import time
RPi.GPIO.setmode(RPi.GPIO.BCM)
RPi.GPIO.setup(2,RPi.GPIO.OUT)
RPi.GPIO.setup(3,RPi.GPIO.IN, pull_up_down=RPi.GPIO.PUD_UP)
while True:
    input_state = RPi.GPIO.input(3)
    if input_state == True :
        RPi.GPIO.output(2, True)
        time.sleep(0.25)
        RPi.GPIO.output(2, False)
        time.sleep(0.25)
    else :
        RPi.GPIO.output(2, True)
        time.sleep(2)
        RPi.GPIO.output(2, False)
        time.sleep(2)



Internet of Things


    In this nature surrounding us, the moment which happens elsewhere decides the fate of the another moment elsewhere. Everything is interlinked. So do happen everything in internet of things. You are in your workplace operating light or fan at your house, decide your route before you start to place based on time and distance, water your plant on time wherever you are. All these things explain how versatile Internet of Things could be. I have great interest in developing application which have real world interaction. Internet of Things gives me an opportunity to learn and explore how useful applications could be made. I am curiously looking forward to learn programming with sensors and develope an application which I can use in daily life. It's fascinating to learn how cloud server could be built and manage data using Raspberry Pi and Arduino.

    I will be posting my assignments and projects in this blog for course "CSC-9010" "Internet of Things" at Villanova University under the guidance of professor Dr. Paul Schragger.