Thursday, February 28, 2013

Some Useful commands in Ubuntu

- Deleting a file

$ sudo rm filename

- Deleting a non-empty directory

sudo rm -rf  dirname

- Deleting empty directory

sudo rmdir dirname

- Creating a directory

$ mkdir dirname

- Creating sub-directory

$mkdir -p dirname/subdirname


AVR Programming with AVRDUDE

Computer Interface Connection


  1. Connect the FTDI cable to PC and run the following command in terminal

    ls /devIn the list if you see something like "ttyUSB0" than the FTDI cable is correctly installed.
  2. Connect AVR ISP mkII to PC
  3. Connect the AVR ISP mkII 6 pin programming header to Board
  4. Connection for AVR ISP mkII Programmer



Programming in Ubuntu

 Setting up Ubuntu for AVR development

 You need following package for setting up your ubuntu of AVR programing

1. gcc-avr The GNU c compiler for AVR

Libusb may be in a "universal" repository so you probably want to modify your repository list to include the "universal" repositories. libusb-dev is required if you want to use usb programmer such as avrisp2 or usbtiny

5. AVRDUDE - program to writes data on the microcontroll

sudo apt-get install flex byacc bison gcc libusb-dev avrdude
 
sudo apt-get install gcc-avr  

2. avr-libc C library for AVR

sudo apt-get install avr-libc
 
sudo apt-get install libc6-dev  


3. binutils-avr - Essential utility of C compiler (it stands for "Binary Utilities").
 

6. avr-gdb The GNU debugger for AVR. This program runs from the
terminal avr-gdb, avr-gdbtui, avr-run

Open the terminal and  navigate to the folder where you have filename.c and filename.make file and run follwing commads

1) Make Hex file

make -f  filename.make

2) Program fuses using avrispmk2 programmer (or other programmer, see makefile)

sudo make -f .make program-avrisp2-fuses

3) Program flash

sudo make -f .make program-avrisp2

To run term.py

python term.py /dev/tttyUSB0 115200











Eagle and PCB Milling


Monday, August 13, 2012

Scientific Instrumentation Using Python

Why?

Its Free and Easy to learn
You can use it in Linux, Windows and Mac. For this tutorial we are going to use windows

You must have VISA installed before hand (I used NI VISA)
Steps

1 - Download and install Python Installer from http://www.python.org/

2 -  Download and Install PyVISA from http://sourceforge.net/projects/pyvisa/files/latest/download

3 - Run the following command


That's it. Its this simple.





Tuesday, July 31, 2012

Joomla Webpage Design


First crate a Menu

Go to Menu manager from Menu -> Menu manager -> Add Menu

Then add a module to it.

In Menu List go to right most colom to add module and click it. This will ask you to create a module that will correspond to this menu. You can also add sub-menu to this menu.

Select the pages where this module will be displayed in module settings.

Create category of article and link them to menu items.


1) Hiding print, email Icons

Go to Article manager -> Options and set settings


1) Adding HTML page to an article

Go to code toggle in article editor and copy paste following code

<p><iframe src="http://www.patilprashant.com" frameborder="0" width="100%"height="100%">
    <p>Your browser does not support iframes.p>
    iframe>p>



2) Adding readmore button in Joomla ARticle

In the article editor navigate the cursor to the position where you want to have readmore and click the "readmore" button located at the bottom of the page. 


Tuesday, July 3, 2012

Using USB datacard in Ubuntu

If you are in India and want to use Internet on move you need an USB modem. You can insert the sim of your choice,  activate the "data plan" for that operator and start using the Internet.

Unfortunately, all the network provider in India provide driver for these modems only for Windows operating system. If you are an Linux user, there is absolutely no support for these modems.

Below is the detail procedure of how I used my USB Modem ( MTNL 3G JADOO) with Ubuntu 12.04LTS


Step -1:

I used Sakis3G script to use this modem. You can download it from here.

http://www.sakis3g.org/

The version I downloaded was "All architects - Binary free version  (144K)". Unzip and save the "Sakis3g" on Desktop.


Step - 2:

