하기 내용은 회로 초보자를 위한 간단한 전압분배 법칙을 설명한 내용입니다.

 

키르히 호프의 전압법칙(KVL)에 따라 임의의 폐회로에서 전압강하의 합은 전압 상승의 합과

 

같다.

 

5V 입력에서 3.3V를 얻기위한 전압분배 방법은 아래와 같다.


 

        


각 1KΩ의 저항을 사용했다는 가정하에 Vout을 계산해 보자.

 

Vout = R2/(R1+R2) *Vin

 

Vout = (1KΩ+1KΩ)/(1KΩ+1KΩ+1KΩ) *Vin

 

Vout = 2/3 *5 = 10/3 = 3.3

 

상기의 전압분배 법칙을 사용하여 원하는 전압값을 추출할 수 있습니다.

 

해당출력으로 전자기기를 동작하는 등의 응용은 좀 더 정확한 회로이론을 확인 후 적용 하세요.

→ Vin으로 10V 이상의 전압 적용 및 입력값이 전류일 때는 소자파손등의 위험성이 있습니다.

 

제너다이오드와 일반 다이오드를 이용한 전압분배 방법은 링크를 눌러 확인해 주세요.

 

'전자' 카테고리의 다른 글

기본 논리게이트  (0) 2016.07.20

기본 논리 게이트 설명입니다.



 논리 곱인 AND 게이트는 두 입력 모두 참인 경우만 출력이 참이 되며 두 입력의 최소값을

 구한다. 논리식은 Y = A * B 이다.



논리 합인 OR 게이트는 두 입력이 모두 거짓일 때만 출력이 거짓이 되며 두 입력의 최대값을

구한다. 논리식은 Y = A + B 이다.

 

논리 부정인 NOT 게이트는 입력이 참이면 거짓, 입력이 거짓이면 참을 출력한다.

논리식은 out = A' 이다.


논리 부정의 곱인 NAND 게이트는 입력 모두가 참일 때만 출력이 거짓이 된다.

논리식은 Y = (A * B)' 이다.


 

논리 부정의 합인 NOR 게이트는 입력 모두가 거짓일 때만 출력이 참이 된다.

논리식은 Y = (A + B)'이다.

 

배타적 논리합인 XOR 게이트는 두 입력값이 동일한 경우에 출력은 항상 거짓이 된다.

논리식은 Y = A'B + AB' 이다.

'전자' 카테고리의 다른 글

5V입력 3.3V 전압분배  (0) 2016.07.20

http://www.atmel.com/images/atmel-1259-real-time-clock-rtc-using-the-asynchronous-timer_ap-note_avr134.pdf

▲Datasheet


http://extremeelectronics.co.in/avr-projects/avr-project-relay-timer-with-atmega8-avr-mcu/

▲Example



/******************************************************

A Simple Device Timer project designed using ATmega8


AVR MVU. The Timer is usefully for keeping a device

"ON" for a specific period of time. After the set time

elapse the timer automatically turns the load off.


The Timer uses a standard 16x2 lcd module for user interface

UI. User can set the time using a 3 button keypad.


After that Timer is started. While count down is in 

progress, the time left is displayed on screen.


The program use our LCD driver library more details

of which can be found in Web site.


Use avr-gcc + AVR Studio to compile.


Author: Avinash Gupta

E:Mail: me@avinashgupta.com

Web: www.eXtremeElectronics.co.in


*** THIS PROJECT IS PROVIDED FOR EDUCATION/HOBBY USE ONLY  ***

*** NO PROTION OF THIS WORK CAN BE USED IN COMMERIAL       ***

*** APPLICATION WITHOUT WRITTEN PERMISSION FROM THE AUTHOR ***


EVERYONE IS FREE TO POST/PUBLISH THIS ARTICLE IN

PRINTED OR ELECTRONIC FORM IN FREE/PAID WEBSITES/MAGAZINES/BOOKS

IF PROPER CREDIT TO ORIGINAL AUTHOR IS MENTIONED WITH LINKS TO

ORIGINAL ARTICLE 


Copyright (C) 2008-2009 eXtreme Electronics, India.


******************************************************/


#include <avr/io.h>

#include <avr/interrupt.h>


#include "lcd.h"


//Connection of Load

#define LOAD_DDR DDRC        //데이터방향(Direction) C포트에서

#define LOAD_PORT PORTC      //어느포트를 사용할지 결정

#define LOAD_POS PC0


//Global variable for the clock system

volatile unsigned int   clock_millisecond=0;


volatile char        clock_second=0;

volatile char        clock_minute=0;

volatile char        clock_hour=0;



void Wait(uint8_t n)

{

   uint8_t i,temp;

   temp=n*28;


   for(i=0;i<temp;i++)

   _delay_loop_2(0);

}



void LoadOn()

{

   LOAD_PORT|=(1<<LOAD_POS);

}


void LoadOff()

{

   LOAD_PORT&=(~(1<<LOAD_POS));

}

main()

