How? switch a positive voltage source when a signal voltage goes negative? - Page 1
Forum section: electronics / beginners

author: K3mHtH
author_rank: Regular Contributor
timestamp: October 08, 2018, 03:16:45 am
content: 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.

author: rs20
author_rank: Super Contributor
timestamp: October 08, 2018, 03:35:31 am
content: 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?

author: K3mHtH
author_rank: Regular Contributor
timestamp: October 08, 2018, 03:56:40 am
content: Quote from: rs20 on October 08, 2018, 03:35:31 amThanks 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.

author: rs20
author_rank: Super Contributor
timestamp: October 08, 2018, 06:18:45 am
content: 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.

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 08, 2018, 07:27:01 am
content: maybe this?

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 08, 2018, 07:52:43 am
content: sorry i screwed up. maybe this?