# support

#### Beginners Robotics Guide : OP-Amps in Robotics

by

, 03-06-2010 at 03:00 AM (19715 Views)
In this article we will have a look at Operational Amplifiers ( OP AMPS ) which are heavily used in robotics and interfacing sensors . The article is meant for people with no knowledge of Op-Amps to those who know some things about them . It starts of explaining the basics then moves to type of operations which an op-amp can perform lastly gives a few examples of where these are used in a simple robot ( line follower , fire fighting , sonar based , BEAM ).

What is an Op Amp

" The Operational Amplifier is a direct-coupled , high gain , negative feedback amplifier " - That's the technical definition complicated huh ? for some thing simple it is nothing more than a differential amplifier which amplifies the difference between two inputs . Where one input has a positive effect on the output and one has a negative .

The terminal marked - is called the inverting terminal which means signal applied there will appear phase inverted at the output while the terminal marked + is called the non inverting terminal means that the signal applied here will appear in phase and applied at the output . Please understand that the - and + do not denote any type of voltage it means that output voltage is proportional to the difference of Non Inverting and inverting voltages which isVo = V2 - V1. When there is no feed back , no voltage or capacitor between output and input the op-amp is said to be in open loop condition .

Characteristics of an ideal op-amp

An Ideal Op-Amp has the following characteristics .

* An infinite voltage gain

* An infinite bandwidth

* An infinite input resistance : The resistance b/w V1 and V2 terminals is infinite .

* Zero output resistance : Vo remains constant no matter what resistance is applied across output .

* Perfect balance : When V1 is equal to V2 the Vo is 0 .

But a practical op-amp is however non ideal .

Basic functions

An op-amp can be employed to do many different functions by connecting some extra components like capacitors and resistors to its terminals .

Inverting op-amp ( Negative scaler )

In this case the output is phase inverted . Here the gain in the output voltage is equal to R2/R1 . Also for best results the value of R3 should be equal to values of R1 and R2 in parallel ( R1 || R2 ) .

Non-Inverting op-amp ( Positive scaler )

Here the signal is applied to the non-inverting end of the op-amp hence the non-inverting amplifier and the output is a same phase signal with a gain of (r1 + r2 )/r2 . For best results source resistance should be equal to R1 || R2 .

Adder or summing amplifier

This is the circuit which is most used in analog computers . This circuits provides a means of summing the three inputs each being multiplied by a constant gain factor . For minimum error R5 = R1 || R2 || R3 || R4 .

Subtractor

The aim of the subtractor is to provide an output which is equal to the difference of the two input signals or proportional to their difference . For minimum offset error R1 || R2 = R3 || R4 .

Low Pass filter

At low frequencies the capacitor appears as open , the op amp acts as inverting amplifier . As frequencies increase the capacitive reactance decreases , the voltage gain drops and as the freq approach infinity the capacitor appears to be shorted . So voltage gain approaches zero .

Other Functions

The op-amp is also used as a diffrentiator , integrator , voltage to current and current to voltage converter etc .

Op-Amps in Robotics

Now that you are familiar with the op-amp and its basic functionality we can move on to how to use it in robots . Here we will try to stick with applications which involve digital logic .

Op-amp as a comparator

One of the basic uses of the op-amp is a comparator ... here two voltages are compared and the difference is amplified . Seeing from the subtractor circuit Vo= R2/R1 ( V2 - V1 ) So if we remove R2 , R2 will be infinity so let it be a very big number 100000 .

Example, if the + input were +3.2vDC and the - input were +3.215vDC then the output voltage will be 1000000 X the difference between the two inputs, or 1000000 X -0.015vDC = -15000vDC. Again, the amplifier cannot output a voltage beyond the supply voltages so the output will become -20vDC.

So what we have is a voltage comparator which gives out put in logic ( +5 v or 0 v ) . Now you know the principle here is how we can use it

A light / dark sensor

These type of sensors are heavily used in all types of line following / fire fighting robots . The usually contain a photo sensors and a comparator phase . Or an IR emitter / sensor combination . Usually people use IC's like LM 339 ( Specialized comparator ) or LM 324 ( Quad op amp ) This is also preferred because it can run from simple 0- 5v supply .

The above circuit is for LM324. The output of the circuit is low when the circuit is on Black tape . Adjust 20 k resistance for best results . The circuit works something like when the voltage drop across sensor > voltage drop across 20 k resistance it leads to high ( in case of the photo sensor receiving light ) and vice versa .

A battery monitor

It always better to have a small battery monitor on your robot this can be simply archived using a circuit which is something like this .

The 100 Kilo-ohm trimmer pot controls the set point of this circuit to a 'high' point like 12.5 or something, so adjust it to the point you wish the LED to light up. To monitor a 'low' point, and have the led light up when the battery has drained to a certain point, connect the led (via the 330 ohm resistor) to ground (in the blue-boxed area). The led is the high-brightness or ultra-bright type for maximum visibility. The trim pot in the schematic is a 10-turn type for better accuracy, but basically any type will do.

Op-amp as amplifier

As we know that an op-amp is a simple differential amplifier so we can use some of its these properties to amplify a low voltage signal to bring it to certain voltage levels readable by a uC .

Simple voltage amplifier

The following circuit uses the property of simple non inverting ( positive scalier ) amplification . So we can amplify the signal according to needs using the correct R1 and R2 .

These were just some of the applications of op amps there are a lot of other application and specialized books are also available in you are interested in more .