{


   while(1)

   {

      LOAD_DDR|=(1<<LOAD_POS);


      LoadOff();


      //Enable Pullups on Keypad


      PORTB|=((1<<PB2)|(1<<PB1)|(1<<PB0));


      int8_t hr,min; //Target Time

      hr=min=0;


      //Initialize the LCD Subsystem

      InitLCD(0);

      //Clear the display


      LCDClear();


      //Set up the timer1 as described in the

      //tutorial

      TCCR1B=(1<<WGM12)|(1<<CS11)|(1<<CS10);

      OCR1A=250;


      //Enable the Output Compare A interrupt


      TIMSK|=(1<<OCIE1A);


      //Enable interrupts globally

      sei();


      LCDClear();

      LCDWriteString("    Welcome     ");

      LCDWriteStringXY(0,1,"   Relay Timer  ");


      Wait(4);


      LCDClear();

      LCDWriteString("Set Time - 00:00");

      LCDWriteStringXY(0,1," Start     ^");


      uint8_t selection=1;

      uint8_t old_pinb=PINB;


      while(1)

      {

         while((PINB & 0b00000111) == (old_pinb & 0b00000111));


         //Input received



         if(!(PINB & (1<<PINB2)) && (old_pinb & (1<<PB2)))

         {

            //Selection key Pressed


            selection++;

            if(selection==3)

               selection =0;

         }


         if(!(PINB & (1<<PINB1)) && (old_pinb & (1<<PB1)))

         {

            //Up Key Pressed


            if(selection == 1)

            {


               //Hour is selected so increment it

               hr++;


               if(hr == 100)

                  hr =0;

            }


            if(selection == 2)

            {


               //Min is selected so increment it


               min++;


               if(min == 60)

                  min =0;

            }


            if(selection == 0)

            {

               //Start Selected

               break;

            }



         }


         if(!(PINB & (1<<PINB0)) && (old_pinb & (1<<PB0)))

         {

         //Down Key Pressed


            if(selection == 1)

            {


               //Hour is selected so decrement it

               hr--;


               if(hr == -1)

                  hr =99;

            }


            if(selection == 2)

            {


               //Min is selected so decrement it


               min--;


               if(min == -1)

                  min =59;

            }


            if(selection == 0)

            {

               //Start Selected

               break;

            }


         }



         old_pinb=PINB;




         //Update Display


         LCDClear();

         LCDWriteString("Set Time - 00:00");

         LCDWriteStringXY(0,1," Start    ");


         //Hour

         LCDWriteIntXY(11,0,hr,2);


         //Minute


         LCDWriteIntXY(14,0,min,2);


         if(selection == 0)

            LCDWriteStringXY(0,1,">");


         if(selection == 1)

            LCDWriteStringXY(11,1,"^");


         if(selection == 2)

            LCDWriteStringXY(14,1,"^");


         _delay_loop_2(0);

         _delay_loop_2(0);

         _delay_loop_2(0);

         _delay_loop_2(0);


         _delay_loop_2(0);

         _delay_loop_2(0);

         _delay_loop_2(0);

         _delay_loop_2(0);

      }


      //Start the Load


      LoadOn();


      //Now start the timer

      clock_hour = hr;

      clock_minute = min;

      clock_second =0;


      LCDClear();

      LCDWriteString("  Power Off In ");


      while(1)

      {

         LCDWriteIntXY(4,1,clock_hour,2);

         LCDWriteString(":");

         LCDWriteIntXY(7,1,clock_minute,2);

         LCDWriteString(":");

         LCDWriteIntXY(10,1,clock_second,2);


         if((clock_hour == 0) && (clock_minute == 0) && (clock_second == 0))

         {

            //Time Out


            LoadOff();


            LCDClear();

            LCDWriteString("Load Turned Off");


            while(1)

            {

               LCDWriteStringXY(0,1,"*Press Any Key*");


               Wait(1);


               LCDWriteStringXY(0,1,"                ");


               Wait(1);


               if((~PINB) & 0b00000111)

                  break;


            }


            break;




         }


         _delay_loop_2(0);

         _delay_loop_2(0);

         _delay_loop_2(0);

         _delay_loop_2(0);

      }

   //Continue again


   }



}


//The output compate interrupt handler

//We set up the timer in such a way that

//this ISR is called exactly at 1ms interval

ISR(TIMER1_COMPA_vect)

{

   clock_millisecond++;

   if(clock_millisecond==1000)

   {

      clock_second--;

      clock_millisecond=0;

      if(clock_second==-1)

      {

         clock_minute--;

         clock_second=59;


         if(clock_minute==-1)

         {

            clock_hour--;

            clock_minute=59;

         }

      }

if( clock_hour == 1 && clock_minute==0 && clock_sec)

{

//1번LED가 켜진다 

}

   }

}

.

.

.

http://www.talkingelectronics.com/pay/BEC-3/PNP-or-NPN.html

▲Transistor(=TR)을 테스트하는 방법

TR용도 : 전류가 흐르거나(PNP) 안흐를때(NPN) 동작해야만 하는 특수한 경우에 

사용된다

:C(=Collector), B(=Base), E(=Emitter)

:C(Vcc에서 들어오는 라인), B(MCU의 출력과 연결되는 라인), E(GND로 빠져나가는 라인)

 

가변저항 = Potentiometer = POT


>>

Pinout

두가지 용도로 쓸 수 있다.

1. 가변저항 : A&W를 연결하거나 W&B를 저항 양극단으로 사용하면 된다.

저항은 극성이 없다. (기본내용)

2. 센서대용으로 쓸경우

: A와 B에 각각 Vcc(+), GND(-)에 연결한다. (순서 바꿔도 상관없다.)

: W는 Potentiometer를 돌릴때마다 값이 바뀌는데 이 값을 센서의 아날로그 출력 값으로 간주하면 된다.

: 이걸 MCU(=Micro Controller Unit)의 Input에 연결하면 된다.

---------------------------------------------------------------------------------------------

+ Recent posts