Tag Archives: OPAMP

Use a Comparator or Op-Amp to Simplify Light Dependent Resistor Output

If your project calls for light sensitivity, it’s hard to beat light dependent resistors (LDRs), also known as photoresistors. They’re available for a few cents each, and their resistance varies based on how much light they receive. In the dark, these devices produce resistances in the megohm range, and can fall to hundreds of ohms or even less when exposed to sufficient light. You first instinct when prototyping this type of device is likely to use an analog input on an Arduino or similar dev board to sense voltage levels. This works quite well in many situations, but you may also want to consider a comparator or operational amplifier (op-amp) to turn this analog input into a simple on/off signal. You could also use one of these components by itself to produce a usable output without the use of a microcontroller.

LDR Analog Input to Microcontroller

An LDR setup for Arduino Analog Input. Illustration: Jeremy S. Cook in Fritzing

First, let’s examine how a microcontroller would see an LDR input. Using the circuit illustrated in the figure above with an Arduino Uno, an LDR is attached to 5VDC, then routed to the analog input A0. Voltage at the intersection of A0, the resistor, and LDR is divided between the fixed resistor and LDR, which decreases its resistance as light is applied. Voltage at this analog input increases with the lowered resistance in proportion to the amount of light the LDR sees.

The Arduino board is thus able to sense the resulting voltage level and convert it to an analog value. A threshold can be setup to respond to different light levels as on or off, or the analog signal can be used for proportional control. Note that the resistor in this illustration is just a placeholder; it would need to be adjusted based on your LDR sensitivity. You can also use a trimming resistor to tweak output values as needed.

Comparator Digitizes Analog Signal

What if you need light input, but just want an on/off value? Analog inputs can handle this programmatically, but if you’re using an Arduino Uno you’re restricted to the 6 analog pins. There’s also the normally minor issue of additional program complexity. If you need more performance out of your setup, you could turn to a comparator, or operational amplifier (op-amp) set up to act as one, to convert this analog value into a simple on/off signal.

Caption: An LDR and LM358 Op-amp setup to detect light as a binary signal to an Arduino Uno Illustration: Jeremy S. Cook in Fritzing

For example, if you were going to use an LM358 op-amp and LDR to detect light, you could tie the V+ (pin 8) to the 5V supply of your Arduino, ground (pin 4) to the Arduino’s ground, and output A (pin 1) to a digital pin on your Arduino board. The inverting input (pin 2) would be hooked to a voltage divider between +5V and ground, and your LDR would be setup in a voltage divider on the non-inverting input (pin 3). Here the LDR would act as the resistor from +5V to the op-amp input, and the set resistor would run to ground.

This will give you an on/off input to your Arduino without mucking about with any extra programming. Note that because of the way this op-amp operates, the output will be less than 5V, but will be sufficient to trigger the needed input. Obviously this will add some wiring complexity—more work than a few lines of code—so it’s not ideal in all situations.

Comparator Sans Arduino

You’re probably wondering at this point why you wouldn’t simply get a dev board capable of more analog inputs if that’s what is needed. After all, hooking up additional wiring or adding more complication to your PCB isn’t trivial. Certainly there are some applications that call for this, but for really simple electronics, you may not need a microcontroller at all.

Caption: An LDR and LM358 Op-amp setup to turn an LED on when there isn’t sufficient light available.
Illustration: Jeremy S. Cook in Fritzing

One such simple application would be a light that you want to come on when the ambient light drops below a certain threshold. In this application, you’d want to put the resistors only voltage divider on the non-inverting input (pin 3), while the LDR voltage divider would be placed on the inverting input (pin 2). This would cause the voltage on pin 2 to be larger than pin 3 when the light is on, turning the output (pin 1) on when there isn’t enough light.

Of course LDRs are but one type of sensor, and there are many models of op-amps and comparators with different characteristics available depending on your needs. If you’re just starting out with sensors and electronics, using a dev board like an Arduino is a great choice. As you advance in your knowledge, you might also consider analog electronics for your builds. While not appropriate or necessary for every project, it’s a great tool to have available when purely digital processing doesn’t quite fit your application.

Jeremy S. Cook and Zach Wendt are engineers who enjoy sharing how electronic components can best impact applications. Jeremy writes for a variety of technical publications. Zach works for Arrow Electronics, a major supplier of Arduino products.

How to make precision measurements on a nanopower budget

Gen Vansteeg @ ti.com discuss about precision measurement for nanopower scale using OPAMPs.

Heightened accuracy and speed in an operational amplifier (op amp) has a direct relationship with the magnitude of its power consumption. Decreasing the current consumption decreases the gain bandwidth; conversely, decreasing the offset voltage increases the current consumption.

Many such interactions between op amp electrical characteristics influence one another. With the increasing need for low power consumption in applications like wireless sensing nodes, the Internet of Things (IoT) and building automation, understanding these trade-offs has become vital to ensure optimal end-equipment performance with the lowest possible power consumption. In the first installment of this two-part blog post series, I’ll describe some of the power-to-performance trade-offs of DC gain in precision nanopower op amps.

How to make precision measurements on a nanopower budget – [Link]

