Thursday, 22 October 2015

computer operating LED

COMPUTER OPERATING LED

we can control real world electronics elements using computer with .net s/w. this project is mainly used for Home automation.



         
AVR ATMEGA 16 CODE
/*
 * uart_suria.c
 *
 * Created: 8/12/2015 9:50:06 AM
 *  Author: suriasarath
 */

#include <avr/io.h>
#include <inttypes.h>
#define F_CPU 8000000UL

char data;
void USARTiint(uint16_t UBRR_VALUE)
{
    UBRRL= UBRR_VALUE;
    UBRRH=(UBRR_VALUE>>8);
    UCSRC=(1<<URSEL)|(3<<UCSZ0);
    UCSRB=(1<<TXEN)|(1<<RXEN);
}
char usart_readchar()
{
    while(!(UCSRA &(1<<RXC)))
    {
       
    }   
    return UDR;
   
}
void usart_writechar(char data)
{
    while(!(UCSRA & (1<<UDRE)))
    {
       
    }
    UDR=data;
}
int main(void)
{
    char data;
    USARTiint(26);
   
    while(1)
    {
        DDRA=0xff;
        data=usart_readchar();
        if (data=='a')
        {
            PORTA|=1<<PA0;
            usart_writechar('s');
        }   
        if(data=='q')
        {
            PORTA&=~1<<PA0;
            usart_writechar('d');
        }
   
             
    }
}
Its normal uart code then we write code for vb.net so we can connect using Computer serial port

Wednesday, 30 September 2015

LED ON/OFF IN SINGLE BUTTON ATMEGA 16


                                     single button for led on/off


One micro button for turn on the LED and turn OFF the LED. it is very simple and the code.
  1. atmega 16 microcontroller
  2. micro button
  3. 3v LED
  4. 5v supply

softwares

  1. atmel studio
  2. extreme burner
This technic was used in molt of all electronics components. so it was usefull for all electronics students and starters when we press a button tle led was turn one then again pressthe button LED turn off.


PROGRAMME
/*
 * switch_or.c
 *
 * Created: 10/3/2015 2:43:36 PM
 *  Author: suriasarath
 */


#include <avr/io.h>
#include <util/delay.h>
    int val1;

int main(void)
{
    DDRA=0xff;
    while(1)
    {
        val1=PINB;
        if (val1==0xfe)
        {
            PORTA ^= (1 << 0);
            _delay_ms(1000);
        }
      
    }
}

Tt is very simple code................... 

Tuesday, 17 March 2015

SWITCHES

SWITCHES

              switch is mechanical device. It used to allow to connect two wire lines. it is very simple device and lots of applications. switch is used in every applications.


Push buttons
Every switches have minimum two leads. when we press the button the two leads lines are connected

SWITCH TYPES
         automation switches:
                 switches used in many automation functions. 
example:  
             DVD player door control is automatic switch. this switch was used to check door was completely closed or open or any error. when switch was close drive was start read the Disc 

          Push buttons switches:
                home Light control, computer key board control, mobile phone keypad and lots of more examples for Push buttons  
            
           Electronics switch
                  Relays, transistor ,Optocoupler are called electronic switches because this type of switches controlled by electronic pulses 
        1. Relays:

Relays


Download datasheet:


  RELAY have 5 leads 
                              v1 & v2 is control pins
                               Common terminal is input pin
                               normally open and normally  closed pin

when we give power supply normally open was turn to close
when we give power supply normally close was turn to open

Applications of Relay:
                     Emergency light
                     stabilizer circuit
                     

Optocoupler :
                optocoupler is Electronics Switch Like relay. It have 4 pins. this device work based on optical light 
                 

 Pin description for optocoupler:
             
               1. Anode
               2. cathode
               3. Emitter
               4. collector

Download  datasheet:



LED light emitting diode

LIGHT EMITTING DIODE
      
       LED is basic level electronics component and LED have wide range of applications. LED used in digital clocks, TVs, trafic signals lights, Low power home bulbs and more......

 
LED have two pins
     1. positive
     2. negative

normally  long lead is positive
                 short lead is negative

LED types

size:
      0.5mm LED
      0.3mm LED
colors:
       all colors LED available
 
Multicolor LED:
                         2 pin (when give power supply glow in all colors )
                         4 pin (red,blue, green and conman GND pin    )
         
LED pin identification





In LED have large plate and small plate
                                               Large plate and Flat is always Cathode
                                               small plate is always Anode

      .
 



DATA SHEET DOWNLOAD:
                                          CLICK HERE TO DOWNLOAD


LED APPLICATIONS

 Display is one of best application of LEDs
mobile displays
TV displays
seven segment displays