PDA

View Full Version : Help me on RC circuit



Johan
- 5th September 2007, 15:37
Hi !,

I am designing simple RC circuit.
how to get most linear charge/discharge output ?

My RC circuit has a 10k resistor and 47uF capacitor, it seem the output is not linear

If I change the R to 1k and the C to 470 K, according to rule, I will get the same charge/discharge time, but will the output become more linear?

Thanks

mackrackit
- 5th September 2007, 16:30
Are you talking of a 10K pot? If so is it a linear or audio?

If the PIC you are using has ADC you may want to look at it.

RussMartin
- 5th September 2007, 23:55
If you are referring to a simple RC circuit, neither the charge nor the discharge curve will change.

Both sets of values you give yield a time constant of 470 milliseconds. It takes one time constant to charge the capacitor to about 63 percent of the voltage applied or to discharge the capacitor to about 37 percent; and it takes five time constants to fully charge or discharge the capacitor.

Changing values will not affect the shapes of the charge and discharge curves:

<IMG SRC="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1967&d=1189029501">

How are you using the RC circuit? What are you trying to do?

Both curves are most nearly "linear" (but still not perfect) for the first 20 percent.

Johan
- 6th September 2007, 03:51
Thanks guys,

RussMartin: Yes , this is exactly my problem, I want the curve to be as linear as possible.

I am tring to make a ramp . Any suggestion how to flatten the curve ( from red to yellow dot lines )

1968

Thanks,

Johan

mackrackit
- 6th September 2007, 05:04
What are you trying to accomplish in the long run? There might be a better solution than RC.

Jerson
- 6th September 2007, 05:22
Charge the capacitor via a constant current source. This will give you a linear curve.

Johan
- 6th September 2007, 06:18
Mack: I am welcoming any other solution :)
The circuit is to dampen sudden voltage changes of a potentiometer ( voltage divider ), what important is the linearity of the output


Jerson: could you please tell me how to make constant current charging schematic that suit my need?

Ioannis
- 6th September 2007, 08:52
I really cannot understand what will be the difference if the charge/discharge will be linear or exponential relative to the pot circuit. As long as the pot is at a position the capacitor will charge and stay at that charge. A new pot position will give little or more change at the output but then again it will stabilize at the new level.

A current source will charge the capacitor linearly (Q=C*V, Q=I*t, t=C*V/I).

But as is your example, I don't know how it can be accomplished or what the result would be. The Current source will charge the capacitor and then will stop function because there will be no current to flow untill you will change the pot to a higher level. For a lower level a second curent source would be needed to discharge.

Ioannis

mackrackit
- 6th September 2007, 09:25
Does the voltage on pin#3 in your drawing change or is the change only from the pot position?
Either way a ADC looks like the way to go. The capacitor in your drawing will serve to "dampen" any voltage change (in its range) making Vout smooth.

If you have not used ADC before, take a look here.
http://www.rentron.com/PICX2.htm
http://www.rentron.com/PicBasic/LM34.htm
http://www.rentron.com/serial.htm

If you are expecting large spikes you would set up the voltage divider so that the maximum voltage in would still be a maximum of 5 volts out of the divider.

The ADC is linear. With an 8 bit setup, 0 volts will read 0, 2.5 volts will read 127 and 5 volts will read 255. 10 bit will have a 1024 step range.

If the voltage is never more than 5, say 3 volts. The reference voltage can be set for this and you will still have full scale.

Johan
- 12th September 2007, 05:44
Thanks for your responses :)

Well , this is not a simple circuit indeed. I have found the explanation about it on Nutsvolt , February 2007,p20

Thanks again