Pages: [1] 2   Go Down
 Author Topic: converting 0..-7Vdc to 0..+5Vdc  (Read 1374 times) 0 Members and 1 Guest are viewing this topic.
whistler
Guest
 « on: July 29, 2010, 05:56:59 am » Bigger Smaller Reset

I need to interface a piece of kit that outputs 0..-7Vdc to the Arduino ADC.
I'm currently modelling this (in ltspice) with just a simple inverting opamp (LT1490) with 0.7 gain.  HOWEVER I'm told that although ltspice seems to suggest it's fine, in reality using a single supply (+5Vdc) opamp *may* not work with the -7Vdc input - is this correct?
 « Last Edit: July 29, 2010, 05:58:18 am by whistler » Logged

Manchester (England England)
Offline
Brattain Member
Karma: 438
Posts: 28741
Solder is electric glue
 « Reply #1 on: July 29, 2010, 07:24:11 am » Bigger Smaller Reset

Quote
opamp *may* not work with the -7Vdc input - is this correct?

This is not correct it defiantly will not work. Where will this negative power come from?
An op-amp can only set it's output between the power supply rails it has so you can't even get +7V from it if it is only being fed with +5V.

You need a voltage inverter or voltage mirror. Something like the MAX202 has this sort of circuit in. Basically is is an oscillator and a capacitor ladder. However you are restricted to a few tens of mA with this sort of circuit. How much current do you need?
 Logged

SW Scotland
Offline
Edison Member
Karma: 10
Posts: 1181
Arduino rocks
 « Reply #2 on: July 29, 2010, 07:36:21 am » Bigger Smaller Reset

There's a much easier way.  Use a simple voltage divider resistance network.  By way of example connect 2 resistors in series, say 3.3kohms and 8.25kohms.  Connect the 3.3/8.25 junction to the input of the Arduino.  The 7 volts goes between the free end of the 3.3k and the free end of the 8.25k.  This same end of the 8.25k is the ground or 0volt connection to the Arduino.

With 7 volts input, the arduino gets 7*8.25/(3.3+8.25)  =  5 volts

8.25 isn't a standard value but you can make it up by using a combination of resistors in series and parallel. 12k and a 1.2k in series gives 13.2k.  A 13.2k in parallel with 22k gives the required 8.25k

jack
 Logged

Manchester (England England)
Offline
Brattain Member
Karma: 438
Posts: 28741
Solder is electric glue
 « Reply #3 on: July 29, 2010, 07:37:48 am » Bigger Smaller Reset

@ jackrae

I think you misread what he wants to do. He wants to generate a negative 7v from a positive 5v rail.
 « Last Edit: July 29, 2010, 07:38:12 am by Grumpy_Mike » Logged

SW Scotland
Offline
Edison Member
Karma: 10
Posts: 1181
Arduino rocks
 « Reply #4 on: July 29, 2010, 07:40:37 am » Bigger Smaller Reset

Oops,

My calculations does not take into account the input impedance of the arduino circuit board.  However if you take this impedance as the input load ( 8.25k in my example) you can recalculate for the 3.3k dropper resistor.

jack
 Logged

SW Scotland
Offline
Edison Member
Karma: 10
Posts: 1181
Arduino rocks
 « Reply #5 on: July 29, 2010, 07:43:12 am » Bigger Smaller Reset

But if he sets the -7 volts as the arduino 0 volts then his 0volt input becomes the positive source for the voltage divider.  As Mr Einstein would say, "it's all a matter of relativity"
jack
 Logged

whistler
Guest
 « Reply #6 on: July 29, 2010, 07:58:12 am » Bigger Smaller Reset

Thanks to both for your replies. However I think you may have both misunderstood. Maybe I havn't explained very well.

@Mike

Quote
An op-amp can only set it's output between the power supply rails
That's what I want though. 0 to +5V out with a 5V supply. (from the 0 to MINUS 7V in)

Quote
He wants to generate a negative 7v from a positive 5v rail.
No. I want to generate a +ve 5V from a +ve 5V rail but with an input of -ve 7V.

@jackrae

I think you may have missed the polarity inversion bit. Hence my attempts at using the inverting opamp.

Thanks
 Logged

nr Bundaberg, Australia
Offline
Tesla Member
Karma: 89
Posts: 7462
Scattered showers my arse -- Noah, 2348BC.
 « Reply #7 on: July 29, 2010, 08:40:55 am » Bigger Smaller Reset

Analogue's not realy my bag but I don't think you can do this without isolation. An isolated amp and power supply would do the trick.

Alternatively an isolated Power supply, an 8-pin uC and an optocoupler. The isolated circuit's GND is referrenced to the -7, voltage divide as usual to reduce the 7v and put that into the uC's ADC. Then send the value serially over the opto.

 Logged

Rob Gray aka the GRAYnomad http://www.robgray.com

Manchester (England England)
Offline
Brattain Member
Karma: 438
Posts: 28741
Solder is electric glue
 « Reply #8 on: July 29, 2010, 08:42:06 am » Bigger Smaller Reset

