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.

How to turn 0-5 volts to 5-0 volts

Status
Not open for further replies.

Markley02

New Member
I have a sensor that puts out 0-5 volts. When it is putting out 5 volts though, I need 0 volts. When it is putting out 0 volts I need 5 volts. When it is putting out 4 volts I need 2 volt.

How many volts I have : How many I need

0 : 5
1 : 4
2 : 3
3 : 2
4 : 1
5 : 0

I think you guys get the point. How can I do this?
 
Markley02 said:
I have a sensor that puts out 0-5 volts. When it is putting out 5 volts though, I need 0 volts. When it is putting out 0 volts I need 5 volts. When it is putting out 4 volts I need 2 volt.

How many volts I have : How many I need

0 : 5
1 : 4
2 : 3
3 : 2
4 : 1
5 : 0

I think you guys get the point. How can I do this?
hi,
This circuit will get the job done.
 
Last edited:
Eric, maybe the supply voltage should be 7V or more. The LM358 datasheet says VOH is Vcc-1.5, and the part does have a Darlington emitter follower for the pullup stage. I don't have any hands-on experience with these parts, but I believe it's a good idea to go with the datasheet.
 
Roff said:
Eric, maybe the supply voltage should be 7V or more. The LM358 datasheet says VOH is Vcc-1.5, and the part does have a Darlington emitter follower for the pullup stage. I don't have any hands-on experience with these parts, but I believe it's a good idea to go with the datasheet.

hi Ron,
On my earlier drawings of this circuit I used to state +8V as a supply voltage, to give that 'overhead' for +5V out.
However from the results/tests I find that the +6V will just allow a +5V limit or close to.
Also by using about +6V, the user cannot overdrive the PIC's ADCinp from a low impedance source.

Some of the earlier OPs stated they hadnt got the +8/+9v available on their projects, so I checked it out for +6V...
personally I would choose a +9V supply, as you say, these devices do vary.

Thanks for the feedback..[ if you will pardon the pun!..:) ]

EDIT: the other reason for this choice of LM358, is it accepts input voltages down to 0Vin
 
Last edited:
The circuit is inverting so the input of the opamp never goes anywhere near ground.
The LM358 was chosen because its output can go down to near ground, and a load resistor will drive it closer to ground.

Its class-A pullup current is 50uA so its minimum output voltage is +0.05V with a 1k load resistor to ground.
 
You guys are so awesome! I cannot thank everyone enough. It actually should only need to go down to about +0.3V anyway so the +0.05V will give some room to spare.

So, I should still try +6V for the supply voltage first right?
 
Markley02 said:
You guys are so awesome! I cannot thank everyone enough. It actually should only need to go down to about +0.3V anyway so the +0.05V will give some room to spare.

So, I should still try +6V for the supply voltage first right?
If you already have a 5V supply, you can use an op amp with rail-to-rail output and get within 50mV or less to +5V and GND if your op amp output is lightly loaded. However, you probably won't find one at Radio Schlock.:rolleyes:
 
Markley02 said:
So, I should still try +6V for the supply voltage first right?
The datasheet for the LM358 shows its typical output high voltage with a very low load current is about 1.2V less than its supply voltage. So with a 6V supply its max output could be +4.8V or a little more or a little less.
 
I have a sensor that puts out 0-5 volts. When it is putting out 5 volts though, I need 0 volts. When it is putting out 0 volts I need 5 volts.

How about reverting the sensor and connecting it to the 5V instead of common. No circuitry required.
 
just what i was thinking.
Cross it over.
Still, some sensors have a common connection on the casing,
but i'm sure it could be done easily
if we could see the circuit.

John :)
 
hi Markley,
If the sensor cannot be reversed, consider using a Texas OP365, rail to rail opa with a +5V supply rail, thats if you really need the end limits of the 0/+5V.

Price wise, the OP365 in the UK is about £2GBP compared to a LM358 about £0.5GBP.

If you have +9V on the project board, power the LM358 with that.
 
It has a 12 volt supply. From many sources on the web it says 0V to +5V. It is possible that it could go up to +6V. If I get close to maxing it out anyway I will just increase the diameter of the pipe and that will cause a lower reading.
 
Markley02 said:
It has a 12 volt supply. From many sources on the web it says 0V to +5V. It is possible that it could go up to +6V. If I get close to maxing it out anyway I will just increase the diameter of the pipe and that will cause a lower reading.
hi,
In that case do as I suggested in my 09:13 post of today.

That is, a OP365 with a +5V supply or the LM358 with a +8V supply, using the pdf circuit I posted previously.:)

Does that help?
 
Which circuit is more complicated? Using the OP365 or the LM358. I tried searching for OP358 and I couldn't find a datasheet.
 
Markley02 said:
Which circuit is more complicated? Using the OP365 or the LM358. I tried searching for OP358 and I couldn't find a datasheet.
hi,
Where did you get the OP358 type number from?

The circuit design is the same for the LM358 and OP365, the amplifiers have different pinouts and are DIP and SO types.
Use the correct +Vsupply voltage to suit the amp you choose.
 
Sorry, typo. You do mean OPA365 right? Not OP365? After looking at the OPA365 Datasheet (**broken link removed**, page 8 Figure 1b, I would just change the Vcm to +2.5V using the ZREF25. My question is why did you list those two resistors over the OPA365 datasheets 10K for the line going from Vin to Vout?
 
Last edited:
The 10k resistor is for negative feedback. The voltage gain of the inverting opamp circuit is the ratio of this feedback resistor to the input resistor. So the gain is -10 in this example if the source resistance is zero.
 
hi Markley,
For your application you require a Gain of *-1 for the -Vin input pin and a Gain of *2 for the +Vin input pins of the amplifier.

Relative to their respective inputs.
The -Gain = Rfeedback/Rinput
The +Gain = 1 + Rfeedback/Rinput [this is why the +Vref =+2.5V, with a gain of *2 it gives an output of +5V]

Do you follow this?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top