mavin teorie

Upload: bagi-alexandru

Post on 05-Apr-2018

226 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 Mavin Teorie

    1/23

    3. Output Module3.1. LED3.1.1. What is LED?

    LED is an abbreviated form of light-emitting diode, which is a semiconductor

    element that emits light when a forward voltage is applied. Radiation principle uses theelectroluminescence effect. Its life span is considerably longer than incandescent lightand it can create one that emits ultraviolet light, visible ray, and infrared ray according tothe used material.

    Figure 3.1.1 Structure of LED and energy band structure

    LED is made up of the structure called pn junction, which uses a semiconductor.

    In the pn junction, an electron that holds energy is directly converted into light energy.Electron and holes that are injected from an electrode to the semiconductor flow on theother energy band (conduction band or valence band) and recombine around the pn

    junction after passing the band gap. When they are recombined, a considerable amount of energy is released from the band gap as a photon, which is a light.

    As an electric characteristic, it has the identical polarity of the general diode anduses it by applying a constant voltage from cathode to anode. When the voltage is low,the current does not flow and the radiation does not occur. However, when the voltage isabove a certain threshold value, the current flows rapidly due to the rise of voltage andthe light is generated according to the quantity of current. This voltage is called a forward

    voltage drop, which is higher than the general diode. According to the radiation color andthe quantity of output radiation, there exists a difference between this forward voltagedrops. When the voltage is applied in reverse direction, the withstanding voltage(generally -5 V) is lower than the general silicon diode and the element breaks down if itexceeds. Note that it cannot be used as a rectifier.

  • 7/31/2019 Mavin Teorie

    2/23

    3.1.2. Operating Method of LED in MA-VIN

    First of all, the method for operating LED module in MA-VIN is explained. Totalof 5 extendable modules can be attached or taken off from MA-VIN, where each moduleis connected to ATmega64 processor. It is assumed that LED module is connected to slot

    #1 at this point.

    Figure 3.1.2 LED module

    Figure 3.1.3 Circuit diagram of LED module

  • 7/31/2019 Mavin Teorie

    3/23

    Figure 3.1.5 Circuit diagram of slot

    Table 3.1.1 Connection between module, slot, and processor

    LED provided by MA-VIN is a common anode type, where the forward voltagemust be provided to the LED. In addition, the voltage drop must be occurred throughLED for LED to operate.

    Figure 3.1.6 Common anode type

    Figure 3.1.7 Common cathode type

  • 7/31/2019 Mavin Teorie

    4/23

    Thus, when LOW value is given to port that operates LED, there is a voltagedifference between the supply voltage of +5V and the port voltage, which turns the diodeon.

    3.2. Buzzer

    3.2.1. What is Buzzer?Buzzer is a tool that generates a dial tone by combining electromagnet anddiaphragm, and generates an alternating current (AC) from the direct current (DC)voltage. At here, it describes the tool that generates a dial tone. There are two types of signal buzzer: a direct current type and an alternating current type. For the DC type of buzzer, a metal rolled around with the coil acts as an electromagnet. A spring is attachedto the diaphragm, which creates a sound during the collision between diaphragm and thepoint of contact when the current flows. For the AC type, it is similar to the DC type, butthere is no point of contact. Instead, it uses an alternating current frequency to create avibration.

    Figure 3.2.1 Buzzer module

    Figure 3.2.2 Operating method of buzzer

    3.2.2. Operating Method of Buzzer in MA-VIN

  • 7/31/2019 Mavin Teorie

    5/23

  • 7/31/2019 Mavin Teorie

    6/23

    Figure 3.3.1 Screenshots of 7-segment module and the module is connected to MA-VIN

    7-segment as the name indicates is made up of seven small display elements.Since these seven elements are possible to turn on or off individually, the representationsof number between 0 and 9, and alphabet between A and G are possible throughthe combination of elements. In other words, the representation of 16 (hexadecimal) HEX

    digits is possible by using the 7-segment.In order to display a hexadecimal using 7-segment, each element must becontrolled individually.

    Figure 3.3.3 Circuit diagram of 7-segment module

    For the operation of 7-segement, MA-VIN uses a special chip called 74HC595.This chip has the characteristics of 8-bit data series input and parallel output. 74HC595contains the following characteristics:a. 8-bit series inputb. 8-bit series or parallel outputc. Storage register that holds 3-state outputd. Direct erasable shift register

  • 7/31/2019 Mavin Teorie

    7/23

    e. 100 MHz variable frequency

    Table 3.3.1 Function table of 74HC595

    Figure 3.3.4 74HC595 and its connection in MA-VIN

    In Figure 3.3.4, you can confirm how 74HC595 is connected in MA-VIN. FromQ1 to Q7 correspond to QA to QH in MA-VIN, respectively, where QA to QH

    represent parallel output and QH represents series output. Since QH is not used in MA-VIN, you can notice that MA-VIN does not use series output.

    Table 3.3.2 Pin description of 74HC595

  • 7/31/2019 Mavin Teorie

    8/23

    3.4. DC Motor3.4.1. What is DC Motor?

    DC motor is a tool that converts an electric energy into a kinetic energy(mechanical energy) by using an electromagnetic force, which is generated from themagnetic field around a current carrying conductor. Rotor and stator are made up of coil

    and permanent magnet, respectively. The DC motor contains a rapid acceleration, highstarting torque, and linear rotation characteristics.3.4.2. Rotating Principle of DC Motor

    When current flows in the conductor of DC motor around the magnetic field, itgenerates an electromagnetic force. DC motor uses this electromagnetic force and itfollows the Flemings left hand rule.

    Figure 3.4.1 Structure of direct current (DC) motor

    In the left image of Figure 3.4.1, the force is acted on upward at the point a of armature when you apply the Flemings left hand rule. Similarly, the force is acted ondownward at the point b of armature, which makes the armature to rotate. Current doesnot flow when the armature is perpendicular as shown in the middle image, but thearmature continues to rotate due to the inertia. When the armature makes a half-turn asshown in the right image, both point a and b of armature become the opposite to theleft image. However, since the current flows to the opposite direction due to thecommutator, the armature continues to rotate with the identical force.

    3.4.3. H-Bridge CircuitDC motor rotates to a fixed direction because + and - are connected to each

    ends of motor terminal. In order to change the rotating direction of motor, the polarity of + and - that are connected to the motor terminals must be changed. In general cases,there is a weakness because motor must change its wires to change the direction. H-bridge circuit solves this weakness by allowing this switching operation electrically.Since the structure of circuit is similar to an alphbet, H, Hbridge circuit is given as itsname.

  • 7/31/2019 Mavin Teorie

    9/23

    H-bridge circuit has the basic structure composed of 4 transistors, where eachtransistor acts as a switch. As shown in Figure 3.4.2, when Q1 and Q4 are on, and the

    rest Q2 and Q3 are turned off, the current flows from the supply voltage to Q1where the left terminal of motor is provided with + voltage, and the right terminal isconnected to GND through Q4 terminal. If the motor rotates in clockwise directionhere, the motor rotates in counterclockwise direction when Q1 and Q4 are turned off,and Q2 and Q3 are turned on. + voltage is provided to the right terminal throughQ2. Note that GND is connected to the left terminal of motor through Q3. Since H-bridge circuit can change the polarity of supply voltage of the motor using an electricalcontrol method, the adjustment of rotating direction of motor is practicable such asclockwise or counterclockwise rotation.

    Figure 3.4.3 Circuit diagram of H-Bridge in BA6289F

    3.4.4. Circuit Diagram of DC MotorIn MA-VIN, DC motor is connected from PIN 14 to PIN 17 (Port B 4-7) of

    ATmega64 processor. It is controlled based on a reversible motor driver, BA6289F, byusing a PWM (Pulse Width Modulation) method.

  • 7/31/2019 Mavin Teorie

    10/23

    Figure 3.4.4 Block diagram of BA6289F

    Figure 3.4.5 Pin arrangement of BA6289F

    Table 3.4.1 Pin description of BA6289F

  • 7/31/2019 Mavin Teorie

    11/23

    Table 3.4.2 Input/output truth table of BA6289F

    Since BA6289F makes four types of output by the combination of two inputsignals (FIN and RIN), it is practicable to control the rotating direction of motor.

    3.4.5. Motor Control

    Figure 3.4.7 Connection between motor driver, BA6289F, and ATmega64 processor

    MA-VIN controls the motor through Port B and Port E of ATmega64processor. PB4 and PB5 of processor are used as MOTOR_R_R andMOTOR_R_L, respectively. PB4 and PB5 are connected to FIN and RIN of BA6289F, respectively, and determine OUT1, OUT2, and the operation of motor bycomparing these two input values. Refer the input/output truth table of BA6289F inTable 3.4.2

    PE4 and PE5 of processor are ports for an external interrupt. In MA-VIN,these two terminals are used to set the reference voltage. Since the interrupt is notgenerated unless there is a special input, the reference voltage is set to 0 V.

  • 7/31/2019 Mavin Teorie

    12/23

    3.5. LCD Module3.5.1. Operating Method of LCD Module

    LCD module is a tool that displays either text or graphic that we want, which islargely divided into a text LCD and a graphic LCD. LCD module can be attached to MA-VIN, which uses 8 texts in one line and displays an output of 8 x 2 texts. The connection

    and pin configuration of a text LCD module provided by MA-VIN can be verified asfollows:

    Figure 3.5.1 LCD module of ER6

    Figure 3.5.2 Pin configuration of slot for LCD

  • 7/31/2019 Mavin Teorie

    13/23

    Table 3.5.1 Pin description of LCD module

    In Table 3.5.1, PIN 1 ~ PIN 6 of LCD module are related to the operation of LED,and the adjustment of PIN 4 to PIN 6 influences the actual operation. In addition, fromPIN 7 to PIN 14 are used to move the data. Each pins is connected to PG0 ~ PG2 (PIN 0~ PIN 2 of port G) and PA0 ~ PA7 (PIN 0 ~ PIN 7 of port A) of ATmega64, which is theprocessor of MA-VIN.

    Since PIN 1 ~ PIN 3 are operated as the driving part of LCD and they are relatedwith the design of circuit, they are not affected by an additional configuration. When PIN

    4 and PIN 5 becomes 1(HIGH), 0(LOW), 1(HIGH) 0(LOW), the data gets displayed onLCD. Remember this point when you give a command. The following table is relatedwith the command of LCD.

  • 7/31/2019 Mavin Teorie

    14/23

    Table 3.5.2 Pin configuration method for the commands of LCD module

    Table 3.5.2 is a table that collects the commands for the initialization steps of LCD. Each LCD possesses different characteristics according to the product and theinstruction cone is different as well. Thus, the initialization steps must be done accordingto the product. The procedure of initialization steps are shown as follows:

  • 7/31/2019 Mavin Teorie

    15/23

    Figure 3.5.4 Initialization order of LCD module

    3.6.1. Operating Method of Speaker ModuleThe operation of speaker is almost same as buzzer. Thus, identical contents of

    buzzer are omitted and if you have questions, review the section 3.2 Buzzer part onceagain. Speaker module vibrates a diaphragm, which generates a sound, when currentflows into the circuit. In general, the difference between speaker and buzzer is that buzzercan achieve its functionality by generating only a monotone (a single sound), whereasspeaker must distinguish between high and low sound. In order to do this, it uses afrequency. According to octave and scale, the frequency is classified and the speaker canbe operated by putting in this frequency value. The following figures show the speakermodule of MA-VIN, the circuit diagram of speaker module, and its specifications.

  • 7/31/2019 Mavin Teorie

    16/23

    Figure 3.6.1 Speaker module

    Figure 3.6.2 Circuit diagram of speaker module

    Table 3.6.2 Standard frequency according to octave and scale

  • 7/31/2019 Mavin Teorie

    17/23

    As shown in Table 3.6.2, when the speaker module and connected port becomesHIGH after setting the frequency according to octave and scale, a sound is generatedthrough speaker. In order to set a frequency value according to each octave and scale, adatabase that generates a proper frequency is required.

    4. Input Module4.1. Switch4.1.1. Operation of Switch Module

    Lets examine about switch in this subchapter. Switch module provided by MA-VIN is composed of the total of 3 push switches, where the circuit diagram of pushswitch is organized as follows:

    Figure 4.1.1 Push switch module

    Figure 4.1.2 Circuit diagram of push switch

    3 switches are connected to the ground (GND) and the voltage drops to 0V whenthe switch is pressed. Since the operation of switch cannot be confirmed directly, it isexplained by providing an example to turn on LED using switch.

  • 7/31/2019 Mavin Teorie

    18/23

    Table 4.1.1 Port pin configurations

    Table 4.1.1 represents that input ports must set the value of DDxn to 0 (LOW:input). Since the switch is connected to the ground, basically the port should have thevalue of 1 (HIGH). The reason is that the value drops from HIGH to LOW when theswitch is closed. To confirm the switch status, pull-up is used. Pull-up is the operation forprocessor to check the status of port when the switch is opened. Generally, the port holdsthe value of 1 (HIGH). When the switch is closed and the voltage drops to 0 (LOW), theprocessor concludes that the switch is pressed.

    4.2. Touch Switch4.2.1. Operation of Touch Switch

    Touch switch is a tool to perform a switch role where a human body acts as aninstantaneous conductor by applying that current can flow through the human body.Touch switch is commonly used to turn on/off a light and general electronic device. MA-VIN provides this touch switch as a module and various exercises are possible throughthe touch switch. The following figures show the touch switch module and its circuitdiagram used in MA-VIN.

    Figure 4.2.1 Touch switch module

  • 7/31/2019 Mavin Teorie

    19/23

    Figure 4.2.2 Circuit diagram of touch switch

    The important point in this circuit diagram is an ES01 chipset, which allowsperforming a switch role. This chipset is a 1CH-capacitance comparator and detects thedifference of electric charge between two inputs: IN+ and IN-. ES1 of MA-VIN returnsan output of 1 (HIGH) if there is an electric charge difference between IN+ and IN-. Allof you may know the fact that the current flows in a human body. If a human handtouches a touch pad (J13) as shown in Figure 4.2.2, an electric charge in C53 goes outthrough the hand. At this point, an electric charge difference between IN+ and IN- isoccurred and ES01 chip informs this fact by generating a HIGH value to the output port.When this OUT and MA-VIN port are connected, the operation of touch switch is

    achieved.

    4.3. Infrared sensor4.3.1. Operation of Infrared Ray Sensor

    Infrared ray sensor is a tool that detects the physical or chemical amount of temperature, pressure, radiation strength, etc, by using infrared ray, and converts into theelectrical amount for signal processing. There is an instrument, which senses theinterception and detects the circumference of infrared rays by emitting infrared ray. It isused for the preventions of crime or fire. There is a passive type of infrared ray sensor,which only reads the amount of infrared ray differences from the external world. Bycopying infrared ray alone, light is isolated in this type and the passive type does not

    contain both emitter and receiver that are needed to detect the change. There are total 12infrared ray sensors in MA-VIN, where 6 of them are active type and the rest 6 of themare passive type. In the active type sensor, infrared ray is copied and its rays are reflectedafter bumped into an obstacle. Then the passive type senses this amount. By using thisinfrared ray sensor, it can be used in the various applications including obstacleavoidance by driving motors when an obstacle is detected.

  • 7/31/2019 Mavin Teorie

    20/23

    Figure 4.3.1 Infrared ray sensor module

    Figure 4.3.2 Connections of infrared sensor

    Table 4.3.1 Connections between infrared sensor module and processor

    4.4. CdS Sensor4.4.1. Operation of CdS Sensor

    CdS sensor is a Cadmium Sulfide cell, which is a crystal component thatintegrates cadmium and sulfur and connects a metal leg. It has the characteristic that thecurrent flows when a visible ray is reached. In other words, it has the high resistance inthe dark place, whereas it has the low resistance in the brighter place. Thus, it is used asan element to detect light.

  • 7/31/2019 Mavin Teorie

    21/23

  • 7/31/2019 Mavin Teorie

    22/23

    Figure 4.4.3 AD Converter

    4.5. Microphone4.5.1. Operation of Microphone

    Microphone is a device that receives sound input. Sound is an analogsignal.However, the microprocessor that we use deals with digital signal and thus ADCconverter explained in the previous section has to be used. MA-VIN holds an internalmicrophone, where the microphone signal is received through the channel 6 of ADC, orthe 6th pin of PORTF.

  • 7/31/2019 Mavin Teorie

    23/23

    Figure 4.5.1 Circuit diagram of microphone

    Figure 4.5.1 shows the process when sound is transferred to a processor through amicrophone. Input sound from the microphone (MIC) gets amplified through thetransistors (Q13 and Q14) and ultimately transmitted to the processor through theMIC_IN terminal.