12.17.2010

Program on microcontroller

I have finished the programming part.

#include <avr/io.h>
#include <util/delay.h>

//Simple Wait Function
void Wait()
{
   uint8_t i;
   for(i=0;i<250;i++)
   {
      _delay_loop_2(0);
   }

}

void main(){
      DDRC = 0x00;         // Configure Port C as input port
    PORTC = 0xFF;         //enable internal pull-up
    DDRD = 0xF0;          // Configure Port D as input port
    PORTD = 0xFF;         //enable internal pull-up

    while(1){
        if(PINC==0xfe){                //pull key 1
            PORTD|=_BV(7);            //relay on
        }
        else if(PINC==0xfd){            //pull key 2
            PORTD&=~_BV(7);            //relay off
        }
        else{
            if((PIND & 0b00000001) == 0b00000001)    //get input
                PORTD&=~_BV(7);            //relay off   
            else{
                PORTD|=_BV(7);            //relay on
                Wait();                //5 second delay
            }
    }
    }
}

I have set:
when distance sensor get the signal, the mist machine would work after 5 seconds.

To add the programming to the microcontroller , an AVR-ISP programmer is needed.
Here is a programmer for me to transfer the program from the computer to the microcontroller .


Microcontroller



 AVR-ISP Programmer


12.13.2010

A updated detail Circuit Diagram

Oh yeah! I have finished all the exams in this semseter. But, still have some assignments...

After I have studied on the website and book, I made an updated detail circuit diagram for connecting to a single mist machine. The circuit includes a microcontroller, relay, op-amp, variable resistor, distance sensor, power supply and mist machine.


11.29.2010

Start on learning the C programming to operate with Microcontroller

I borrowed a book from my friend. It is about the C programming and the operation of Microcontroller. 



Actually, I have studied C programming from two CS courses, which are
CS2331        Problem Solving & Programming
CS2333        Object-Oriented Programming for Media
These 2 courses teach me the idea of C and C++ programming. And the course 
CS2114        Computer Organization for Media
, which introduces the logic and operation between hardware and software.
Hence, it is easier for me to read and understand the book. 
However, I have just learned the software part in school. 
I have never tried to operate with the hardware yet. So, it is very exciting!

11.20.2010

Simple Circuit Diagram

I have designed a Simple Circuit Diagram. I am going to ask for the comments from my EE friend.

After I have asked my EE friend, he asked my circuit needs to add a Relay. It is an electrically operate switch. It is needed to connect with the mist machine. After the circuit recieved the signal from the distance sensor, the signal will be passed to the mircocontroller. If the signal is positive, the Relay would switch on. If not, the Relay would swtich off. It is more safe and stable for my circuit.

11.14.2010

Circuit Equipments

In this whole week, I have being learned on circuit making on the website. This is so helpful for me! Those tutorials are useful and details.

I found that what main Circuit Equipments I need to build my own circuit. I think I need:
Distance Sensor: check sth pass through from a such distance
Variable Resistor: control the level of power of the circuit by produce resistance
Mircocontollor: control the circuit by programming input
Op-amp: control the voltage of the circuit
 

11.06.2010

Learning on Distance Sensor

I am still starting to learn on the website that mentioned before. And also, I found a PDF document to learn about the distance sensor. As my installation is needed to detect someone pass-by, I think the distance sensor is suitable to connect with circuit as well. The PFD introduces all the features, block diagrams, measuring characteristics, operating conditions and many details information.

11.03.2010

Start to learn circuit-making

This is a website for me to learn circuit-making. It is useful and easy for begininner like me : ) As I am a beginner on circuit-making. I have asked an EE friend to learn about making circuit. This website is recommended by him. Thanks him here : D

http://extremeelectronics.co.in/avr-tutorials/part-v-digital-io-in-avrs/
 

10.29.2010

Project Proposal Presntation

Having Project Proposal Presntation today : )

1:30-2pm @ inno centre

10.27.2010

doing Research Report & preparing PPT for Presentation

I have finished the Project Proposal. All require materials are attached. I am now doing the Equipments Research Report. I would add the devices that I have researched and showed on those previous posts to the report. It should be reasonable.

Besides, as my Project Proposal Presentation is on this coming thursday, I would like to make a PPT for me to present as well. It should be direct and clear.

10.26.2010

Conceptural drawings

Demonstration of "Hong Kong's Atlantis"



Front View

 Top View

Side View