Op amps, comparators – smaller than ever

@ eeworldonline.com discuss about TI’s tiny OPAMP and comparators.

Texas Instruments introduced the industry’s smallest operational amplifier and low-power comparators at 0.64 mm2. As the first amplifiers in the compact X2SON package, the TLV9061 op amp and TLV7011 family of comparators enable engineers to reduce their system size and cost, while maintaining high performance in a variety of Internet of Things (IoT), personal electronics and industrial applications, including mobile phones, wearables, optical modules, motor drives, smart grid and battery-powered systems.

Op amps, comparators – smaller than ever – [Link]

Universal OpAmp Evaluation Board Using LMV321

The Universal Op-Amp Development board is a general purpose blank circuit board that simplify prototyping circuits for a variety of Op-Amp circuits. The evaluation module board design allows many different circuits to be constructed easily and quickly. This board supports single SOT23-5 package. Universal single Operational Amplifier (Op-Amp) board is designed to aid in the evaluation and testing of the low voltage/low power and some precision operational amplifiers.

Universal OpAmp Evaluation Board Using LMV321 – [Link]

Micropower, Rail-to-Rail, 300kHz Op Amp with Shutdown in tiny package

Op Amp Consumes Only 4.5µA and Offers 300kHz BW in 0.73mm x 1.07mm WLP and SOT-23 package.

The MAX40006 op amp features a maximized ratio of gain bandwidth (GBW) to supply current and is ideal for battery-powered applications such as handsets, tablets, notebooks, and portable medical equipment. This CMOS op amp features an ultra-low input-bias current of 1pA, rail-to-rail input and output, low supply current of 4.5µA, and operates from a single 1.7V to 5.5V supply.

Micropower, Rail-to-Rail, 300kHz Op Amp with Shutdown in tiny package – [Link]

LTC2063 – 2μA Supply Current, Zero-Drift Operational Amplifier

The LTC2063 is a single low power, zero-drift, 20kHz amplifier. The LTC2063 enables high resolution measurement at extremely low power levels. Typical supply current is 1.4μA with a maximum of 2μA. The available shutdown mode has been optimized to minimize power consumption in duty-cycled applications and features low charge loss during power-up, reducing total system power.

The LTC2063’s self-calibrating circuitry results in very low input offset (5μV max) and offset drift (0.02μV/°C). The maximum input bias current is only 20pA and does not exceed 100pA over the full specified temperature range. With its ultralow quiescent current and outstanding precision, the LTC2063 can serve as a signal chain building block in portable, energy harvesting and wireless sensor applications.

LTC2063 – 2μA Supply Current, Zero-Drift Operational Amplifier – [Link]

TI claims first for zero-drift, zero-crossover op amp: precision & linearity

by Graham Prophet @ edn-europe.com:

With precision and high input linearity in a single high-performance device, Texas Instruments says it has the first operational amplifier (op amp) to offer both zero-drift and zero-crossover technology. The OPA388 op amp maintains high precision across the entire input range for a variety of industrial applications, including test and measurement, medical and safety equipment, and high-resolution data-acquisition systems.

TI claims first for zero-drift, zero-crossover op amp: precision & linearity – [Link]

Constant Current Laser Diode Driver Circuit Using OPA2350 OpAmp

The voltage-controlled current source circuit can be used to drive a constant current into a signal or pump laser diode. This simple linear driver provides a cleaner drive current into a laser diode than switching PWM drivers. The basic circuit is that of a Howland current pump with a current booster (Q1) on the output of a R-R CMOS OPA2350 op amp (U1). Laser diode current is sensed by differentially measuring the voltage drop across a shunt resistor (RSHUNT) in series with the laser diode. The output current is controlled by the input voltage (VIN) that comes from Trim pot PR1.

Features

  • Supply 3,3V DC
  • Load Up to 300mA
  • PR1 Trimpot Current Adjust

Constant Current Laser Diode Driver Circuit Using OPA2350 OpAmp – [Link]

RELATED POSTS

DIY ECG with 1 op-amp

IMG_7570-1-640x480

A DIY ECG made from single op-amp (LM741) and 5 resistors by Scott Harden:

I made surprisingly good ECG from a single op-amp and 5 resistors! An ECG (electrocardiograph, sometimes called EKG) is a graph of the electrical potential your heart produces as it beats. Seven years ago I posted DIY ECG Machine on the Cheap which showed a discernible ECG I obtained using an op-amp, two resistors, and a capacitor outputting to a PC sound card’s microphone input.

DIY ECG with 1 op-amp – [Link]

Sensing current on the high side

hisideDiffAmp

Michael Dunn@ edn.com discuss about current sense on the high side of power source.

At their heart, the majority of DC current sense circuits start with a resistance in a supply line (though magnetic field sensing is a good alternative, especially in higher-current scenarios). One simply measures the voltage drop across the resistor and scales it as desired to read current (E = I × R (if I didn’t include this, someone would complain)). If the sense resistor is in the ground leg, then the solution is a simple op-amp circuit. Everything stays referenced to ground, and you only have to be careful about small voltage drops in the ground layout.

Sensing current on the high side – [Link]