GUVA S12SD Schematics

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
adrien3d
 
Posts: 1
Joined: Thu Aug 06, 2015 12:03 pm

GUVA S12SD Schematics

Post by adrien3d »

Hello,

I'm currently working with the Adafruit Analog UV sensor breakout, and I want to integrate this sensor to a custom sensor design.
As I see multiple versions of breakout board for this guva S12SD, I was wondering if adafruit could push to its github account schematics and may be also the board, in eagle and PDF format, it would be wonderfull.

Thanks,
Adrien

User avatar
schizobovine
 
Posts: 5
Joined: Fri Mar 15, 2013 7:10 pm

Re: GUVA S12SD Schematics

Post by schizobovine »

Seconding this, as I'd like to do something similar, as well as integrate one of it's cousin photodiodes from the same manufacturer (GUVB-S11SD, so I can split out the UVA signal via subtraction).

I reverse-engineered most of the schematic with a multimeter and some patience, but I can't figure out the capacitor value while they're in-circuit (without trying to desolder the cap itself, which I'm a biiiit wary of doing and likely would impact the value anyway). One looks to be a simple decoupler, but the other is within the amplifier circuit so I'm assuming getting the value right is pretty important.

Looks to be a schematic attached to this post http://forums.adafruit.com/viewtopic.ph ... va#p369444, but unsure of the veracity.

Another post http://forums.adafruit.com/viewtopic.ph ... de#p480026 links to this schematic http://www.electroschematics.com/11509/ ... e-circuit/, so perhaps those may help.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: GUVA S12SD Schematics

Post by adafruit_support_mike »

Those schematics are basically correct. The arrangement of parts is a little clumsy though.. I'd draw it like this:
amp.jpg
amp.jpg (19.98 KiB) Viewed 774 times
The GUVA-S12SD tries to pull the op amp's negative input below 0v. Ignoring the 3.3k-1k voltage divider for a moment, the op amp's output sends current through the 1M resistor to pull its negative input back up to 0v.

If the 1M resistor was the only thing in the feedback path, the amp's output would be 1v for every 1uA of current flowing through the GUVA-S12SD. The 3.3k-1k voltage divider amplifies that. The whole point of the amp is to keep the left end of the 1M resistor at 0v, so if the voltage across the 1M is 1v, the voltage across the 1k is also 1v. To make that happen, the op amp's output has to be at 4.3v.

The 100nF capacitor in parallel with the 1M keeps the output stable. It limits the op amp's slew rate to about 10mV per millisecond, so the output can't oscillate faster than about 2Hz.

The only component on the board not included in the schematic above is another 100nF capacitor between the op amp's VCC and GN pins. That's just a debounce capacitor.

User avatar
schizobovine
 
Posts: 5
Joined: Fri Mar 15, 2013 7:10 pm

Re: GUVA S12SD Schematics

Post by schizobovine »

Awesome, thanks for the confirmation! Not sure if I should open up another post, but I had a few questions about the values of the components in the opamp circuit.

The capacitor value choice baffles me, since it really does seem that sprinkling 100nF capacitors everywhere does all kinds of magic. I'm assuming the value doesn't matter too much overall, and it's mostly there to slow down the bouncing around of the voltage level?

With a 1MOhm resistor, would a 10nF capacitor give a 100mV/ms slew while 1uF would have 1mV/ms? I.e., capacitance is inversely proportional to slew rate?

I've got a few test boards off to OSHPark with the above amplifier circuit, so hopefully it will work for the GUVB-S11SD as well. Looking through that datasheet, most of it seems the same, save for 1/10th to 1/20 the current at the same UV index (which makes a bit of sense, since it is cutting out at 320nm vs. 370 for GUVA-S12SD and most UVB should get blocked by the atmosphere).

Given the lower current, would just increasing the voltage divider be enough to make the output detectable by an ADC? I.e., bring it up to 33K/1K? Or would I need to play around with that 1M resistor?

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: GUVA S12SD Schematics

Post by adafruit_support_mike »

schizobovine wrote:The capacitor value choice baffles me, since it really does seem that sprinkling 100nF capacitors everywhere does all kinds of magic. I'm assuming the value doesn't matter too much overall, and it's mostly there to slow down the bouncing around of the voltage level?
Pretty much, with a large helping of "it depends".

It's been said that an amplifier is just an oscillator that isn't living up to its full potential. Any time you have gain greater than 1 and a connection from the output back to the input, you have the chance of oscillation. The more gain your amp has, the larger the chance that some random voltage spike will set it screaming.

The capacitor between an op amp's VCC and GND pins serves the function of a rechargeable battery. Noise on the supply rails can couple through to the output. Worse yet, it takes a significant amount of current to make an op amp's output swing quickly, and that creates a feedback path from the output to the supply rails. PCB traces have resistance and inductance that can make their resistance look surpisingly high in the mid-megahertz range where op amps like to oscillate. The capacitor serves as a very close source of energy for sudden output swings.

The capacitor's ability to keep noise from coming back through the supply rails depends on how fast it can respond, how fast it can recharge, and how long it can deliver current before its voltage falls as far as the spike you want it to absorb. Larger capacitors last longer, but don't respond as quickly. Small capacitors respond quickly, but can't swallow large spikes. The goal is to find a middle range that meets both requirements well enough. SMD caps between 100nF and 1uF tend to fall in that range.

The capacitor from the output to the negative input is also a standard feature of op amp circuits. Oscillation is bascially a matter of not being able to tell when an error has been corrected. If the amp's gain is 1000:1 and a 1mV spike of noise hits the input, the output will change by 1v to try to correct it. It may take 50nS for the 1v pulse to reach the output though, by which time the original spike of noise will be gone. That creates another error the amp will try to correct, but there will still be a 50nS lag between the amp deciding there's an error it needs to correct and having the correction appear at the output.

The worst possible time for that to happen is when the output actually reaches the correct voltage. The input says it's time to stop, but the output is still pumping out correction from the 50nS before the output hit the correct level. As a result, the output overshoots and you get a new error going the other way. If the amp's gain is large enough that the new error is as big as the previous one, the output will continue to whipsaw back and forth at about 20MHz.

Feedback capacitors prevent that. Capacitors look like short circuits at really high frequency, and their equivalent resistance is 1/C for medium frequencies. If the gain applied to an error is less than 1, the op amp's correction can't overshoot as far as the original error, so even if it does overshoot, it will gradually zero in on the correct value like a marble finding the bottom of a bowl.

For the circuit above, the low end of the resistive feedback voltage divider has a value of 1k. A 100nF capacitor's equivalent resistance drops to 1k at 10kHz, so the amp's gain for any signal faster than 10kHz will be less than 1. The amp can't possibly oscillate faster than that frequency. It might be able to oscillate below 10kHz if the propagation delay from input to output was 100uS or more, but the actual delay is much shorter. The "can't catch up" part of any error below 10kHz is much smaller than the error itself, so the gain on the error is still much lower than 1. As a result, the amp will remain stable at all frequencies.

Stabilizing the amp is only half the problem though. It still has to be able to respond to input. That's where the 1M feedback resistor comes in.

The op amp's output can't change unless the voltage across the cap changes, and the voltage across the cap can't change unless current flows into or out of the end connected to the amp's negative input. The only way current can get from the amp's output to the negative input is through the 1M resistor, so the output's rate of change is limited by how fast the 1M resistor can charge the 100nF capacitor.

That value is the product of the resistor and capacitor values, and is called the 'RC time constant'. In this case, it limits the amp's slew rate to 10mV per millisecond. If the output tried to change faster than that.. say 11mV in 1ms.. the voltage across the cap wouldn't be able to keep up. The cap voltage would still only change by 10mV, so if the output changed by 11mV the overall effect would be to pull the negative input 1mV higher. The whole point of an op amp is to cancel that kind of error, so the amp's ability to change its output maxes out at a slew rate of 10mV/1ms.
schizobovine wrote:With a 1MOhm resistor, would a 10nF capacitor give a 100mV/ms slew while 1uF would have 1mV/ms? I.e., capacitance is inversely proportional to slew rate?
Yep. You're estimating RC time constants correctly.
schizobovine wrote:Given the lower current, would just increasing the voltage divider be enough to make the output detectable by an ADC? I.e., bring it up to 33K/1K? Or would I need to play around with that 1M resistor?
You can do either one, but you have to be aware of the tradeoffs.

In theory, the existing amp could drop the 3.3k-1k voltage divider entirely and use a 4.3M feedback resistor. That would reduce the slew rate by a factor of 4.3, meaning you'd need to make the feedback cap smaller if you wanted to keep that 10mV/1mS slew rate. It's hard to find 4.3M resistors with any accuracy though, and the high feedback resistance would make the amp more sensitive to all the imperfections in the op amp, like current noise, temperature drift, etc. Op amps prefer to have their output connected to a few kilohms of load.

The 3.3k-1k divider provides that load, and also takes care of the overall gain. Replacing the 3.3k with a 33k would take the gain from 4.3 to 34 (33k+1k/1k), and would reduce the stability of the output.

Personally, I'd suggest using a 4.7k-120 voltage divider for the gain. The total resistance is still a few kilohms, and the gain will be about 40.

User avatar
schizobovine
 
Posts: 5
Joined: Fri Mar 15, 2013 7:10 pm

Re: GUVA S12SD Schematics

Post by schizobovine »

Gotcha! And thanks for the in-depth info on opamps--clever little chips! Analog electronics is a weak spot for me, since my background is computer science and not electrical engineering. Aside: the "it depends" answer is pretty frequent in CS, too, so I'm totes used to it. :)

So, this mean the RC pair (feeding into the voltage divider) is a low-pass filter?

Sounds like using tighter tolerance components would be useful for this--1% resistors and +/-10% capacitors, yes?

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: GUVA S12SD Schematics

Post by adafruit_support_mike »

schizobovine wrote:So, this mean the RC pair (feeding into the voltage divider) is a low-pass filter?
The signal travels the other way: from the voltage divider back to the negative input.

It's actually a high-pass filter, but it's a high-pass filter in a negative feedback loop.

An op amp measures the difference in voltage between the positive and negative input pins, or the 'error'. If we assume a perfect amp with 1:1 gain, it subtracts the error from the output.

If we put a filter in the path between the output and the negative input, it changes the amount of error the op amp sees at different frequencies.

If the filter lets 99% of a low-frequency signal reach the negative input, the op amp will subtract 99% of that signal from the output. Only 1% of the input will make it to the output. If the filter only allows 1% of the signal to reach the negative input, 99% of the input will make it to the output.

That tendency to subtract signals reverses the effects of a filter in a negative feedback path. A low-pass filter sends all the low-frequency signals through to be cancelled, so only high-frequency signals pass through the amp with little or no change. The circuit as a whole acts like a high-pass filter.

Putting a high-pass filter in the negative feedback -- like in the design above -- sends high-frequency signals back to be cancelled, but leaves low-frequency signals largely unchanged. The circuit as a whole acts like a low-pass filter.
schizobovine wrote:Sounds like using tighter tolerance components would be useful for this--1% resistors and +/-10% capacitors, yes?
Not enough to be noticable.

A filter with a single resistor and capacitor attenuates signals at the ratio Fc/(Fc+Fs), where Fs is the frequency of the input signal and Fc has the formula 1/2piRC

(I'm doing the low-pass version of the math becuause it's more common.. a high-pass filter behaves the same way, but its formula is Fs/(Fc+Fs))

Fc is called the filter's 'corner frequency' because that's where the response changes. If Fs is much smaller than Fc, there's very little attenuation:

Fs = 0.001*Fc: 1/1.001 = 0.999
Fs = 0.01*Fc: 1/1.01 = 0.99
Fs = 0.1*Fc: 1/1.1 = 0.9

If Fs is much larger than Fc, the attenuation is basically 1/Fs:

Fs = 9*Fc: 1/10 = 0.1
Fs = 99*Fc: 1/100 = 0.01
Fs = 999*Fc: 1/1000 = 0.001

The range from Fs=0.1*Fc and Fs=10*Fc is the only part of the curve where both frequencies have a noticable effect on the attenuation.

Every single-resistor/single-capacitor filter behaves that way, so changing the values of R and C just shifts Fc the left or to the right. Using tighter tolerances for the resistor and capacitor just means the actual value of Fc will be closer to the Fc value you calculate using the ideal RC values.

Assuming R is off by 5% and C is off by 20%, the actual corner frequencies would be 0.95*0.8=0.76 and 1.05*1.2=1.26. The attenuation for those in the range where both frequencies matter would be:

Fs=0.1Fc.ideal ; Fc=0.76*Fc.ideal: 0.76/0.86 = 0.883
Fs=Fc.ideal ; Fc=0.76*Fc.ideal: 0.76/1.76 = 0.432
Fs=10Fc.ideal ; Fc=0.76*Fc.ideal: 0.76/10.76 = 0.070

Fs=0.1Fc.ideal ; Fc = 1.26*Fc.ideal: 1.26/1.36 = 0.926
Fs=Fc.ideal ; Fc = 1.26*Fc.ideal: 1.26/2.36 = 0.557
Fs=10*Fc.ideal ; Fc=1.26*Fc.ideal: 1.26/11.26 = 0.112

The worst error is about 7% off the ideal attenuation at the corner frequency, and about 3% off at the edges of the region where we still care about both frequencies. The effect outside that region will be negligible.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”