Tuesday, October 21, 2014

Final Year Projects

I got an email from a student regarding her idea for a final year project. I gave her a detailed reply and thought sharing this may help guide other students so here goes...

My name is XXXX. I'm writing to have some guidance from you, for my final year project. I obtained your email address from the XXX university website.
Sir I’m doing my final year project; the topic of my interest is brain controlled wheelchair. I need some direction for the topic I have opt. What novel can I do in this area?
I also need to ask that is it the best choice or should I go for something else? What else do you suggest for this area?
Thank you Sir.

Respectfully,
XXXX
Student Of BS(CS)
Fatima Jinnah Women University

And here is my reply that I hope may prove useful for other students.


Questions that you should ask yourself first
In the first part you have asked for direction on your idea brain controlled wheel chair. It is an interesting idea though in no way is it novel. Just a simple search on Google will list a number of such projects done before including a complete instructable (http://www.instructables.com/id/Brain-Controlled-Wheelchair/). I have seen students do this same project in Pakistan as well (I remember seeing one in Islamabad at FIT). So the questions that you should be asking yourself when deciding on an idea to work on is

Q. Why do I want to build this?
Q. Does it solve a particular problem or need?
Q. Would it be practical enough to be used in Pakistan (For example Are the EEG Sensors easily available locally or easy to re-produce locally)
Q. If I made one, would it be cheap enough that people would be willing to buy it?
Q. Would it be practically usable? How much getting used to would be required by someone if that someone decides to use it?
You will notice that in the question list, I haven't listed down a single technical question or challenge. When you work on idea, you usually build a prototype first to prove your point that the idea is possible. In this particular case we know that the idea is possible and people (read students) have built it quite a few times, but we haven't seen it as a commercial product just yet. So the question comes down to whether it would be really useful to build a brain controlled wheel chair in the Pakistani context.
The second part of your question is more general as to what kind of final year project should you be working on. The answer that I'm giving you is the discussion that I have with my students.
Research based versus non-research based projects
There are 2 kinds of projects. Research based and non-research based. At under graduate level most students go for non-research based projects which are mostly practical in nature. Those who are interested in research based projects are usually who plan to go for a Masters degree by research or a PhD later. So the first question that you should ask yourself is what excites you? Doing research which involves reading research papers, understanding analyzing and implementing them (in probably Matlab) and coming up with your own improved techniques or algorithms in a particular area. Or building a project which involves less research and more practical stuff like understanding new programming libraries or algorithms and implementing them to solve a problem.
Choosing the right supervisor
Once you decide for a particular area you must select a supervisor who most suits your project and your area. For example if you want to do a research based project, find a supervisor with a PhD. If you want to do a more practical project find a supervisor who has worked in the industry or has worked on practical projects.
Hardware versus Software
If you decide to build a project that is mostly software  then you must see if you have access to the right development tools. For example most Pakistani universities are part of the Microsoft Academic Alliance which gives them access to most Microsoft development tools. If you plan to use a particular library that is not freely available, can you get an academic free version for it? Or can you find an open source alternative for that library?

If you are planning to build a hardware project, there are some important questions to consider. In most cases hardware is unavailable locally, although there are now a number of local websites that offer microcontrollers and electronics parts. Here is a list:


You may also need 3d printing to build your hardware prototype, in this case you can get your stuff printed from  https://www.facebook.com/3DPrintingPK or if you can convince your university or have the finances you can get a 3d printer in Pakistan from http://xplorer3d.com/.

Funding your project
One of the most important aspects that you must consider before going for your idea is to figure out how you are going to finance your project. There are many ways to fund your project.
 
1.    1.  National ICT R&D fund runs a program (http://www.ictrdf.org.pk/ngiri/main1.htm) where they finance innovative FYP ideas, mostly for buying hardware. You can get up to Rs 65000 in funding. Usually the fund takes a long time to release funds so be prepared to spend from your own pocket initially if you plan to take this route.
2.    2.  Another way is to find someone willing to fund your idea. There are several companies in Islamabad, Lahore and Karachi willing to work with Final Year Projects. The key is to find a company that works in your area of domain and would be willing to work with you. A good idea is to find someone from the faculty who knows people in a company you are looking for. Most faculty members have friends and colleagues working in local companies.
3.   3. The third way is to fund your project yourself.  In my case I wanted to build a robot which required considerable finances in buying stuff and getting things done. I solved this problem by convincing my friends to work with me and ended up with a group of 5 students. It helped me in sharing the costs and we managed to spend more than 50,000 on our hardware and manufacturing. Be careful though, most universities usually only allow a maximum of three students per group.

Finding the right idea?
One of the key questions is to understand what kind of idea you can work on. Final year project is one of the most important activities in your undergraduate studies that can define your future direction. So the decision should be taken very wisely. If you plan to go for a Masters degree and are good at reading papers then find a research based project. If you plan to work for a company even then you can do a research project or vice versa. There is no fix path. For example a student of mine did a research based project on data mining and started working at IBM (Islamabad) in the Business Intelligence (BI) division. After working for a couple of years at IBM he has now gone for his Masters in BI.

When students come to me and ask for advice regarding projects, I usually tell them to find a problem to solve or a need to fulfill. So how does one go about finding a problem? I have devised a top down approach to finding the right problem to solve.

The key is to think big! Ask yourself what kind of problem can I solve in the universe? Can I create an algorithm to enable fully autonomous operation of the Mars Rover? If you think that is too farfetched then narrow down your search. Think of what global problem can you solve. Have you ever looked at United Nation’s Millennium Goals that address global issues? There are many competitions as well (ITU Young Innovator’s Program) that encourage one to solve global problems using Information and Communication Technologies (ICTs). If you still can’t find a problem then look for a local problem to solve. Think of the problems that face Pakistan today. Poverty, lack of education, lack of health facilities, etc there are practically thousands of problems to solve. So choosing to solve one can benefit everyone. Finally if you still haven’t found a problem to solve then look around you? Can you find problems where you live or on your university campus? Can you automate a certain process that could make life easier for students? For example every university has a tedious clearance process through which each student has to go through once he/she graduates wasting everyone’s time and energy! Can you somehow automate this problem? There are once again plenty more to solve.

Finally one way to find ideas is to read, read and read a lot. Read about things that interest you and you’ll surely get ideas for your final year project. And once you find an idea, then discuss it with your peers, your faculty and even your parents. Feedback helps refine ideas and everyone will give their own perspective which will help in improving your idea!

Good luck in finding the right idea for your final year project. Feel free to email back if you have further questions.
Best Regards,

Wednesday, July 16, 2014

Pygame example (Window, Sound, Key handling)

Here is a small introductory example for pygame. In it we can learn to initialize pygame, create a window, display an integer as text on the screen and play sounds.

Pressing the key a will increase the score by 5 and update the value of the integer on the screen and also play a tick sound. Meanwhile the Mario soundtrack will keep running in the background.

You need to have at least python 2.7 with pygame installed.   

------------------------------------------------------Example --------------------------------------------
import pygame, sys
from pygame.locals import *

pygame.init()
DISPLAYSURF = pygame.display.set_mode((400, 300))
pygame.display.set_caption('Hello World!')

WHITE = (255, 255, 255)
GREEN = (0, 255, 0)
BLUE = (0, 0, 128)
score=27

fontObj = pygame.font.Font('freesansbold.ttf', 32)
textSurfaceObj = fontObj.render(str(score), True, GREEN, BLUE)
textRectObj = textSurfaceObj.get_rect()
textRectObj.center = (30, 20)

pygame.mixer.music.load('mario.wav')
pygame.mixer.music.play(-1, 0.0)

while True: # main game loop
     DISPLAYSURF.fill(WHITE)
     textSurfaceObj = fontObj.render(str(score), True, GREEN, BLUE)
     DISPLAYSURF.blit(textSurfaceObj, textRectObj)
     for event in pygame.event.get():
         if event.type == QUIT:
             pygame.mixer.music.stop()
             pygame.quit()
             sys.exit()
         elif event.type == KEYUP:
                 if event.key==K_a:
                     soundObj = pygame.mixer.Sound('beepingsound.wav')
                     soundObj.play()
                     score= score +5
     pygame.display.update()

Wednesday, May 28, 2014

In car computing

I've been fascinated by the mp3car.com community which started off by simply installing computers in cars and has evolved over the past few years into a place where you can buy a complete car PC to install in your car which runs as smooth as any plug and play device. No need for 12V to 220 V inverters, no need for extra screens, complete in car PCs are available that anyone with basic knowledge of electronics can install in their cars.

As usual with everything else in Pakistan, getting these systems is expensive and definitely unaffordable for me. So I wanted to install something that did not require a lot of tinkering with my cars electronics and would give me everything that an in car PC has. When the Raspberrry PI a $35 Linux computer came out I got very excited and ordered one. I also used it to develop a product prototype for a company. The one I bought was simply lying around unused so I installed it as my Carputer! 

I have installed a touch screen windows XP based handheld computer (UMPC, an ultra mobile PC, these were popular before the iPad came out) before in my car. The problem with this is it takes too much time to boot into Windows and even shutting down takes time. Refer to the following picture. 

It was never the perfect solution. I needed something that was quick to boot and quick to shutdown. I also changed my car from my CJ-5 jeep to a modern honda city sedan. This car belonged to my father who had changed the stock stereo to a chinese made touch screen based system that includes a DVD player, Radio, USB input, a TV and Aux input. It lacked a GPS and any navigation software which is bad.

Since I had a Raspberry PI lying free, I decided to install that in my car. The car already had a screen that had an Aux Audio/Video port that I was using up till now to connect my iPod shuffle. In order to use the PI as a multimedia device, Raspbmc is a great piece of software which is a port of XBMC for the Raspberry PI. I followed the following steps to install the Raspberry PI in my car.

Step 1:Download raspbmc from http://www.raspbmc.com/download/ 
 
A setup file can be downloaded for Windows 7/8 which can be run to install Raspbmc on an SD card. This is the route I followed. I used a 4gb sd card which was formatted by the setup. 
 
Step 2: Connect the SD card in the raspberry PI and connect it to a network
 
I did this by connecting the Raspberry pi to my TV  and let it run. It took about 30~45 minutes to download the Raspbmc from the internet and install it on the SD Card. The setup is completely automated so no intervention was required and in the end the system was running Raspbmc. 

Step 3: Add media to your USB device 

I added some sound and video files to test

Step 4: Install it in your car

This step turned out to be the most easy one and that took the least possible time. Since my Aux port in the stereo was readily accessible through an extended Audio Video cable, all I needed to do was connect the video and the audio ports to my Raspberry PI which was enclosed in a 3d printed box. Two pieces of paper tape at the back of the casing and the PI readily stuck to the carpet beside the center console, easily hidden and out of sight. I powered the PI using my 12-220v inverter which outputs 220 v as well as 5v through a USB port. A simple turn of the car keys and the Raspberry PI booted into XBMC within 20 seconds. I've connected a mouse to interact with the XBMC. 

Step 5: Improvements

Some of the improvements that I plan to make include
  • IR Remote interface with the PI, which will help me do away with the mouse
  • Internet connectivity using either PTCL's evo dongle or using my mobile's internet as a hotspot. In this case I will need a USB wifi adapter for my PI.
  • I have a warid connection and my phone is not 4G so I'm waiting to see whether I should be porting to a 3g network.
  • Touch screen. Maybe when I have enough money to spare, I would like to replace my existing touch screen with a one that is compatible with a Raspberry PI
Enjoy the pictures!







 

Saturday, May 17, 2014

3d Printed Arduino Robot

After discussing for months and brain storming different ideas on how to develop a locally made robot that can be used by teachers like me to teach, students to learn and researchers to experiment with, we've managed to make our first 3d printed mobile robot. For start we took a design from thingiverse and got it 3d printed. We added an Arduino, did some programming and it turned out pretty good.   

The main idea behind this is to have affordable "Made in Pakistan" robot kits that are affordable by everyone. We have a few research labs that have the latest in robots such as the NAO humanoid, the People bot and other kits. Unfortunately these have been acquired after spending large sums of public money or donations. What we wanted was to start making robot kits that can be used by not only these research labs but but by high school kids, college students and hobbyists. This mobile robot is a first in that series. We will also be developing quad copters, humanoids and other forms. 

This mobile robot at this stage has the following features:

- 3d printed design
- An Arduino Mega 2560 microcontroller
- A Sonar Sensor Module
- A bluetooth Module
- Completely hackable design

Here are images and video of the developed robot kit







Monday, May 12, 2014

3d printed parts have arrived

For our mobile robot for teaching and learning, we got the 3d printing done from our friend Syed Ali Ahsan in Karachi. Ahsan bhai runs the facebook page 3d Printing Pakistan and is a wonderful guy. He is very supportive and not only prints but guides people if they need help. This robot was also printed by him using his deltabot 3d printer. In the previous post we had a look at some of the videos that he sent us of the parts being printed. Today we received the parts in Islamabad. Exciting times! Here are some pictures of the 3d printed parts

The Package!

Everything wrapped in plastic bags

Part of the base

The other side

All the 3d printed parts

Here is a video of unboxing my 3d printed parts. I will soon be uploading more material when we assemble the robot and make it work.



Saturday, May 10, 2014

Building a Mobile Robot for teaching and learning


In my lab I'm developing a mobile robot for teaching and learning. The idea is to have a 3d printed small programmable robot that students can play with to learn programming, electronics and robotics! Following is a part of the base that is being 3d printed. Following is a link to the video of 3d printing one of the parts of the robot. I'll be sharing some more pictures and details about the design. The 3d model is from thingiverse and I haven't designed it. We will use this design as a starting point to design our own robot.

http://tune.pk/video/2857856/3d-printing-of-my-mobile-robot