### Author Topic: How? switch a positive voltage source when a signal voltage goes negative?  (Read 436 times)

0 Members and 1 Guest are viewing this topic.

#### K3mHtH

• Contributor
• Posts: 40
• Country:
##### How? switch a positive voltage source when a signal voltage goes negative?
« on: October 08, 2018, 03:16:45 am »
Hey guys,
I have a waveform going between +5 and -5V at audio rates.

When the waveform is below 0V, I want to charge a capacitor from +15V rail at 20mA.
Also.. When the waveform is above 0V, I want to charge a capacitor from -15V rail at 20mA.

The cutoff point doesn't have to be right at 0V, it can be a diode drop above (or below) that. I have a Bipolar power supply of +/- 15V.

#### rs20

• Super Contributor
• Posts: 2149
• Country:
##### Re: How? switch a positive voltage source when a signal voltage goes negative?
« Reply #1 on: October 08, 2018, 03:35:31 am »
It seems like your first step is sending your signal into a push-pull comparator powered from +/- 15V. One input is your waveform, other input is ground. That'll make the output either +15V or -15V depending on the polarity of the waveform. So, relative to the negative rail, that's 30V or 0V. Relative to the positive rail, that's 0V or -30V. So you can pretty easily stick a couple of current sources hanging off the two rails that will source and sink 20mA as desired.

Here's a classic current source:

If, instead of being wired directly to Vs, R1 is instead connected to a node that switches between 0V and 30V, then the current source will switch on and off as you want.

And, as we've both mentioned, you'd to replace the "Gnd" in this circuit with -15V, and have a flipped upside-down version of the circuit hanging off 15V for your top rail.

(Bonus: those LEDs provide visual feedback as to what's going on as well!)

This is all assuming that you require a constant-current 20mA. If you just want to vaguely charge up some caps, you could just use the comparator + one resistor and a couple of steering diodes, instead of all this current source stuff.

I'd suggest replying with a picture of your proposed circuit so we can double-check it for you.

Also, why are you doing this? With a normal audio signal, the two capacitors are basically going to charge up equally, almost regardless of the content of the audio (except, IIRC, for the fact the the male voice is oddly asymmetrical).

Also, you're muddling your terms. Your message says "at 20mA", implying a current source, so that's how I answered your question; but your question title is asking for a voltage source. Which is it?

#### K3mHtH

• Contributor
• Posts: 40
• Country:
##### Re: How? switch a positive voltage source when a signal voltage goes negative?
« Reply #2 on: October 08, 2018, 03:56:40 am »
Also, why are you doing this? With a normal audio signal, the two capacitors are basically going to charge up equally, almost regardless of the content of the audio (except, IIRC, for the fact the the male voice is oddly asymmetrical).

Also, you're muddling your terms. Your message says "at 20mA", implying a current source, so that's how I answered your question; but your question title is asking for a voltage source. Which is it?

Thanks for the reply. I'm currently just charging the capacitors with a current-limiting resistor that limits the charge to approx. 20mA... so I should have said that I need a voltage source that can supply at least 20mA and I can tailor it with the appropriate resistor. I don't need a proper constant current source. Hopefully that makes sense..

This is a part of a waveshaping circuit that I'm trying to design, and I have it mostly working..  I don't want to over-complicate this discussion right now and I think i've described the requirements pretty good - and happy to elaborate further.

+/-5Vpp audio wave.
---> when wave goes below 0, charge capacitor A,  disconnect capacitor B from charging and let it be drained.
---> when wave goes above 0, charge capacitor B, disconnect capacitor A from charging and let it be drained.

#### rs20

• Super Contributor
• Posts: 2149
• Country:
##### Re: How? switch a positive voltage source when a signal voltage goes negative?
« Reply #3 on: October 08, 2018, 06:18:45 am »
OK, just get rid of R2 and the LED then. That'll just make it a simple switch that turns on or off, you can add a resistor in where it says "load" to add your tailoring resistor.

Again, send through a schematic of where you are now (or how you interpret my instructions) and we can progress from there.

#### Mechatrommer

• Super Contributor
• Posts: 9011
• Country:
• reassessing directives...
##### Re: How? switch a positive voltage source when a signal voltage goes negative?
« Reply #4 on: October 08, 2018, 07:27:01 am »
maybe this?
if something can select, how cant it be intelligent? if something is intelligent, how cant it exist?

#### Mechatrommer

• Super Contributor
• Posts: 9011
• Country:
• reassessing directives...
##### Re: How? switch a positive voltage source when a signal voltage goes negative?
« Reply #5 on: October 08, 2018, 07:52:43 am »
sorry i screwed up. maybe this?
if something can select, how cant it be intelligent? if something is intelligent, how cant it exist?

Smf