336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

Arduino 드라이버가 안잡히는 당혹스런 상황에서

해결책을 적어봤습니다.











Posted by ElectricShock
:
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.


Naver

[폐루프이득 공식]  :: Closed Loop Gain (▶LINK)



자세교정의자 컨셉 (OP AMP 관련)

http://electronicdesign.com/ideas-design/efficiently-design-op-amp-summer-circuit

▲OP Amp 설계 사이트

http://evalidate.freehostia.com/op-amp/summingAmplifier/summingAmplifierTheory.html

▲Non-Inverting Input 직전의 Junction은 Virtual GND가 된다.


OP07CP사용법

OP07CP연결법(1).txt

출력이 좋지만 Output이 반전된다.

OP07CP연결법(2).txt

저항비율을 잘 맞춰주지않으면 부품이 탈 수도 있으니 주의




FLX-A301-A.pdf

▲압력센서 DataSheet

압력센서 동작원리 : 압력이 높아짐에 따라서 저항값이 달라진다. (=Resistance value is variable according to the pressure)

Default가 약 100MΩ, 누르면 약 10KΩ 으로 작아진다.

연결법

1,2번핀에 100k

2번핀을 뽑아서 압력센서를 거쳐서 GND (=Rs)

3번핀은 GND (증폭기의 +입력단)

1번핀은 출력

기본적으로 Vdd, Vss부터 연결할것


MCP6001.pdf

▲증폭기 DataSheet (Single, Dual, Quad로 나뉜다. 각각 6001,6002,6004)

주로 비반전 증폭기 위주로 정리되어있다.






http://www.electronics-tutorials.ws/opamp/opamp_2.html

▲반전증폭기

As we are not using the positive non-inverting input 

this is connected to a common ground or zero voltage terminal as shown below, 

As 우리가 사용하지않으면서 positive 비반전 입력을

이건 연결된다. to a COM GND 혹은 Zero Voltage Terminal에 as 아래처럼,

but the effect of this closed loop feedback circuit 

results in the voltage potential 

at the inverting input being equal to that 

at the non-inverting input 

producing aVirtual Earth summing point 

because it will be at the same potential as the grounded reference input.

but the 효과 of 이 폐루프 피드백 회로

는 결과를 낳는다. in the 전위를

at the 반전입력에서 being 같게되는 to that 

at the 비반전 입력에서

양산하는 a 가상 접지 합류지점과

because 그건 will be at the 같은 전위가 될것이기 때문이다. as the 접지된 참조 입력과 같이.



In other words, the op-amp becomes a “differential amplifier”.


In this Inverting Amplifier circuit 

the operational amplifier is connected with feedback to produce a closed loop operation. 

When dealing with operational amplifiers 

there are two very important rules to remember about inverting amplifiers, 

these are: “No current flows into the input terminal”and that “V1 always equals V2”

However, in real world op-amp circuits both of these rules are slightly broken.


This is because the junction of the input and feedback signal ( X ) 

is at the same potential as the positive ( + ) input 

which is at zero volts or ground then, 

the junction is a “Virtual Earth”

Because of this virtual earth node 

the input resistance of the amplifier is equal to the value of the input resistor, Rin 

and 

the closed loop gain of the inverting amplifier 

can be set by the ratio of the two external resistors.

폐루프 이득은... of the 비반전증폭기의

...can be 셋된다. by the 비율에 의해 of the 2개의 외부 저항들에 의해.

We said above that there are two very important rules to remember about Inverting Amplifiers or any operational amplifier for that matter and these are.

  • 1.  No Current Flows into the Input Terminals
  • 2.  The Differential Input Voltage is Zero as V1 = V2 = 0 (Virtual Earth)

Then by using these two rules 

we can derive the equation for calculating the closed-loop gain of an inverting amplifier, 

using first principles.

두개 룰을 사용함으로써

우린 can 유도할수있다. the 방정식을 for 계산하기위해 the폐루프 이득을of an반전 증폭기의, 

사용하며 첫번째 공식을.

Current ( i ) flows through the resistor network as shown.


아래 공식을 보기전에 알아야할것들

저항들이 직렬이다.

KVL에 의해 저항의 합은 0이 되야하므로 Vin-Vout이 성립된다.

V=IR 공식을 기반으로 간략화 시키고 있다.

V2는 Voltage potential에 의해 V1과 같아지므로 0V가 된다.





출력전압을 기준으로 깔끔하게 정리하면 아래와 같다. (반전 증폭기의 Gain)




The negative sign in the equation 

indicates an inversion of the output signal 

with respect to the input as it is 180o out of phase.

마이너스 부호 in the 방정식에서

는 가리킨다. an 반전을 of the 출력 신호의 

with respect to input as 그게 180˚일때 out of phase밖으로.