To put -7v to an input the supply rail must be at least -7v. You can't run voltages directly to a chip that are outside it's supply rail. So if you want -7v in you must have a negative rail of at least 7v but more normally -12v.

What jackrae is talking about is connecting the 7v signal output to the arduino ground and then connecting the 0v line of the unit to the analogue input. This would give you a positive 7v input which you would have to cut down using a potential divider.
However, this will only work if your system has a floating supply with respect to the arduino and also had a low enough output impedance not to be loaded by the potential divider.

EDIT cos we cross posted.
He is wanting to take an analogue reading, putting this through an opto isolator is not going to work. Linearity and all that.
 « Last Edit: July 29, 2010, 08:43:48 am by Grumpy_Mike » Logged

0
Offline
Karma: 13
Posts: 2857
ruggedcircuits.com
 « Reply #9 on: July 29, 2010, 08:48:21 am » Bigger Smaller Reset

I think it should be fine. The danger is sourcing current to -7V from one of the input pins. But as long as you have a sizable resistor from -7V to the inverting terminal (at least 10k?) it should be fine as that node will theoretically remain at 0V. A 6.8k resistor for feedback (output to inverting terminal) will then give you the approximately 0.7V of gain. You could even kick it up to 100k/68k for extra safety.

I would make sure you ensure the op-amp always has power before -7V is applied.

http://www.ruggedcircuits.com
 Logged

nr Bundaberg, Australia
Offline
Tesla Member
Karma: 89
Posts: 7462
Scattered showers my arse -- Noah, 2348BC.
 « Reply #10 on: July 29, 2010, 08:57:45 am » Bigger Smaller Reset

Quote
He is wanting to take an analogue reading, putting this through an opto isolator is not going to work. Linearity and all that.
I was suggesting he do the A/D using a uC that is isolated from the Arduino (using one of those little DIP isolated PSUs) then transmit the value digitally through the opto.

Not the most elegant I suppose, a digital engineer's approach to an analogue problem
 Logged

Rob Gray aka the GRAYnomad http://www.robgray.com

Manchester (England England)
Offline
Brattain Member
Karma: 438
Posts: 28741
Solder is electric glue
 « Reply #11 on: July 29, 2010, 09:47:33 am » Bigger Smaller Reset

Whistler, you said it:-
Quote
Maybe I havn't explained very well.

Everyone is going off on tangents.

Do you want to use an op-amp? If so do you have a split power supply to drive it?

Do you want to use another processor just to do the A/D or do you want an arduino to do it all.

What is this unit that only outputs -7v, I assume it is a liner output and that sometimes it outputs less, what information this carrying and does it change rapidly.
 Logged

Western New York, USA
Offline
Karma: 22
Posts: 3808
 « Reply #12 on: July 29, 2010, 04:23:17 pm » Bigger Smaller Reset

From the ancient technology department - wouldn't an  MC1489 Line Receiver do the trick?  I might even be able to find one around here someplace.

Don
 Logged

St. Leonards-on-Sea, E. Sussex, UK.
Offline
Sr. Member
Karma: 2
Posts: 298
Ancient developer
 « Reply #13 on: July 29, 2010, 04:41:00 pm » Bigger Smaller Reset

This is the usual way to convert a bipolar input to unipolar:

http://www.leonheller.com/images/Bipolar-unipolar.gif
 Logged

Leon Heller
G1HSM

whistler
Guest
 « Reply #14 on: July 30, 2010, 03:16:39 am » Bigger Smaller Reset

Quote
Yes, you can typically do this with a relatively simple op-amp circuit.
Ideal - that's what I need to know - thanks.

Thanks to everyone for your input on this but it does seem to have taken on a life of it's own. Really, all I was trying to ask in my original question was: Can you configure a SINGLE supply opamp as an inverter that only ever has a positive output or does it HAVE to have a dual supply.

Quote
1) Are you talking about a binary (on-off) -7 vs. 0 volts?  Or are you talking about an analog voltage that ranges between -7V and 0V?
The latter. (To be fair I did say in my OP that the idea is to feed the Arduino ADC)

Quote
2) Where is this negative signal coming FROM?
The control interface of a plasma cutter.

Quote
3) Do you need to map -7V in to 0V out and 0V in to +5V out?   Or do you need to map =7 V to +5V and 0 V to 0 V?
I have in mind the latter BUT I'm not sure it really matters. Remember this is going into the Arduino ADC so any amount of soft skullduggery can be done "later". As long as I have an ADC friendly representation of the 0 to -7 I'll be a happy bunny.

Quote
4) Do you have a bipolar source of power for the opamp?  You will need at least -8V power and +8V power.
Now we're getting to the crux. This is really what I was asking in my original question. I've modelled this successfully in ltspice with a SINGLE supply, but you've confirmed that in the real world I need a split supply - thankyou.

To answer: I don't have a ready split supply so I'll have to arrange one.

Quote
5) Maybe you can borrow the biploar power from the (unidentified) source of the signal?
Afraid not - going "in the box" is out of bounds for warranty and H&S reasons. But I've an idea where else I may be able to get it from.
 Logged

 Pages: [1] 2   Go Up