Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

OP-AMP Design help (High, Low output)

Status
Not open for further replies.

lompa

New Member
I am currently trying to make an alcohol breathalyser, i am going to use a pic as the delay on timer and also use the pic to display LEDs "drive" "dont drive". the problem is as follows

My sensor has a output of arround 2v in normal air (although i can alter this by varying the load resistor)

if you have no alcohol in your system the volage output from the sensor will drop, if you do have alcohol in your system the votage will rise.

I want to interface the op-amp to the PIC there for i need 0v = low and 5v = high inputs.

How do i make an op-amps output go to 5v when the sensor goes above 2v, and 0V when the sensor goes below 2V.

Could anyone help? if you could draw a quick schematic that would help alot

does this OP-AMP configuration have a special name i can research?

thanks for you help, its very much appreciated
 
It's called a comparator - if you use a PIC16F628, that already has them internally!. Or you could use a 16F819, which has 10 bit A2D, and read the sensor directly.

Various other PIC's have similar facilities!.
 
im using pic basic what probably isnt good enough to do this, as i cannot find any info on comparators in the help files.

The aspect i find hard to understand is how i can make the op-amps output flick from 0v to 5V and vice versa with only small input changes?

Thanks

Nigel you should get a medal for your work on this forum, thanks
 
lompa said:
im using pic basic what probably isnt good enough to do this, as i cannot find any info on comparators in the help files.

As I always say, you can't use a high level language effectively without a knowledge of assembler, which forces you to know the hardware you're using. if your PIC BASIC can use inline assembler, you may be able to do it like that - or perhaps even from BASIC itself, you would probably need to ask in a PIC BASIC group.

The aspect i find hard to understand is how i can make the op-amps output flick from 0v to 5V and vice versa with only small input changes?

Have a look at for some good info on opamps, in particular look at figure 12, which uses a 741 as a comparator.

Basically, a comparator compares one input with another, the output can be either high or low, nothing else! - the high gain of the opamp guarantees this. It's also common practice to add a little positive feedback, something like a 10Mohm resistor from output to non-inverting input - this makes the output 'snap' much better.
 
The output from your sensor is probably not stable, ie affected by humidity etc. It will be difficult to have a reference voltage to compare the output to, therefore an ADC would be the best way to go. You could store the reference number and compare to the test value easily.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top