Open terminal and exceute the following command




Step - 3:

Following window will open after executing these commands

Select "Connect with 3G" option from the list and hit OK.





Step - 4:


Select "USB Device" and hit OK




Step - 5:

Select "HSPA Data Card" and hit OK. If you have different data card that will be listed here.




Step - 6:

Select the Kernel module. Depending upon your datacard you will have different options. You need to try all of them. For me "option kernel module" worked perfectly fine





Step - 7:

Select the APN. Depending upon your network provider APN will change. You can find the APN by looking into the settings of these network provider in the corresponding windows software. In my case, I used the datacard in Windows machine. The software for datacard in windows machine had an option called profile. In there, APN was listed. 

For Vodafone and Reliance, it was simply "www" for BSNL it was "bsnlnet". You can also try your luck by calling customer care. As I was using Reliance 3G SIM, I simply selected "Reported by your modem (www).


Step - 8:

Most of the network provider don't have any username and password. But script requires it, So simply put any text for username and password.




    


Step - 9:

If the modem is able to connect you should see the message box similar to below. In my case for Reliance the message was "connected to unknown operator and for Vodafone SIM, it detected the network and message was "connected to vodafone"


Step - 10:

Once you hit OK, following window will appear and you should be able to use Internet. When you want to disconnect simply select Disconnect and hit OK.

s


Note - I have successfully used this script for Reliance 3G GSM and Vodafone. I could not use it for BSNL SIM. Also note that this script is only useful for GSM network provider. I tried to use it with CDMA datacard with no success.

Wednesday, March 17, 2010

Noiseless measurement of Optical Signal and Laser Pulse generation

After one week of thinking my project is finally decided its "Noiseless measurement of Optical Signal and Laser Pulse generation". Deciding the project was tough job, not only I had to consider that the project should be complited in three weeks it should also not very complicated as well as not very simple. I had many thoughts in mind like making "MP3 player", "USB pen drive", "Touch screen " or "Laser guided robot" but I did'nt like any of them very much since they are mostly electronics gadgets, available in market ( and if you respect chines they can be really very cheap) also I am Physicist not an electronics engineer. Electrnics is just happend to be my hobby but Physics is my passion. So I wanted to decide some project which will reflect my Physics background and finally came up with this Idea.


Motivation-
Often during optical measurment background light is a big problem (still remember the complite blackout of optics lab ). I decided to come up with the idea to remove this background light noise. The idea is as follows-
  1. Light from the light source ( usually laser , monochromator ) is allowed to pass through sample and chopper on to the detector. The job of the chopper is to periodically allow and block the light from the light source. In this way the detector will receive two kinds of signals one with (laser + background ) and other with only background light. Now I just need to subtract these two signals to remove the noise.
  2. Second part of the project is generate laser pulse of desired pulse width of order of millisecond. The idea is to control the speed of chopper motor using PWM method. A feedback mechanism is used to continuously monitor the speed of the chopper motor and then use this data and the set value of pulse width to control the speed of motor.
Part List-
  1. Any 80C51 core micro-controller (I am using P89V51RD2).
  2. LDR ( Light dependent resistor ) as detector.
  3. Chopper and opto-coupler (soon going to post the picture of my opto-coupler ).
  4. LCD.
  5. Keyboard.
I will keep posting the development in the project. I have got three weeks to complete this project lest see how I do .


Update 16 April :
Finally got some time to write.
I started with interfacing LDC to microcontroller. I have written a nice code library for interfacing it. Then I switched to interfacing ADC. I used 8080ADC. Instead of  using external clock using say 555 I used the clock generated by the uC itself. The ADC worked perfectly fine. I landed up in making a simple voltmeter by interfacing the LCD and ADC together. Till now everything was fine but later I observed that ADC is too slow for my use (data sheets says 100us for each conversion ) so I had to ditch the entire Idea of using ADC and I switch to atmega16 which has internal ADC with 15ksps. It was frustrating as my design was completly ready and now I have to start from scrach. Any was I switched to atmega16 all the software development is completed and its working fine atleast in simulation. I will implement it in hardware later.