# How to Generate a Calibration Signal?

I'd like to generate an integrated calibration signal for a biopotential amplifier. I'd like to generate a 0.5mV square wave (within 5%) at 200Hz (give or take on the frequency).

I'm thinking of using a large square wave generated by DAC, and divide the amplitude down. There are clear issues, though. I'd need to add an offset, as I'd need an inverting op amp, and then invert once more and remove the offset. Now we're talking precision sources, and some rail to rail op amps.

Is there a way to do this with less hardware?

• What about just using a voltage divider and a buffer amplifier? Commented Aug 18, 2015 at 19:27
• @alex.forencich, that actually sounds like a good idea. I have to work out what my errors would add up to if I use 1%-ers for the big and little resistors -- If I use a 10 ohm and a 100K at 1%, for example, my gain is almost 10% off -- but that might be the case for any method. Commented Aug 18, 2015 at 19:32
• I could spring for better tolerance on the big resistor, and still save space. Commented Aug 18, 2015 at 19:33
• Why would your gain be off by 10 percent? A voltage divider with a 100k and a 10 ohm resistor has a gain of 9.999e-5. If the 10 ohm is 1% high and the 100k is 1% low, you get a gain of 10.20e-5. If that's the other way around, you get a gain of 9.801e-5. Commented Aug 18, 2015 at 19:52
• @alex.forencich 9.8 is 10% different from 9.99 (oops, bad math on my part!! I'll leave this up to show my silliness to the world) Commented Aug 18, 2015 at 19:57

Sure, you can just use a CMOS logic chip (gate, buffer whatever) and follow it up by a voltage divider. Say your circuit runs at 5V, you could use a 100K resistor and a 10 ohm resistor. That will give you a 500uV p-p square wave that goes from 0 to 500uV. If you need to offset it by -250uV that can be done in a few different ways. One way is to connect a fixed resistor from the 10 ohm resistor of 200K and connect it to -5V.

You could use the micro directly, but using a separate buffer allows you to use a reference at the same voltage as the supply and control the currents a bit better to get a really clean square wave.

simulate this circuit – Schematic created using CircuitLab

Obviously you need to be very careful where the ground goes for the 10 ohm resistor- not to some noisy digital ground but to a nice quiet analog ground.

You can easily get an unadjusted accuracy of 0.1% or 0.2% with common cheap parts. The output impedance will be 10 ohms, which I imagine will not pose a problem for you.

• I'm shooting for an empirical design. If I power off of 5V, and the output of the gate turns out to be 4.7V, that won't do it for me -- Vo_high is a lousy parameter to design to -- sort of like design. Thanks for pointing out the digital option instead of a DAC, though. That should save clock ticks. I'm trying to avoid a negative rail if I can. Commented Aug 18, 2015 at 19:25
• However -- this leads me to looking toward a voltage ref with an enable!! ti.com/lit/ds/symlink/lm4128.pdf might be a slick answer Commented Aug 18, 2015 at 19:59
• Use a reference chip for the power supply of the buffer (only). With 100K loading the CMOS output will be within millivolts of the reference (maximum 0.03% error for the SOT-23-5 SN74LVC1G125-Q1. If you can AC couple the signal you can avoid the negative rail, otherwise I don't see how. Commented Aug 18, 2015 at 19:59
• Yes, that ought to work. Turn on time should be < 30us. Output capacitor is optional so maybe just a resistive load in parallel with the divider to keep turn-off reasonable. Commented Aug 18, 2015 at 20:03
• As long as I can get a reasonable steady state point, I don't even think the turn-off time will be a big deal. Commented Aug 18, 2015 at 20:07

Just use a voltage divider. You may or may not need a buffer amplifier depending on what it's driving. Also, it may be possible to drive the divider from a digital output pin directly if the division ratio is large enough. 100k and 10 ohms would have an output impedance of around 10 ohms, which may be sufficient without a buffer. The input impedance would be around 100k, which will not significantly load a digital output pin and should allow the voltage to float most of the way to the power rail. If you need some ability to tune the voltage, use a 90k resistor and a 20k trimmer (or some similar combination) instead of a 100k resistor.