Go Down

Topic: Current Amplifiers (Read 18145 times) previous topic - next topic

MrDropsy

I thought perhaps in the future i could use two photodiode in the circuit where i leave one in the dark and the other exposed to light. This way i can subtract the effect of dark current on my measurement  :)

I will let you know how it all goes.

Thanks  a lot for your help

Genesis92

no because the dark current depends of each part and of the temperature ;)

polymorph

#32
Nov 19, 2014, 03:53 pm Last Edit: Nov 19, 2014, 06:56 pm by polymorph
You need to determine the maximum and minimum currents you need to read, and scale it by offset and amplification.

The LM324 and LM358 outputs can go down to the -V rail (or ground, if single supply) but can only go up to 1.5V less than the +V rail.

I did an Op Amp class a while back where we took a silicon diode and used it as a temperature sensor, using an LM358. The Arduino generated a negative voltage using one of the outputs with a diode/capacitor multiplier, otherwise even a rail-to-rail Op Amp cannot get right down to 0V on the output.

To overcome the fact that the LM324 won't go within 1.5V of +V, we use the internal voltage reference of about 1.1V.

Here are the files. Inside the LM358 folder are the schematics in an LTSpice file, inside the folder Thermometer01 is the Arduino program file.

http://www.polyphoto.com/tutorials/OlyMEGA/OpAmpClass/


A couple of useful PDFs:

HANDBOOK OF OPERATIONAL AMPLIFIER
APPLICATIONS


Op Amps for Everyone 3rd Edition

Op Amps for Everyone Fourth Edition in print
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

Genesis92

#33
Nov 19, 2014, 04:15 pm Last Edit: Nov 19, 2014, 04:16 pm by Genesis92
that was explained before but you give usefull specs

MrDropsy

Thanks everyone,

I checked for the current today.

From the spec sheet 10^4 corresponds to 10000 lux. Due to the scale 1uA * 10^1 = 0.00001A

Which is actually 0.01mA

I measured my maximum current to be around 70-90  micro Amps.

which is;

0.07<I<0.09

which corresponds to 70 thousand to 90 thousand lux.

Provided i can get my hands on a rail-to-rail amp using ohms law

my required resistance is 55.55K < R < 71.4K

I will try test these things and post the results

polymorph

Generate a negative voltage so the Op Amp can actually go down to ground. Use the internal reference voltage so the output of the Op Amp is full scale at about 1V.

RRIO Op Amps are not really rail to rail on the outputs... just really close.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

MrDropsy

#36
Nov 20, 2014, 11:05 pm Last Edit: Nov 20, 2014, 11:19 pm by MrDropsy
How do i generate a negative voltage, when the board only offers GND

and i thought putting a negative voltage through the board would damage it.

rlogiacco

#37
Nov 20, 2014, 11:46 pm Last Edit: Nov 20, 2014, 11:46 pm by rlogiacco
 :D That was confusing to me as well when I have received a similar advise.

Voltage is not an absolute value, it is always referred to something else. Like if I say this table is at 1m: it will mean nothing unless I provide a reference, like this table is at 1m from the floor or 1m above sea level (the world wide considered floor, or 0m).

Now let's say we put a chair, which feet are 50cm height, between the table and the floor: I can say this table is 50cm above the chair and the floor is 50cm below the chair! We got a negative measure!

Let's apply this to the voltage thing: if you have a 12V battery input we, by convention, associate 12V to the anode (+) and 0V to the cathode (-). I bet you know voltage dividers, so you know you can easily obtain a middle point by connecting two equivalent resistors in series between your battery cathode and anode to achieve three voltage levels: 12V, 6V and 0V. Now shift your convention point from the bottom to the middle point and what you get is +6V, 0V and -6V. Obviously you will have to use the 0V point as GND in the rest of your circuit for the battery cathode to be considered -6V  ;)

If the last statement isn't clear enough, that means your board GND (and anything else you want to be at GND level) will have to be connected to 0V, including the opamp reference input. The only connection you need to have at -6V level is going to be your opamp negative supply.

Hope this clears it up  8)


P.S.
There is an equivalent of sea level for voltage and it is called Earth so it has a sense to say this circuit has earthed ground, sometimes abbreviated to grounded and its meaning is the circuit's 0V corresponds to our planet electrical potential. It's a convention, as much as the sea level thing, as we know we can go below sea level and get negative values :smiley-zipper:
Please, do not send me personal messages containing forum related questions: I will not answer.

I share my discoveries and thoughts at http://rlogiacco.wordpress.com

polymorph

http://forum.arduino.cc/index.php?topic=278461.msg1968189#msg1968189

Open the LTSpice files, look at the Arduino program. One pin is programmed to output a constant tone. That goes to several diodes and capacitors wired as an inverting multiplier, with an LED as both an indication that it is working, and a voltage bypass regulator (like a zener diode).



Now this is a bit different than connecting it to an AC transformer. In that case, a 12.6Vac 60Hz waveform is actually about 17.8Vpk or 35.64Vp-p (peak to peak). The first capacitor and diode offset that so it is a pulsating DC of -(35.64V - 0.7V diode drop). The second diode and capacitor smooth it to flat DC, minus 0.7V. So about -34.24Vdc.

