Author Topic: Cacpacitor change in pot command  (Read 3635 times)

0 Members and 1 Guest are viewing this topic.

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Cacpacitor change in pot command
« on: October 03, 2007, 04:23:16 PM »
When using the pot command in PIC basic ( to read the resistance) you use a .1 uF capacitor like so


I was wondering what would happen if I used a 1uF capacitor instead.

Also, if I had two photoresistors would I need two capacitors or could I just share one .1uF capacitor between the two?

Quote
Quote
Explanation of Pot Command
The POT command charges the capacitor through the CDS photocell, and then measures the time it takes for the capacitor to discharge. The resulting value is then used to adjust the IR LED output power to compensate for changing light levels present on the infrared detector module. Note: You can also us the RCTIME command with minor adjustments to the light-sensing circuit.


and another explanation can be found here http://www.melabs.com/resources/pbcmanual/


Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

paulstreats

  • Guest
Re: Cacpacitor change in pot command
« Reply #1 on: October 04, 2007, 02:20:45 PM »
because the pic will be pulsing port a0 it only lets the cap charge to a certain amount anyway, i would assume that because the discharge time varies on a 0.1uf capacitor then exchanging this for a larger capacitor would produce similar or the same results.

this is quite an interesting concept that acts as an external a/d converter, the detector charges up the cap and then the mcu detects how long it takes for the cap to discharge therefore producing a pwm type signal, that needs to be modulated in software, presumably the brighter light that falls on the detector, the more charge is in the capacitor and the longer it takes to discharge through the mcu, the darker the light, not as much charge will be stored. this requires the port pin to go high for a specified amount of time (Charging period) and then go into input mode until there is no charge left.

paulstreats

  • Guest
Re: Cacpacitor change in pot command
« Reply #2 on: October 04, 2007, 03:21:03 PM »
Im tempted to run a few experiments with something similar to this:


Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,702
  • Helpful? 173
    • Society of Robots
Re: Cacpacitor change in pot command
« Reply #3 on: October 05, 2007, 07:05:58 AM »
So changing the cap would change the response time . . . a bigger cap would increase that time . . . but hey, caps are easy to get so try it!

But I prefer to tweak in software since it saves me soldering time . . .

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,650
  • Helpful? 21
  • narobo.com
    • Narobo.com - Mechatronics and related
Re: Cacpacitor change in pot command
« Reply #4 on: October 13, 2007, 09:30:28 PM »
Hey guys

How can I calculate how long it takes to charge that capacitor and how long it takes to discharge( basically how long it takes for the whole pot command to run)

Any help .

Please  include the formula and answer with your reply.

I am using a .1uF capacitor with a resistance of ~50 ohms connected between the microcontroller and the capacitor.
Please help!
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,702
  • Helpful? 173
    • Society of Robots
Re: Cacpacitor change in pot command
« Reply #5 on: October 14, 2007, 06:58:57 AM »
the very first link from google:
http://hyperphysics.phy-astr.gsu.edu/hbase/electric/capdis.html
(its the very bottom equation)

you might find this helpful too:
http://hyperphysics.phy-astr.gsu.edu/hbase/electric/capdis.html#c2

(use the capacitor datasheet to look up R)

 


Get Your Ad Here