Op Amp as Voltage Follower?
Jeff Dege
Posts: 85
Playing around with the Pocket Watch B, I tried out the circuit and the sample BS2 code from their datasheet.
They have the ALARM pin from the Pocket Watch connected to an input on the Stamp and through an LED to ground.
They don't have a resister in series with the LED, because "the ALARM pin is internally current limited".
Problem is that with the LED in place, the Stamp never recognized that the pin was high. So I added a resister to reduce the current through the LED, and the Stamp recognized the high. But the LED was lit very dimly. And it stayed lit dimly even after I'd reset the alarm on the Pocket Watch. I played around with a number of resister values, and never found one that would have both the Stamp input pin and the LED working correctly together.
I'm also playing around with the "Understanding Signals" text, and the chapter on Op Amps pointed me to your "Basic Analog and Digital" book. Which has one example in which an Op Amp is used as a "Voltage Follower".
Am I right in thinking that this might be a reasonable solution for problems like the above issue, where the Pocket Watch's ALARM pin can't seem to drive both the Stamp input pin and the LED at the same time? Assuming, of course, that there was some reason why couldn't have the Stamp use a spare output pin to light the LED whenever it saw the ALARM pin go high.
If so, would you have the Op Amp drive the LED? Or the Stamp pin?
They have the ALARM pin from the Pocket Watch connected to an input on the Stamp and through an LED to ground.
They don't have a resister in series with the LED, because "the ALARM pin is internally current limited".
Problem is that with the LED in place, the Stamp never recognized that the pin was high. So I added a resister to reduce the current through the LED, and the Stamp recognized the high. But the LED was lit very dimly. And it stayed lit dimly even after I'd reset the alarm on the Pocket Watch. I played around with a number of resister values, and never found one that would have both the Stamp input pin and the LED working correctly together.
I'm also playing around with the "Understanding Signals" text, and the chapter on Op Amps pointed me to your "Basic Analog and Digital" book. Which has one example in which an Op Amp is used as a "Voltage Follower".
Am I right in thinking that this might be a reasonable solution for problems like the above issue, where the Pocket Watch's ALARM pin can't seem to drive both the Stamp input pin and the LED at the same time? Assuming, of course, that there was some reason why couldn't have the Stamp use a spare output pin to light the LED whenever it saw the ALARM pin go high.
If so, would you have the Op Amp drive the LED? Or the Stamp pin?
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
Ryan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ryan Clarke
Parallax Tech Support
RClarke@Parallax.com
Possibilities:
- Trying to teach about Op Amps, rather than to design an economic circuit
- Sold with a parts kit that already had an Op Amp, and didn't have a transistor.
· Why some people won't take that big step and buy a couple is beyond me (they've bought their "wambo" kit and that's the extent of their commitment -- no mas.)
· Commonly I propose this in response to questions like when·someone wants to know·whether it's OK to·source 100mA from a STAMP pin.· (But, isn't there an IC... ?)
· Oh, well.
What's a Microcontroller (which usually comes before BASIC Analog and Digital) shows an example of using a transistor that's similar to the 2N2222 to drive an (LED) current load.
Yes, in that particular book, the LED is just an inexpensive way to demonstrate that a circuit can load down a DAC output, but be driven correctly by the opamp buffer. In hindsight, I wish I had added a few different output loads that would have demonstrated the distinction more clearly.
Your guess that the book had to go with an existing kit was also pretty close to the mark. I was a summer intern when I started working on Basic Analog and Digital, which at the time was already a manuscript and kit. Rewriting the book from scratch to make it fulfill some "pre-engineering" requirements was an option, but foraging for new parts was not.
While transistors can be connected in various ways that mirror voltage output, there are a lot of extra rules and exceptions. In general, a transistor is like a valve that allows current through two terminals (usually the first and third). The second terminal controls the current. Depending on the flavor of transistor, it either requires some voltage or current to open the valve. The more current/voltage into that second terminal, the more current it lets pass into terminal 1 (and back out terminal 3).
Transistors typically have "off" ranges, where you can change the input voltage/current slightly, but no change appears at the outputs. Transistors also have input ranges where you can increase the input current/voltage, but the output current just won't go any higher.
In between those two input ranges, you can get some linear response to input at the output. By taking the various attributes of your transistor into account, you can build some pretty reliable voltage follower circuits, but it seems to me that it takes a lot more study and experimentation to get to the point where you can voltage-buffer a DAC's output with confidence using just transistors.
By switching the input current/voltage from a transistor's off input region to its saturation input region, the transistor makes a good current switch. And, transistors can amplify the small input current/voltage into a much larger current through their output terminals. In effect, the transistor becomes a current on/off switch. Combinations of transistors can make even better switches (like the Darlington configuration mentioned earlier in this thread). Of course, the opamp in your voltage follower is probably nothing more than thirty-some-odd transistors connected in three separate stages.
Anyhow, there's lots you can do with transistors. For Stamps in Class examples, check out the PDFs for What's a Microcontroller, Applied Sensors, Industrial Control, and Experiments with Renewable Energy. With the transistor part numbers from those PDF examples, you can search the Parallax site to find more. The forums also have lots of transistor circuits, and Google will also lead you to thousands of different transistor apps.
Same deal with opamp's, there's lots more than the voltage follower from What's a Microcontroller and the two amplifier circuits from Understanding signals. Anyhow, have fun and keep on experimenting with different circuits and programs. Always expanding your bag of tricks is the key to making inventing and projects go more smoothly.