Shop OBEX P1 Docs P2 Docs Learn Events
Current draw LED when less than 1.6V supplied — Parallax Forums

Current draw LED when less than 1.6V supplied

metron9metron9 Posts: 1,100
edited 2005-08-19 13:15 in BASIC Stamp
I am finally getting back to working with my Basic Stamp Homework board I bought last year.
As I have no education in electronics I go slow and try to understand each component I work with
I am a programmer going back to assembler on the 6502 chips so I know my way around software.

Putsin with a Capacitor, an LED and my Multimeter and some programming I wanted to time the voltage drain of the capacitor
I don't have an occoliscope to see the exact voltage vs time. My question is, using only the LED to draw power from the capacitor
is it a linear draw down or is there more or less drawdown of the voltage as the voltage drops. I suspect adding a resistor to pull down
the voltage would be linear but after the LED goes out the volt meter dropa very slowly so I suspect there is little or no current draw once the LED actually turns off because of low voltage.

Correct?

The project I am working on will be reading a voltage spike from 0 to 70 volts or so and using a known loop count for 5 volts to draw down
I can estimate the voltage spike by the length of time it takes to draw the cap down. Assuming a few things and point out where I am wrong
1. I track how long the voltage spike lasts
2. The capacitor charge rate is linear. That is to say if the spike lasts 1/10 of a second at 25 volts it would take the capacitor 5 times longer to drop than the same charge time at 5 volts.
3. I use a resistor instead of a LED to keep the drawdown constant.

' {$STAMP BS2}
' {$PBASIC 2.5}

Ct VAR Word

LOW 0            ' Pull Cap to 0 volts
PAUSE 1000
HIGH 0           ' Turn on 5 volts
PAUSE 1000
INPUT 0          ' Make pin null so it won't effect drawdown
ct=0
Cloop:
ct=ct+1          ' Count till pin0 falls to less than 1.? volts
IF IN0=1 THEN Cloop
DEBUG ? ct

DEBUG "end"
END


Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2005-08-19 12:18
    Yes, an LED is a highly non-linear device. "non-linear" means the current-voltage curve is nothing like a nice straight line (like a resistor would be). Thus the LED conducts very little, until the voltage gets to 1.2 to 1.4 volts (depends on device). Then the "LED" comes 'on' (conducts) -- and the voltage rises very little no matter WHAT the current is, up to about 25 mA. Above 25 mA, the LED burns out (permanently).

    A Capacitor charge rate is NOT linear, it follows the RC-curve. This is sharp in the beginning (voltage across the capacitor increases slowly at first, current increases sharply. Then, as the capacitor charges, the current drops off, and the capacitor reaches the input voltage.

    Read up on RC Time Constants -- and lookup the RCTime function, it should have some information on this.
  • YanroyYanroy Posts: 96
    edited 2005-08-19 12:59
    That's not entirely true - I think it was just a mixup of your wording.· A discharged cap will very quickly charge and then charge slower and slower as the voltage approaches that being applied to the cap.· The current does the same thing, with the cap looking like a short circuit for the first instant and as infinite time elapses it becomes an open circuit.· In between, it looks like a resistor.

    And yes, the RCTime function does exactly what you're proposing...
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-08-19 13:04
    Yup, what Yanroy said about the Capacitor charge rate, I had that part wrong.
  • metron9metron9 Posts: 1,100
    edited 2005-08-19 13:15
    This is where the books I have read so far have failed me. For example in the book
    "Electronics Theory with projects and experiments" By delton T. Horn, It talks about the RC time constant. Quote "The time it takes for the capacitance to be charged to 63% of its full potential charge level is called the time time constant of the combination" It has no mention of the charge curve. The basic stamp "What's a microcontroller" book that came with the Homework board has the PolledRcTimer project. It too fails to mention the decay rate is not linear. The Syntax pdf file for the basic stamp pbasic shows the following lines:

    time = -t x ( ln (Vfinal / Vinitial) )
    In this formula ln is the natural logarithm;

    not having any math background education the reference to logarithm and I suppose just looking at the equasion would tell someone that it was not linear but that's where I seem to be falling down on understanding how this hardware works compared to the way software works. When I use an assembler instruction LDA 00H for example, I can look at the processor manual and see exactil how many clock cycles it takes and i know exactly what it is doing. Many of the functions like RCtime for example are high level commands that are well and good for using in programming and of course I will experiment with it.

    I think what I need to do is understand the spec sheets on components. Copying circuits really is not good enough for me to learn what's really going on, I need to do every line of code, select each hardware component and put it together myself to actually retain and learn what is really going on. Like a capacitor, I would think the different types of capacitors have different curves or maby not.

    I guess that's why there are schools and teachers, but bear with me and I will try and squeeze as much detail to the lowest level of comprehention for each thing I experiment on.

    I will start another thread with a simple rc timer and a push button and explore the problem I seem to have with circuit building and pull up and pull down concepts that seem to look like short circuits to me but that is because I don't yet understand the full concept of electron flow and the path of least resistance. The small project I have in mind builds on this first one and I will explain in detail what I want the circuit to do, how I would build it and then see how many different circuits can be devised to do the same thing. But off to work I go, thanks for the detailed information in your post Allanlane5.
Sign In or Register to comment.