(with respect to : ~에 관련하여)

This is due to the feedback being negative in value.

The equation for the output voltage Vout 

also shows that 

the circuit is linear in nature for a fixed amplifier gain 

as Vout = Vin x Gain. 

This property can be very useful for converting a smaller sensor signal to a much larger voltage.

이건 due to the 피드백에 인해서이다. being negative 되는

The 방정식 for the 출력 전압 Vout

또한 보여준다. that

the 회로는 선형이다.

as Vout = Vin x Gain.

이 특성은 can be 매우 유용하다 .for 변환시키는데 a 작은 센서 시그널을 to a 더 큰 전압으로.

Another useful application of an inverting amplifier 

is that of a “transresistance amplifier” circuit. 

ATransresistance Amplifier also known 

as a “transimpedance amplifier”, is basically a current-to-voltage converter 

(Current “in” and Voltage “out”). 

They can be used in low-power applications 

to convert a very small current 

generated by a photo-diode or photo-detecting device etc, 

into a usable output voltage which is proportional to the input current as shown.

다른 유용한 응용 of an 반전 증폭기의

은 that of a "Transresistance 증폭기" 회로이다.

Transresistance 증폭기 는 또한 알려져있다. 

as a "transimpedance 증폭기" 가 기본적으로 a 전류to전압 변환기

(전류 입력 and 전압 출력).

그것들은 can be 사용될수있다. in 저전력 응용들에서 

to 변환시키기위해 a 매우 작은 전류를

만들어진 by a photo-diode에 의해  etc,

into a 사용가능한 출력 전압으로 which is 비례항 to the 입력 전류에 as 보이듯이.


▼Photo Diode가 빛을 받으면 GND의 입력이 반저증폭기로 흘러들어간다.(-입력)

V=IR공식에 의해서 Vout = -Is x Rf 가 산출된다. (Rf가 출력에 크게 관여한다는걸 알 수 있다.)

The simple light-activated circuit above, 

converts a current generated by the photo-diode into a voltage.

The feedback resistor  sets the operating voltage point at the inverting input and controls the amount of output.

The output voltage is given as Vout = -Is x Rƒ.

Therefore, the output voltage is proportional to the amount of input current 

generated by the photo-diode.

따라서, the 출력 전압은 비례항이다. to the 량 of 입력전류에

발생된 by the 포토-다이오드에 의해.


중요내용 ▼

Inverting Op-amp Example No1

Find the closed loop gain of the following inverting amplifier circuit.



Using the previously found formula for the gain of the circuit

we can now substitute the values of the resistors in the circuit as follows,

Rin = 10kΩ  and  Rƒ = 100kΩ.

and the gain of the circuit is calculated as    -Rƒ/Rin = 100k/10k = -10.

therefore, the closed loop gain of the inverting amplifier circuit above is given -10 or 20dB(20log(10)).

(데시벨 계산은 20log(Gain) 이다....참고로 Gain이 40이면 데시벨은 20log(40)에 의해 약 32dB이 된다.)

==================================================================

http://www.circuitstoday.com/log-amplifier

▲Log Amplifier (Diode와 TR을 쓰는 방법이 있다. TR은 NPN을 쓴다.)

▲사이트안의 Common Base의 경우 TR의 그림이 잘못되어있다.

▲Common Base(Base가 GND인 경우), NPN, PNP 모두 

전류가 Emitter → Collector로 흐른다.



스마트 열방석 ㅇㅅㅎ ㅎㄴㄷ


부품리스트

Arduino (7500원)

LM301AN (증폭기) (800원)

DS1E-M-DC5V (4000원)

USB (500원)

HC-06 (6000원)

압력센서 IEFSR 15(13200원)

정류다이오드



V+ : VCC

V- : GND

2번핀 : 반전입력

3번핀 : 비반전입력

6번핀 : OUTPUT


릴레이설명

http://instructables.tistory.com/29


압력센서 저항은 1MΩ이고 압력이 가해질수록 저항이 0에 가까워진다.

이때 압력센서는 FeedBack 저항에 해당한다.

위에서 반전 공식에 입각하면 -Rf/Rin 에 의해 -100의 Gain을 갖게된다.

즉 증폭률이 100이다.


이렇게 증폭된 아날로그 값이 Arduino의 A0로 들어가면

조건에 의해 Digital 10,11,12번 핀이 모여서 출력으로 나간다.

선을 모은이유는 병렬일때 전압을 5V그대로이지만 전류가 세지므로 릴레이를 동작시킬때 효과적이다.

부가적으로 Rectifier(=정류다이오드)를 써서 좀더 효율적으로 회로를 설계했다. (역전류방지)

1N4001~1N4009 사이에 해당하는 모델중 아무거나 쓰면 된다.



5V → 3.5V (압력을 가하면)











