Wednesday, April 20, 2016

Some more Video's of Cisco95 in action

Cisco95 moving and detecting faces


Cisco95 camera movement using tower pro micro servo camera mount

Future Goals:
My next goal is to combine the Gstreamer and OpenCV and make them work parallel to each other. I also want to make the robot autonomous.

Monday, April 18, 2016

Cisco95 moving with live stream and Connecting Rpi to laptop


The above clip shows the Cisco95 moving by following the commands and also giving the live feed on my laptop.

I connected my Rpi to my laptop using the remote desktop connection on my laptop. I used my Iphone's hotspot while connecting my pi and i am gonna keep using my hotspot when ever i use my pi connected to my laptop so that the IP address of my pi doesn't change ever time i login in different WiFi settings.

Steps to connect my Rpi to laptop:

1. Turn on your pi, your laptop and your personal Hotspot in your Iphone.
2. Connect your pi and laptop to your Hotspot by selecting your iphone from the WiFi settings on your laptop and your pi.
3. Enter the password when asked.
4. when all the desired devices are connected to personal Hotspot, type the following command in your pi terminal for the IP address:


Your IP address should be in the spot where there is a number highlighted with yellow highlighter.
5. Go to your Laptop, open the remote desktop connection and connect your pi to your laptop by typing your pi's IP address where it asks for computer and click connect.
6. Turn off the pi and turn it back on and see if the IP address is still the same. It should be the same anytime you connect your pi to your personal Hotspot.


Tuesday, April 12, 2016

Motors

I made the robot turn a 360 for starters: one motor moving forward and the other one moving backward.



I used a python code to make the robot go forward, reverse, left and right using specific keys on the keyboard. I also combined the distance finder code with the motors code to make the robot sense the distance every time i press a key for it to move.



Cisco moving forward, reverse and right:
Circuit design from Fritzing:


Tuesday, March 29, 2016

Building the robot

I built a compartment on top of the rover which stores the battery, breadboard and motor drive controller board. I used a cardboard box and made wholes on the top and sides for the wires to pass through. I screwed the cardboard box to the rover on the bottom.



Use Of Ultra Sonic Range Finder

I used the Ultra Sonic Range Finder to help the robot detect the obstacle.
I connected the sensor to my Rpi using the bread board, 2 resistors (1k) and some male to female jumper wires. I also wrote the below code that detects the obstacle and outputs the distance from the sensor to the obstacle.

Circuit design from fritzing:

The below is the circuit design i used:


The above code gives the following output:

Thursday, March 24, 2016

Using Gstreamer and OpenCV

After the installations i just typed the following command in the terminal which gives the live stream on the monitor using Gstreamer:

raspivid -n -w 960 -h 540 -b 4500000 -fps 8 -vf -hf -t 0 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! omxh264dec ! videoconvert ! ximagesink

I wrote a python program using the OpenCV which detects the face and takes a picture of it. I included the above command in the python file to give the live stream and use it for facial detection.

Monday, March 14, 2016

Gstreamer and OpenCV Installations

I installed Gstreamer and OpenCV in my raspberry pi for the video surveillance and facial detection:

I got the code for OpenCV from:
http://askubuntu.com/questions/537268/installing-opencv-in-ubuntu-14-04

The following link have a data for the xml file:
https://raw.githubusercontent.com/shantnu/webcam-face detect/master/haarcascade_frontalface_default.xml

For Gstreamer installation:
sudo apt-get install gstreamer1.0

For OpenCV installation:
version="$(wget -q -O - http://sourceforge.net/projects/opencvlibrary/files/opencv-unix | egrep -m1 -o '\"[0-9](\.[0-9])+' | cut -c2-)"

echo "Installing OpenCV" $version
mkdir OpenCV
cd OpenCV

echo "Removing any pre-installed ffmpeg and x264"
sudo apt-get -qq remove ffmpeg x264 libx264-dev

echo "Installing Dependenices"
sudo apt-get -qq install libopencv-dev build-essential checkinstall cmake pkg-config yasm libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils ffmpeg

echo "Downloading OpenCV" $version
wget -O OpenCV-$version.zip http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/$version/opencv-"$version".zip/download

echo "Installing OpenCV" $version
unzip OpenCV-$version.zip
cd opencv-$version
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
make -j2
sudo checkinstall
sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig
echo "OpenCV" $version "ready to be used"

Sunday, March 6, 2016

Some other things needed for rover

I ordered the following things for motor power on amazon:
ON/OFF Switch Black 4 x 1.5V AA Batteries Holder Case Storage Box:



L298N Dual H Bridge DC Stepper Motor Drive Controller Board Module for Arduino, Raspberry Pi, and other microcontrollers:



Thursday, February 25, 2016

Picamera

I started working with my Raspberry pi 2 camera and during my research i found the following websites very useful:

--> how to connect camera to pi and how to unable camera and also have options like Shell (Linux command line) or Python for writing the commands. I used Python.

