I have an analog signal coming evolving in the 0-5V range. I want to add/subtract an adjustable shift to move the curve upwards or downwards. The curve might be clipped upon shifting but this is not an issue (see picture - the blue curve is the original signal; the green one is the signal shifted upwards and the red one the signal shifted downwards).
As my circuit is fed with a LiPo cell and a 5V power regulator, is it possible to achieve this with only a single control (variable resistor) ? I understand I could shift upwards by addition of a DC signal through an op-amp, but how can I achieve the downwards shift ? Do I need a dual supply and use a negative DC signal in the addition or is there a solution with a single supply ?
Also, how to have clipping at the ends of the range instead of wrapping of mirroring ?
Single supply rail to rail op-amp with DC offset will let you shift up, clipped at 5V, or shift down clipped at Gnd. Is that what you want? Or do you want clipped at -5V? In which case you can use a dual supply rail to rail op-amp with dual supplies.
I don't understand your follow on question: clipping at the ends of the range instead of wrapping of mirroring ?
No, I want the signal to be clipped at either +5 or 0V after shifting. So if it's possible with a single power supply, do you have any schematics or reference?
This is what I mean by "mirroring" (original signal in blue, mirrored signals in red and green):
You can use a standard op amp as a level shifter. There are several designs, which Google image search will be happy to show you. For a single supply you MUST choose a "rail-to-rail" op amp. It will do the clipping automatically.
Some invert the signal, and add it to the offset (selected by a potentiometer) as in the attached.
Wrapping or mirroring as you describe would require extra effort and extra parts - if you don't want it, you're good.
@Crossroads - I don't think he wants to do that to the signal - it sounded like he thought that the parts might do that instead of clipping, because he doesn't know how opamps work.
Thanks jremington for the schematics. I will try it.
DrAzzy:
Wrapping or mirroring as you describe would require extra effort and extra parts - if you don't want it, you're good.
@Crossroads - I don't think he wants to do that to the signal - it sounded like he thought that the parts might do that instead of clipping, because he doesn't know how opamps work.
Yes, I don't want clipping per se. The idea is to adjust a dead zone where a sensor would give no output despite not being in its off position. The clipping (at least the one happening at the bottom of the range) should be thought more as a kind of threshold. However I am not so ignorant about op-amps: it seems that some kind of wrapping could happen in some old op-amps. Anyway I preferred to be clear about the kind of circuit's behaviour I wanted.
Wawa:
It seems to me that your mystery sensor deadzone/window problem could be solved in software.
Tell us more.
Leo..
Yes, I didn't thought about that solution! :o This could obviously work. However I am also interested in a pure analog solution just for the pleasure to understand how it could be done.
By the way, as I want to control the offset with a trimmer and have multiple sensors in parallel, I am not sure I would have enough analog inputs. That's another reason to go analog.