자세교정 신발 (ㄱㅂㅇ ㅈㅇㄷ)

자세교정신발 회로도.egg




노이즈 캔슬링 회로도

https://electronics.stackexchange.com/questions/131350/noise-cancelling-headphone-concept



'졸업작품 > 자세교정 의자' 카테고리의 다른 글

자세교정의자 회로도  (0) 2016.04.11
Posted by ElectricShock
:
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

http://extremeelectronics.co.in/avr-tutorials/using-the-usart-of-avr-microcontrollers/

▲레지스터 정리

http://extremeelectronics.co.in/avr-tutorials/using-the-usart-of-avr-microcontrollers-reading-and-writing-data/

▲Reading and Writing Data


(▼AVR Studio 기반)

ATmega8 (USART Test).txt


ATmega128(USART Test).txt


.

.

.

USART of AVR Microcontrollers.

The USART of the AVR is connected to the CPU by the following six registers.

*UDR – USART Data Register

 : Actually this is not one but two register but when you read it you will get the data stored in receive buffer and when you write data to it goes into the transmitters buffer. This important to remember it.

:실질적으로 이건 not one이다. but 두개 레지스터이다.
but when 네가 읽었을때 이걸, 넌 will 얻을것이다. the data를 저장된 in receive버퍼내에,
ane when 네가 썼을때 data를 to it에, 진입해라. the transmitters버퍼로.
이건 중요하니 기억해라.
ATmega128에서는 UDR0로 바꿔준다.

*UCSRA – USART Control and status Register A

 : As the name suggests it is used to configure the USART and it also stores some status about the USART.  There are two more of this kind the UCSRB and UCSRC.

:이름이 제안하듯이, 이건 사용된다. to 구성하기위해 the USART를

and it 또한 저장한다. some 상태를 about the USART에 대한.
두개 더 있다. of 이런 종류가 UCSRB와 UCSRC.
ATmega128에서는 UCSR0BUCSR0C로 바꿔준다.


*UBRRH and UBRRL

 : This is the USART Baud rate register, it is 16BIT wide so UBRRH is the High Byte and UBRRL is Low byte. But as we are using C language it is directly available as UBRR and compiler manages the 16BIT access.

이건 USART Baud Rate 레지스터이다.
이건 16비트 wide이다. so UBRRH는 하이 바이트, UBRRL은 로 바이트이다.
But as 우리가 사용하면서 C언어를, 이건 바로 사용가능하다. as UBRR로.
and 컴파일러는 다룬다. the 16비트 접근을.

ATmega128에서는 UBRR0HUBRR0L로 바꿔준다.


So the connection of AVR and its internal USART can be visualized as follows.


▲USART에서 사용되는 레지스터들

UDR, UCSRA, UCSRB, UCSRC, UBRRH, UBRRL.

★BaudRate설정관련 비트는 (링크) 참고,......UBRRH와 UBRRL을 사용한다.



Registers Explained

In order to write programs that uses the USART 

you need to understand what each register’s importance.

레지스터의 뭐가 중요한지 이해해야한다.

The scheme behind using the AVR USART 

is same as with any other internal peripheral (say ADC).

So if you are new to this topic please see this tutorial

it shows you the basic idea of using peripherals.

I am not going to repeat what is already there in the datasheets, 

I will just tell about what is required for a quick startup. 

The datasheets of AVR 

provides you 

with all the details of every bit of every register 

so please refer to it for detailed info. 

Note bit names with RED background are of our interest here.


UDR : Explained above.

2개의 레지스터로 구성되어있다.

읽으면 data가 저장된다. in Receive Buffer에.

쓰면 data가 빠져나간다. into the Transmit Buffer에.

UCSRA : USART Control and Status Register A

▼아래 비트들은 임무가 완료되면 각각 Set(=1) 된다.

그리고 program이 UDR을 새로 작성한다.

RXC : this bit is set when the USART has completed receiving a byte 

from the host 

(may be your PC) and the program should read it from UDR

TXC : this bit set (1) when the USART has completed transmitting a byte 

to the host 

and your program can write new data to USART via UDR


▼데이터시트에서 뽑아온 UCSRnA 정보이다.

RXCn::This flag bit is set when there are unread data in the receive buffer and cleared when the receive buffer is empty.

TXCn::The TXCn flag bit is automatically cleared when a transmit complete interrupt is executed.

UDREn::(USART Data Register Empty)::If UDREn is one, the buffer is empty

FEn::(Frame Error)::Always set this bit to zero when writing to UCSRnA.

DORn::(Data OverRun)::

A data overrun occurs when the receive buffer is full (two characters)

Always set this bit to zero when writing to UCSRnA.

UPEn: Parity Error







UCSRB: USART Control and Status Register B

RXCIE: Receive Complete Interrupt Enable – When this bit is written one the  associated interrupt is enabled.