But we're feeding this what is really a 5Vp-p signal. So this becomes -(5-1.4 two diode drops) = -3.6V

In my circuit, an additional RC filter drops out more ripple and limits current to the LED, which keeps the voltage at about -2V. Not much current, but the Op Amp doesn't need much.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

rlogiacco

@polymorph I would bet he will be pretty happy if he can get within 100mV to rails, which most of RRIO opamps can easily get without getting too expensive. Unless he needs a particular precision he might compensate for that lost in range in software by just using the map function.

While I do get your point and I like the solution, I just think he doesn't really need that, just a generic single supply RRIO opamp :smiley-small:
Please, do not send me personal messages containing forum related questions: I will not answer.

I share my discoveries and thoughts at http://rlogiacco.wordpress.com

MrDropsy

#40
Nov 21, 2014, 12:33 am Last Edit: Nov 21, 2014, 12:45 am by MrDropsy
Thanks both for your replies.

Anything close to the rail is OK for me. I bought the LMC6482.

Im not really sure that makes sense to me @rlogiacco.

I have made a  new circuit with the photodiode, where i treat the V- pin on the op amp as GND and the V+ pin on the op amp as 5V. Both from the board.

I achieve a range between 0 and 1023 - which is good enough for me.

At the moment i have ground connected to the positive terminal. My photodiode goes into my negative terminal - as well as the feed back resistor and capacitor which is also connected to my output.

What i think you're saying - and im probably wrong..

Is to put 2 resistors of the same value somewhere off the side and put 5 volts on one side and GND at the other side. So that would make +2.5 0 -2.5

and then connect the zero to everywhere i currently have ground...?

 ::) thats probably totally wrong, im trying to get my head around it.

EDIT:
Is doing this going to improve my measurement

rlogiacco

#41
Nov 21, 2014, 12:51 am Last Edit: Nov 21, 2014, 12:54 am by rlogiacco
Anything close to the rail is OK for me. I bought the LMC6482.
That seems to be a very good dual channel, single supply, rail to rail opamp capable of working with a single supply and, as the datasheet sayd, it can go as close as 20mV to rails.

Im not really sure that makes sense to me @rlogiacco.
:smiley-roll: Confusing rather than clarifying? That happens quite often to me  :smiley-grin:

I have made a  new circuit with the photodiode, where i treat the V- pin on the op amp as GND and the V+ pin on the op amp as 5V. Both from the board.

At the moment i have ground connected to the positive terminal. My photodiode goes into my negative terminal - as well as the feed back resistor and capacitor which is also connected to my output.
That is an inverting amplifier configuration and is the same as I would have gone for: good choice!

What i think you're saying - and im probably wrong..

Is to put 2 resistors of the same value somewhere off the side and put 5 volts on one side and GND at the other side. So that would make +2.5 0 -2.5

and then connect the zero to everywhere i currently have ground...?

 ::) thats probably totally wrong, im trying to get my head around it.
I was just trying to respond to the questions how do I get a negative voltage and isn't a negative voltage going to damage my board and it's not applicable any more to your circuit as you are now using a single supply rail-to-rail opamp. If you were going to use the TL082, as you mentioned in a previous post, then that would have been applicable, but now you should be happy with what you got.

For sake of completeness, what you were describing was very close to what I was saying, but instead of using 5V you should have used something like 15V, which is the Vsupply required by a dual supply opamp. In that case, yes, you should have gone for what you were saying in order to have the output to swing close to the rails (it would have probably gone well out of range) and then you should have added some diodes to clamp any excess before getting to your analog pin.... Wow, a lot of complexity you just eliminated by simply buying that single supply rail-to-rail opamp... cool uh!  :smiley-grin: Don't you feel lucky now you got the part you needed?  :smiley-lol:

I achieve a range between 0 and 1023 - which is good enough for me.
I bet it is: you can't get better than that as the Arduino has a 10bit ADC, which means your min and max reading are exactly 0 and 1023.
Actually you should be getting readings more like in the 4 - 1020 range as each step is around 5mV and the opamp's datasheet states 20mV gap to the rails....
Please, do not send me personal messages containing forum related questions: I will not answer.

I share my discoveries and thoughts at http://rlogiacco.wordpress.com

MrDropsy

Thanks again for your reply. Haha, it wasn't luck that i ended up getting that one ;), I finally understood why I need one of those.

Yes, the voltage divider issue makes more sense - ill still try to understand it better.

As for the range - i actually am getting to 0 and to 1023 with my circuit.

Does that mean im damaging my board? should i do something to prevent that from reaching 0 and 1023.
(im not really sure how to stop that)

Interestingly, When i shine a light and get the program to read the value between 0 and 1023. The value for a specific level of light is not stable. It fluctuates a lot and im talking like easily + or - 50 pretty much all the time.

Maybe you have a possible thought about that.


polymorph

Do you have fluorescent lights or CFLs in the room? They give off a high frequency flicker.

Glad you found a good RRIO Op Amp.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

MrDropsy

They are in the room but i turned them off. Its also a brick room. I was testing it in a pretty dark environment with a single light source.

Unless my laptop screen is the cause -  i did face it away from the sensor.

Go Up