Skip to main content

Posts

Showing posts from 2013

Featured Post

Product Design of a 4 wheel differential drive robot

www.ieeegecskp.in

  After a weeks hard work www.ieeegecskp.in is now up and running.This site was designed for the IEEE Student Branch wing of my college (Govt. Eng College Sreekrishnapuram). This site was created using HTML 5 standard and used CSS 2 for designing. Jquery is used for simple animations. All rights reserved for the content and code used for making this website. This site deals with dynamic data and used MySQL database. Browser support were tested and this site works perfectly in Chrome, Firefox, Opera and Internet Explorer. No browser dependent functions are necessary for proper working of this site. Source code will be posted on githhub soon.

Use Matlab to read serial data

  Matlab is one big tool which you can play with.. Matlab can be configured to read serial data that can be send through a microcontroller. Here is the code for Matlab to read a single line and print. Assume that you are sending ascii character values through microcontroller separated by new line. Here is the Matlab code to receive the data. 1: obj1 = instrfind( 'Type', 'serial', 'Port', 'COM13', 'Tag', ''); 2: % Create the serial port object if it does not exist 3: % otherwise use the object that was found. 4: if isempty(obj1) 5: obj1 = serial( 'COM13'); 6: else 7: fclose(obj1); 8: obj1 = obj1(1) 9: end 10: obj1.BaudRate=4800; 11: set (obj1, 'Parity', 'even'); 12: set (obj1, 'StopBits', 2.0); 13: fopen(obj1); 14: data1=fscanf(obj1, '%s'); 15: data1=fscanf(obj1, '%s'); %Assume that you are sending characters and 8 bit binary no.

Creative Destruction | Batch Hacks

Ever tried to put windows to crawl? Let’s do it. This simple code is an infinite loop where each time it runs a copy of itself. The amount of computational power it requires increase exponentially. With an i5 configuration with descent RAM your PC will hang in seconds. You won’t even get time to kill the process or log off. One thing you can do is to shut you PC using your power button.  You will have 5 second timer. It will execute only after 5 seconds. It won't do any harm to your PC other than hanging… Use it for educational purpose only… Save this file as tryme.bat and run it.

Serial port communication using AVR

  Serial port communication is pretty much useful and also simple to carry out. There are certain thing you need to get first. 1. A microcontroller (Here Atmega328p). 2. A USB2serial converter. 3. A terminal software. Modern computers won’t have this rs232 serial ports. So there is no use to go for an rs232 module and get started. Only option left is to communicate through USB ports. Many microcontrollers lack USB support. So there is an easy way. Buy a USB2serial converter or use an old Nokia 1200 or 1680 USB data cable. It has a serial to USB converter. It costs only around 60Rs(India). These are old handsets. If you ain’t find this one, go to eBay and buy this USB To RS232 TTL Converter Adapter Module PL2303HX( Link here ). You have to pay around 200 RS for this one. Let’s get started. Find the TX pin from datasheet. For Atmega328 it’s pin no: 3. Connect it to RX pin of the USB2serial converter. Then use the given code for sending the word “HELLO” to PC. Use a terminal to v

Mark all Gmail messages as read

  I have huge collection of unread e-mails.. I usually won't open unwanted or junk e-mails. And of course over a period of time, I have about 1000 unread messages right in my mailbox. It’s very annoying to go through all 20 results(listed in a page) and marking all as read. Every time I got a new mail it shows, hey you have 1001 unread e-mails. So I found a solution to mark all the unread e-mails as read in a single step. Go to your Gmail inbox and search the key word is:unread When you got the search result select the option Mark All. Then there is an option to mark all the search result. Click it and then Mark all as read.

Changing the colour of your mouse

Ever think of changing this hard red colour of your mouse? Basically I love the blue. Everyone like to have a change. Right? Ok..Optical mouse works by making use of Light Emitting Diode (LED) and photo diodes to detect the movement. It make use of the reflected light to detect movement. So if we change LED to a different colour there is a chance for not detecting the movement. It's because for that particular circuit arrangement, it needs the specific colour so that exact current is developed in the photo diode. For most mouse it doesn't matter. Before trying out, just make sure it works. Remove the case and you will find the LED. Just desolder it and replace it with the Blue one. Plug it to PC to check whether it is working. There may be a chance that the LED glow is weak. Look for a resistor series with the LED leg. Use a multimeter to check the voltage across LED. It should be near 3V. Replace it with a low resistor or just short it. Your Blue LED mouse will work perfect.