이 비트가 씌였을때 1로, the 할당된 인터럽트가 Enable 된다. (특수한 경우에 쓰임)

TXCIE: Transmit Complete Interrupt Enable – When this bit is written one the associated interrupt is enabled.

이 비트가 씌였을때 1로, the 할당된 인터럽트가 Enable 된다. (특수한 경우에 쓰임)

RXEN: Receiver Enable - When you write this bit to 1 the USART receiver is enabled.

이 비트가 씌였을때 1로, USART 리시버가 enabled된다.

The normal port functionality of RX pin will be overridden. 

So you see that the associated I/O pin now switch to its secondary function,i.e. RX for USART.

이 비트를 쓰면 to 1로, the USART리시버는 enabled된다.

TXEN: Transmitter Enable – As the name says!

UCSZ2: USART Character Size – Discussed later.

For our first example we won’t be using interrupts so we set UCSRB as follows

UCSRB=(1<<RXEN)|(1<<TXEN);






UCSRC: USART Control And Status Register C

IMPORTANT : The UCSRC and the UBRRH (discussed below) register 

shares same address 

so to determine which register user want to write 

is decided with the 7th(last) bit of data 

if its 1 then the data is written to UCSRC else it goes to UBRRH.

This seventh bit is called the


URSEL: USART Register Select.

UMSEL: USART Mode Select 

– This bit selects between asynchronous and synchronous mode. 

As asynchronous mode is more popular with USART 

we will be using that.

USBS: USART Stop Bit Select 

– This bit selects the number of stop bits in the data transfer.

UCSZ: USART Character size 

– These three bits (one in the UCSRB) 

selects the number of bits of data 

that is transmited in each frame. 

Normally the unit of data in MCU 

is 8BIT (C type "char") 

and this is most widely used 

so we will go for this. 

Otherwise you can select 5,6,7,8 or 9 bit frames!

So we set UCSRC as follows

UCSRC=(1<<URSEL)|(3<<UCSZ0);

UBRR: USART Baud Rate Register:

This is the USART Baud rate register, it is 16BIT wide 

so UBRRH is the High Byte and UBRRL is Low byte. 

But as we are using C language 

it is directly available as UBRR and compiler manages the 16BIT access. 

This register is used by the USART to generate the data transmission at specified speed (say 9600Bps). 

To know about baud rate see the previous tutorial. UBRR value is calculated according to following formula.

Where fosc is your CPU frequency say 16MHz

Baud Rate is the required communication speed say 19200 bps (see previous tutorial for more info).

Example:

For above configuration our UBRR value comes to be 51.083 so we have to set

UBRR=51;

in our initialization section. Note UBRR can hold only integer value. So it is better to use the baud rates that give UBRR value that are purely integer or very close to it. So if your UBRR value comes to be 7.68 and you decided to use UBRR=8 then it has high error percentage, and communication is unreliable!

You may also use our Androd App for calculating the UBRR much easily ! It can run on Smartphones and Tablets running Android OS.

Posted by ElectricShock
:

BLOG main image
잡동사니들(지극히 개인취향인...) (다른글에도 댓글 부탁해요♥) You May Leave English Messages on GuestBook. by ElectricShock

공지사항

카테고리

분류 전체보기 (782)
MiDi (2)
Programming(=프로그래밍) (3)
Animation (4)
Blender (3D Graphic Program.. (10)
Blendtuts.com (Series) (1)
Blender 기초 팁들 (2)
Processing (디지털미디어과) (2)
Music (1)
Books in the world (0)
Communication(CAN, UART, et.. (12)
MCU Examples (PIC 기반) (7)
Transistor (1)
Mikro C Pro (11)
Mikro Pascal (1)
Proton IDE (0)
Robot (0)
Swift 3D (1)
Dummies Series (1)
All about Hacking (0)
제2 외국어 (1)
PIC 해외서적들 (3)
AVR (25)
PIC (MikroC) (MPLAB) (4)
Assembly (2)
ARM (3)
Arduino (26)
PSpice (1)
Proteus ISIS (14)
CodeVision (2)
FPGA (15)
MPLAB (24)
PCB (the Procedure) (15)
3D Printer (5)
PICKIT3 (6)
Matlab (11)
RaspBerry PI (15)
BeagleBone (1)
Android Studio (17)
졸업작품 (172)
Korea History (0)
Issue(사회) (73)
Multimeter 리뷰 (1)
Oscilloscope (1)
A (34)
B (19)
J (6)
C (32)
P (12)
T (37)
H (12)
I (12)
M (44)
R (5)
E (5)
F (2)
D (9)
O (2)
L (7)
S (9)
W (2)
V (6)
G (14)
Visual C++ or Visual Studio (2)
Android App Development (0)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백