--> quick start guides on Picamera and some simple commands in python.


http://picamera.readthedocs.org/en/release-1.10/
--> some examples on how to use camera on raspberry pi using python

I wrote a program in python that streams the video on the monitor and also takes the number of images users enters and takes 15 seconds break between each pictures. You can also extend the break time.






--> My step is to live stream the video to my raspberry pi and the face detection.


Monday, February 15, 2016

About Cisco95

My main intention to begin the blog is to keep track of my goals and things while I am building a robot (Cisco95) that can be operated by using my laptop. It can be used as video surveillance which gives the live stream on my laptop. It should also have a facial detection ability to.

My First steps:

I bought a rover kit, a camera and a range finder sensor.
      I am going to implement the camera and make the rover move in the next few days using the raspberry pi 2.

Rover kit:
          Small and inexpensive robot kit with a 30mm wide x 6mm high gap in the top support plate specifically for a RobotShop 3.7V, 1000mAh LiPo battery.

Ultra Sonic Range Finder:
    Power supply: 5V DC
    Ultrasonic Frequency: 40k Hz
    Resolution: 1 cm

IR Camera:
    A native resolution of 5 megapixel
    Smooth connectivity and live picture.




Morse code LED

For my Morse code LED project I wrote a code using python in raspberry pi that lets user enter a message in English and turns it into Morse code and prints it out in the terminal. The code also lets the LED in the LED circuit in the breadboard blink according to the Morse code.


The following is the GPIO pinout chart that helps wire GPIO pins in the raspberry pi:

The following is the Layout of my LED circuit:



The code that i implemented in python file:




The Demo:




Sunday, February 14, 2016

First Project

For starters I did the LED blinking project. I made the LEDs blink 3 times in a row.
Items needed:
 Raspberry pi
 Bread board
            Jumper wires
            Bread board wires
       LEDs (different colors or same color)

GPIO pinout chart:


The bread board circuit set-up for the LED blinking project:




To ensure the system has latest version of software, run the following commands in terminal: 


Create a python file named ‘quadled_blink_single.py’ on Raspberry pi and type in the following code and save it:



After that open the terminal and type:

Wednesday, January 27, 2016

Pi setup and basic commands

As soon as you connect your HDMI to the TV/monitor and insert your os installed MicroSD card into your pi you should see the following screen on your TV/monitor:

You can select the os of your choice and click on install. It takes few minutes to install and then the following screen appears:


The above screen is the graphic user interface, The default login for Raspbian is username pi with the password raspberry.
After logging in the following desktop screen appears:

You can click on the LXTerminal and type the following commands in console:
sudo apt-get install rpi-update
sudo rpi-update
sudo reboot


After rebooting, type the following commands in console:
apt-get update
apt-get upgrade

The following are some of the basic commands:
list files in current directory:                                                ls
list files (including hidden files) in current directory:           ls -a
change directory:                                                                cd
change to home directory:                                                  cd ~
change to root directory:                                                     cd /
change to different directory:                                              cd music
print working directory:                                                       pwd 
make directory:                                                                   mkdir
copy files:                                                                            cp 
move files:                                                                           mv 
remove files:                                                                        rm 
remove directory:                                                                 rmdir 
clear screen:                                                                        clear 
display a file:                                                                        cat 

Saturday, January 23, 2016

selection and setup of operating system

How to set-up your Raspberry pi:
1.     Begin by slotting your SD card into the SD card slot on the Raspberry Pi, which will only fit one way.
2.     Next, plug in your USB keyboard and Mouse into the USB slots on the Raspberry Pi.
3.     Make sure that your monitor or TV is turned on, and that you have selected the right input (e.g. HDMI 1, DVI, etc)
4.     Then connect your HDMI cable from your Raspberry Pi to your monitor or TV.
5.     If you intend to connect your Raspberry Pi to the internet, plug in an Ethernet cable into the Ethernet port next to the USB ports, otherwise skip this step.
6.     When you are happy that you have plugged in all the cables and SD card required, finally plug in the micro USB power supply. This action will turn on and boot your Raspberry Pi.
7.  My MicroSD card is pre-loaded with NOOBS into it. If you don’t have a pre-loaded MicroSD card then go to www.raspberrypi.org/help/noobs-setup to set up.

     As i stated above I had NOOBS operating system(os) pre-loaded into my SD card but there are different operating systems in https://www.raspberrypi.org/downloads/ which you can try to download but NOOBS is an easy operating system installer compared to the rest.

Saturday, January 16, 2016

Introduction

Purchased Raspberry Pi 2 Model B starter kit on amazon.com which Includes:
1.) Raspberry Pi 2 Model B Quad-Core 900 MHz 1 GB RAM with heat sink
2.) 8 GB Micro SD Card (consider 16GB, 32GB or more) optional: pre-loaded with NOOBS
3.) USB power supply (at least 2.5A)
4.) WiFi Adapter (dongle)
5.) HDMI cable.