Thursday, December 11, 2014

A Browser Based Open Sourse Presentation tool

What is the software package you would use if you want to create a presentation.The traditional answer is Microsoft Office Powerpoint or LibreOffice Impress. Most of the general public (In Sri Lanka) still even do not know about Prezi.com. Using Prezi.com you can create awesome presentations. Since my topic is not about prezi in this article,You can visit www.prezi.com and learn more about prezi. 
The idea behind the prezi presentations is innovative. It has changed the traditional image of presentation, and has made  every step of the presentation special and interesting. But you have to pay for their service.
There is no program in the world that would make a developer happy, unless it is open source. There are plenty of open source  presentation tools developed by the community which are very similar to Prezi. some of them have more powerful tools than Prezi. But they do not provide a fancy user interface nor user friendly unless the user is a developer. But gain ultimate control  of all of your presentation. "reveal.js" and "impress.js" are   two examples for these kind of open source tools.
Impress.js has been developed by Bartek Szopka. You can fork his impress.js repository from github. From the demo you would see how smoothly, impress.js handles the transformations. Bartek has mentioned every drop of information that you need to know in the source code. If you read html, javascript and css files you will understand most of them. How ever I am going to summarize everything. I will not explain the code in detail but the abstract method of making presentations. Please note that I am not an expert in making impress.js presentations I am only writing this to share my experience with you.
Before you make your first presentation you have to break down the ideas in to steps. Yes! exactly in the way how you break down your steps to make slides in Libre office . The slide like objects in impress.js are called "steps". You can place these steps anywhere in the canvas 3d space.Every step should be marked in a separate HTML division. You should assign the class "step" to corresponding <div> element of each step. To position the each step in the canvas we use "data-x", "data-y" and "data-z"   parameters. Using "data-rotate-x", "data-rotate-y" and "data-rotate-z" we can rotate the text appearance in the canvas around x,y and z axes respectively. One other thing, you should use "data-scale" parameter to specify the scale of the whole step element compared to another one. A step will look like this
<div id = "test-div" class = "step" data-x = "1000" data-y = "2000" data-z = "0" data-rotate -x = "0" data-rotate-y = "0" data-rotate-z = "0" data-scale = "3">
      <h1>Hello Impress</h1>
</div>
As always it is very handy if you use a separate css file to style your presentation. Try this out and wish you good luck.

Sunday, September 21, 2014

A home made PCB

I know that you can find hundreds of video tutorials on "how to make a pcb". But I thought it is worth to share my experience in pcb making with you. Specially it will useful for Sri Lankans. I will not discuss about designing a pcb in this article. This is all about after you designing the pcb.

This is the Printed Circuit Board designing that I want to be etched on a Copper board. It is a small circuit I designed using Proteus.


Next, you have to print the bottom copper layer of  designed PCB layout. If you have a laser printer at home you can directly print the bottom copper layer to a "Art Paper" . I you don't have a laser printer print this layout  to a pdf file using a pdf printer such as "Foxit reader PDF printer". In printer setup  select monochrome paper to get the black and white output and set the size as A4. Why we should print it on a pdf  file?? because using PDF we can get the actual dimensions of the circuit on the printed paper. This is a image of the output PDF file. You should  not mirror the layout.Just print the top view of the circuit. Then you will get a output like this.


If your PDF reader can edit pdf files, make a copy of this circuit object and past on the paper so that you can get multiple circuits on the same paper. It is about getting the maximum profit out of the money you spend. My pdf file has not the editing facility. So I gave the file to a friend and he gave me the following file.



Now you have to take this to a print shop and ask them to print this. It is better if you can get the circuit printed on a none sticking paper of a sticker paper(The yellow color useless paper that you throw away after sticking a sticker not the sticker paper). How ever print shop owners do not like to print on this paper because some times the paper sticks inside the printer. You are lucky if you can find a place where you can get the job done. If the print shop guys do not agree to print on do not worry... tell them to print it on a "Art paper". Please mention them that you want it to get printed using a laser printer. It would cost Rs 20 to get a print on a A4 size art paper, around University of Moratuwa. 
Now you have to prepare the copper board for the ink transfer process. First cut the copper board according to the dimensions of the circuit. I used a piece of copper board which is sufficient to print two circuits on it. This is it



Before you do anything you have to clean the board in order to get rid of the oxide layer. To do this, use a Aluminium scourer or a smooth sand paper to brush out the surface. This is the one I used.



 Adding little bit of oil cleaning soap (like Vim) will make the job easy. 



Brush the surface thoroughly until you get a nice shiny surface. Like this..


Now you are ready to transfer the print to the copper board. Following image shows the prepared PCB layout which was printed on a paper, cleaned copper board and Iron.


Lets begin the process. 
Heat the cleaned copper board couple of minutes.



Then  place the printed paper properly on the copper board



while you put some presure on the Iroioius, Iron the surface for couple of minutes. If the paper stuck on to the copper board, stop Ironing and spay or add some water using wet cloth to the surface. 


If you Iron properly you will see every and each connection paths stuck on to the surface as in following image. 