Driving 2 LED in a Fasion

  This code make 2 LED blink one after other. LEDs are connected to PORT C (P0 and P1). Make sure use a 330 ohm resistance to protect your LED. Code 1: /* 2: * Driving_2_LED_in_a_Fashion.c 3: * 4: * Created: 01-01-2013 PM 12:24:34 5: * Author: ANANTHAKRISHNAN.U.S 6: */ 7: 8: 9: #include <avr/io.h> 10: #include <util/delay.h> 11: 12: int main( void ) 13: { 14: DDRC = 0b00000011; 15: while (1) 16: { 17: PORTC = 0b00000001; 18: _delay_ms(500); 19: PORTC = 0b00000010; 20: _delay_ms(500); 21: } 22: }

Blinking an LED with Microcontroller

  Put some delay after making the output high and low. Otherwise you won’t see the blinking. Code used is provided below. Comments are used for understanding the code. Do comment if you guys have anything to say. Code 1: /* 2: * Blinking_an_LED.c 3: * 4: * Created: 01-01-2013 AM 11:56:59 5: * Author: ANANTHAKRISHNAN.U.S 6: */ 7: 8: 9: #include <avr/io.h> 10: #include <util/delay.h> 11: int main( void ) 12: { 13: DDRC = 0B00000001; //Port c0 as output 14: while (1) 15: { 16: PORTC = 0B00000001; //PCO high 17: _delay_ms(1000); 18: PORTC = 0B00000000; // PC0 low 19: _delay_ms(1000); 20: } 21: }

Lighting an LED with Microcontroller | Atmega328p

  It is very simple if you have some taste in programming. The code for lighting an LED is given below. What am doing is just enabling a particular port of microcontroller. Here it is PORTD. Before you can use a port you need to set the port as an output port. So that you can output data to that port. If you set the DDR (Data Direction Register) of PORT D (ie, DDRD) as 1, then it will act as output. If it is set to 0 it will act as input. Code 1: /* 2: * My_Learning_Projects.c 3: * 4: * Created: 01-01-2013 AM 11:45:20 5: * Author: ANANTHAKRISHNAN.U.S 6: */ 7: 8: #include<avr/io.h> 9: 10: int main( void ) 11: { 12: DDRD = 0b00000010; //Data register D1 is set to output 13: PORTD = 0b00000010; //Make PD1=1 14: 15: while (1) //Infinite loop 16: { 17: 18: } 19: } 20: The while(1) loop is an infinite loop for running the microcontroller for ever. Otherwise it will execute all the commands once and then stops.

Get started with Microcontroller | Atmega328p

For those who are new to microcontroller, microcontroller is nothing but a mini computer within a chip. It has ram, a processing unit and all those needed for a computer to work. But in a mini scale. You can program your chip with a burner circuit. You need a software like avr studio to compile the program. Then you need a software like SinaProg to put this compiled HEX program to your chip. I use a USBasp ISP as the burner. You can buy that from www.electroncomponents.com . For the rest of the post I use Atmega328p microcontroller. Have been playing with atmega328p avr microcontroller for sometime. It’s a High Performance, Low Power AVR® 8-Bit Microcontroller with 20Mhz speed. There won’t be much difference with other avr series microcontrollers except the no. of I/O ports, ADC, speed etc.. I would recommend avr studio 6 for compiling your program. First of all it’s free. It’s based on Microsoft visual basic platform. If you are a beginner it will be very helpful as it has code

Electret Microphones (CMA-4544PF-W)

        An electret mic is the best choice for money and low power requirements. It is extremely compact in size and has a good performance value. For some time I have been searching for a microphone for my project that works above 20 KHz. It started from electret microphones and ended just right back at the same electret condenser microphones. Even though the datasheets says it has a frequency range of 20 to 20 kHz, it is possible to obtain the signal having around 24kHz. Obviously will have some high attenuation. But will work quite at 24khz range. Many types of microphones need power to operate. They are generally called condenser microphones. If you google around the webpages for mic circuits, you will definitely find out that all the condenser type microphones need a biasing arrangement. Electret condenser type microphone has a built in FET buffer. So it needs to be powered. Normal biasing voltage ranges from 3 to 9v. Also you need to add a capacitor to block the dc voltag