Total Pageviews

Tuesday 22 August 2017

Count Down Timer using ATMega 8


Count Down Timer using ATMega 8

            A countdown timer is a down counter that counts from a specified time to 00:00. It is used in many devices such as washing machine, televisions, microwave ovens, etc. This countdown timer has three states: the running state where it counts down, the pause state where it displays the paused time and the reset state to set the countdown. The countdown is displayed on a set of four seven segment displays using the ATMega 8 microcontroller. A buzzer beeps when the countdown gets over.












   

  I/O Port Map: 






























Snippets of Code :

     1)      To enable INT0 and INT1 :
          GICR =(1<<INT1)|(1<<INT0); MCUCR =0b00001010; sei();

         2)      To perform ADC :
      ADCSRA = 0x8F|(1<<ADFR);  ADMUX = 0xC0|ADC_Channel;  sei();  ADCSRA |= 1<<ADSC;

         3)      To initialize Timer 1:
      TCCR1B |= (1 << CS12)|(1<<CS10); TCNT1 =_________;TIMSK|=(1<<TOIE1); sei();

         4)      To initialize Timer 0:
      TCCR0 = (1 << CS02)|(1 << CS00);  TCNT0 =0;     TIMSK |= (1 << TOIE0); sei();

         5)      To select the various digits in 4 -  Seven Segment Display :
          Digit 1 : PORTB = 0b00001110;   // Common Anode
          Digit 2 : PORTB = 0b00001101;
          Digit 3 : PORTB = 0b00001011;
          Digit 4 : PORTB = 0b00000111;

         6)      Interrupt Service Routine :
          INT 0    :    ISR ( INT0_vect )
          INT 1    :    ISR ( INT1_vect )
          ADC     :    ISR ( ADC_vect )
          Timer 0 :    ISR ( TIMER0_OVF_vect )
          Timer 1 :    ISR ( TIMER1_OVF_vect )


   Psuedo Code :

    main()
  {
      //  Initialize the I/O as INPUT or OUTPUT
      //   Use PULL – UP mode for Inputs
      //   Initialize ADC Channel
      while(1)
      {
          // Continuously display values on Seven Segment Display
          // If time = 00:00 , blink and beep
       }
  }

   ISR ( TIMER1_OVF_vect )
  {  //  Decrement seconds value by 1
      //   Initialize Timer 1 again 
   }

   ISR ( ADC_vect)
  {   // Store the ADC0 channel value which corresponds to Minutes
       // Store the ADC1 channel value which corresponds to Seconds
       //  Initialize ADC again
   }

  Prototype:          

  




        Video :

   

Sunday 14 May 2017

USB to TTL Converter using MCP2221


USB 2.0 to UART/I2C Protocol Converter

            The USB to UART/ I2C converter enables USB connectivity in applications that have I2C and/or UART interfaces. It behaves like a standard serial port to the Operating System. Hence the existing Terminal softwares such as (Putty) and Terminal programs could be used. The TX and RX lines of the programmer are used for asynchronous serial communication. When the USB-TTL adapter receives a byte from the computer via USB, it will transmit that byte on the TX line and when it receives a byte on the RX input line, it will send that byte back to the computer via USB.

The bytes are sent and received eight bits at a time, with no parity and one stop bit. This coding is sometimes abbreviated 8N1. The bits must be non-inverted, meaning that a zero is sent as low voltage, and a one is sent as high voltage. All devices involved in asynchronous serial communication need to agree ahead of time on the duration of one bit (the baud rate), so all devices must be independently configured to run at the same baud rate before they will be able to communicate with each other. The USB-TTL adapter supports all integer baud rates from 110 to 115200 bits per second. 

Circuit :
         The circuit is built around MCP2221, which helps the protocol conversion. It reduces the need for external components by integrating the USB termination resistors and oscillator needed for USB operation. Hence the USB 2.0 can be used with full speed (upto 480 Mbps).


Using the Adapter :

       1)      Plug the adapter into a computer.
              




   2)    Go to Device Manager. The system doesn’t recognize the device since the drivers aren’t installed
 4)    Under the section: Documentation , download MCP2200/MCP2221 Windows Driver &        Installer and install it.
       5)    Once the drivers are installed the system should recognize the adapter  
       6)    Download MCP2221 I2C SMBUS Terminal application , install it and open it.
       7)    Under Settings , select the Device and set the Baud Rate.







 Prototype :

      

   
        
                 
      





Saturday 21 January 2017

Student Database using LabVIEW

Student Database using LabVIEW

                                  To manage the student database , a software was developed using LabVIEW which would help the event organizers have a track of the list of events in which each student participated in that academic year . A concept of ELCOM XP was introduced wherein each student participating in an event is awarded some participation points. Winners of each event are awarded additional points. Depending upon the ELCOM XP, the levels are allocated. The participant levels up after acquiring the necessary ELCOM XP.    
Login Page :
                               The first page contains text-boxes for the user to enter the login credentials . After entering the details the user should press the next button. The software then checks the username and password and takes the user to the next tab if the details are correct. The clock designed by overlapping three gauges to indicate the hours, minutes and seconds shows the current system time.



  Database Search :  
                                     The users can search for any student details using this tab. Search can be carried out in three ways namely
       1) Search by Register Number
       2) Search by Name
       3) Search by Phone Number

           The software automatically searches for the text entered in the text box and updates the list-box with the matching records. The user can select the desired student record from the list-box. The software computes the student’s necessary details such as Campus , Department and the current Year of  Study from the students register number and displays it on the screen . The event details along with their corresponding round details are also displayed. Using an algorithm the software computes the student's XP and their current Level.  




  Add to Database :
                                                    This tab helps the organizers  enter the details of the students and their corresponding round details. To   make it convenient , the software was designed in such a way that it automatically generates the students register number depending upon their current year of study , and searches for student record with that particular register number and updates the database with their round details. The organizers should select the student’s current year and enter the Event Name and Event Number . 

  

   Leader-board :
                                    The software computes and arranges the student records depending upon the ELCOM XP and displays it . Also the details are written to a spreadsheet and a hard copy of which can be used for official records.  This lets the organizers find the active participants . Higher ELCOM XP indicates that that particular student has taken part in maximum events organized by ELCOM Dias in that academic year.
          
( Names of the students have been removed purposefully for privacy)

   Add Event Details :
                                   This tab lets the organizers enter the details of their event. A separate document is created for each event (entry ) and the document is saved with the event name. It contains a detailed description about each round of the event , the names of event organizers and the winners list.           






     View Event Details :
                   This tab lets the organizers view the details of various events. The folder containing the documents should be selected first. The list box would automatically get updated with the names of the document. The organizers can then browse through various events by selecting it from the list box. This document contains the detailed description about that particular event.





    Statistics :
                                           This tabs lets the users find the number of participants in each event and make an analysis. The software plots a graph and displays the number of participants in each event.