If any line is not properly sticked on to the copper board, Iron until the stick in to the board. Then add more water on the surface of the paper, and remove the paper carefully. If It is properly Ironed, you should be able to remove the paper without an effort. This is the what I got after the process.



It is very difficult to get a fair result at first time, you should try couple of times if you could not able to transfer the ink properly on to the copper boar. Inspect the circuit properly and check if there are any defect. If there are any, repair them with a permanent marker. Following image shows the copper board after I repaired the broken lines using a green permanent marker. 



Now it is the time for ferric chloride, 
add some water to a plastic basket which is slightly larger to the piece of copper board. You should never use a metal basket for this. Then add some ferric chloride powder to that basket. 



Put the circuit in to the solution and wait for 10 to 15 minutes. When exposed copper areas are disappeared, take the circuit board out and wash it properly. This is the circuit I got.



Now let us begin the finishing part. Cut the edges using a PCB cutter



Then you get a nice PCB as the one in following image.


Now washout all the ink using thinner of by rubbing an Aluminum scourer.



Drill the holes on the shiny PCB and Solder the components.....


Enjoy...

Enabling a Theme on Ubuntu

Personally I love dark themes. You Know it is always easy and comfortable to work with a dark high contrast environment in a computer, for a developer. In Ubuntu, you can use Dark themes for this purpose. In order to install a theme, you have to install "Unity Tweak Tool" first from Ubuntu Software Center or runiing following command on your terminal

 sudo apt-get install unity-tweak-tool

In this article you can find a list of themes and commands for install them. following commands are for installing Ambiance-Dark theme.

  1. sudo add-apt-repository ppa:noobslab/themes
  2. sudo apt-get update
  3. sudo apt-get install ambiance-dark
 
But after executing first command if you are getting an error as following screenshot, most probably you are using a proxy server.



There are two ways to get rid of this issue

The lazy mans way

  1. Connect to a non proxy network, you can use a dongle or any other none proxy connection to this.
  2. Run the first command.
  3. If you have no data usage problems, run remaining two commands in while you connected to the same network, Otherwise connect again to the proxy network and run the remaining two commands.

The real way

In this this article you can find the real way.

I use my University's free wifi network which uses a proxy server whenever it is possible because I have a limited data quota in my mobile broadband package. Using any method mentioned above, you can save your data and your money.

Enjoy....

Friday, September 5, 2014

The Line Follower

A Ball Picking Robot Using PIC 16F877A


Actually this project was a group project. Our task was to build a line following ball-picking robot while keeping the budget below 5000 rupees. If you consider the cost for the parts, it wont exceed that limit. But , for testing and rebuilding it would cost more than that.

Details of the track and  capabilities of the robot

• The robot was expected to operate on an MDF board, approximately 7 ft long and 3.5 ft
wide.
• The surface of the board was painted in black, and a white curvy line (about 2” wide)
was drawn against the black surface.
• A tennis ball was placed at one end of the line and there was a hole at the other end.
An obstacle was placed somewhere on the line.
• Robot was  placed on the white line, near the end where the ball was placed. It moved towards the ball, detected it and grabbed it.
• Then it moved along the line towards the hole, avoided the obstacle, detected the hole
and droped the ball into it.
• The robot was fully autonomous .

Following figure give you more details about the track.



Design and Implementation

We have designed a circuit using Proteus. Our first board was not very successful but the second one was very.

circuit diagram













Printed Circuit Board Layout














Power Supply
We separated a used laptop battery cells and used 6 of them for the power supply . The whole robot was powered by these batteries



Sensor Circuit
The purpose of the sensor circuit is to identify the path that should be followed. 8 IR sensors (FGK 125) were used in the sensor panel but at the time of demonstration only 4 sensors were in a working condition. We have used another 8 IR LEDs to increase the IR signal.
  The black colour absorbs the IR and white colour reflects it. So when it identifies higher amount of IR it tends to follow the current path. When the robot senses a lesser degree of IR it deviates from that path to the previous one.

Motor Control Unit
The motors of the wheel are controlled by the on-board motor control unit.
We designed a separate circuit for driving the ball picking unit. It is shown below. All motors are driven by L 293-D Motor driver IC.

The circuit diagram of Motor driver of the ball picking unit


The Printed Circuit Board layour of Motor driver of the ball picking unit


Obstacle Detecting Mechanism
 We have used Sonar sensor to detect the tennis ball and the obstacle. We used a simple switch to detect the whole

Item
Quantity
Pic16F877A   
1
180rpm Gear motor with wheel
2
7805 regulator  
2
LM324 IC
2
L293 motor driver
2
In4001 diodes   
8
50k pre-set
9
Vero board
1
Circuit wire
5m
Castor wheel    
2
IR sensor with IR LED
8
IR LED
8
Sonar Sensor
1
Small motor(30/=)
1
1.5 Li Ion Laptop batteries
6




The Final Outcome

At the final demonstration the ball picking unit did not work. But i followed the line smoothly. The reason for the fault of the ball picking unit was the L293 motor driver. It was burned. This is a picture of the cutie. You may feel ugly... :D but she is beautiful for me.