Shop OBEX P1 Docs P2 Docs Learn Events
Need Help with a circuit — Parallax Forums

Need Help with a circuit

SailerManSailerMan Posts: 337
edited 2007-12-05 17:49 in General Discussion
I'm hoping someone can help me, I have a circuit that is pulsed for 20us each 50ms I have an LED directly attached that I want to stay lit for the full 50ms, because I can't see it flash at that extreme rate (20us). Any Ideas on how to make the LED Persist for 50-100 ms with only a 20us pulse applied, using just discrete components.

I really hope that made sense and that someone has an Idea on how to accomplish this.

Thanks,
Eric

Comments

  • FranklinFranklin Posts: 4,747
    edited 2007-11-13 03:26
    For a toggle, on 50ms, off 50ms, repeat you could use a flipflop triggered on the 20us pulse or build a "pulse stretcher" circuit. Both can be Googled.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2007-11-13 08:37
    The 20uS pulse could pass through a diode to charge a small capacitor (~100pf) attached to the gate of a mosfet, and the mosfet keeps the LED turned on. It stays on so long as pulses keep coming and until the charge leaks off of the gate capacitor. Do you have a requirement for it to turn off after some exact time?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • SailerManSailerMan Posts: 337
    edited 2007-11-13 12:25
    Basically the 20us pulse triggers and Event that I just want an LED to be an indicator of that event. I am trying to used the Same IO pin that is generating this pulse to also trigger an LED. There are going to be 8 of these on the same circuit so I'm looking for something as simple as it comes.

    The LED Should be lit for about 50ms.

    Eric
  • CFFCFF Posts: 2
    edited 2007-12-01 21:02
    Use a NE555 timer chip as a one-shot (monostable multivibrator).

    Google 555 timer and you will get the data sheet & schematics.

    You can get the timer chips at Radio Shack for about $ 1.70
  • pjvpjv Posts: 1,903
    edited 2007-12-01 22:45
    Hi Sailer;

    Seems to me the only "discrete component" you need is an SX28, with maybe a regulator if it's not battery powered. The code is trivial, and you can put all eight circuits into the one chip to boot!

    Also you could choose whether you wanted rising or falling edge triggers, and with a couple of "raise/lower" buttons modify the LED on time, and with PWM even alter its brightness.

    As far as power consumption is concerned, it would run for a very long time on batteries (depending on how often it is used and triggered); the SX can have a fast wake up with a sleep current in the order of 10 micro amps.

    Come on folks, this is exactly the domain of the SX...... no other chips need apply!

    Cheers,

    Peter (pjv)

    P.S. If you like I will write the code for you, and send you a programmed chip!
  • kjennejohnkjennejohn Posts: 171
    edited 2007-12-02 18:37
    Hi. If you want simple, using discrete parts, try the circuit below. This is for a negative going pulse. If the pulse is positive going you'll have to reverse the diodes and hook things to ground. Of course this will load the circuit and effect the pulse edges. How much depends on the parts values, the processor's drive, and the driven circuits load and sensitivity to edge speed. The first LED is a simple signal diode, like the 1N4148. The LED should be a high-efficiency type, needing only one or two mA. You'll have to experiment with the resistor and capacitor.

    Theory of operation: The pulse comes and the capacitor charges quickly because the signal diode is a near short. The other load here is the LED, but the resistor limits the current flow so as to minimize load. The capacitor is a large load in the first instance, so be careful to use a size that does the job of lighting the LED for the time needed without killing the leading edge of the pulse. When the pulse ends, the capacitor is forced to discharge through the LED. The resistor and capacitor values determine how much current goes through the LED for a given time. This setup may not provide enough light to be detectable outdoors or in a bright room. You may not be able to make this work at all with a discretes-only circuit and you may have to use a 555 pulse-stretcher or other device.

    I hope this helps.
    Happy Holidays!
    kenjj
    430 x 262 - 18K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-12-02 20:06
    Attached is a circuit that should do what you want without loading the I/O pin. However, I'm with Peter: an SX28 is definitely a minimal solution as far as component count and board space is concerned.

    -Phil
    213 x 194 - 1K
  • SailerManSailerMan Posts: 337
    edited 2007-12-03 03:36
    Thanks all, I guess I should have said that I'm using an SX48 to create the pulses, but I didn't want to use 8 extra pins just to light LED's.

    Phil, I like this Idea. Now I need to find Or gates in singles [noparse]:)[/noparse] ............................... Well it looks like Fairchild makes "Tiny Logic" Two input or gates in an SC70/5 package.

    What Cap and Resistor would you Start with?

    Thanks,
    Eric

    Post Edited (SailerMan) : 12/3/2007 3:45:08 AM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-12-03 05:03
    Eric,

    As long as R x C = 50ms, you should be in the ballpark. Try 470K with 0.1µF to start. I'd breadboard it with a 74HC32 DIP first, just to make sure it works, since I haven't actually tried it.

    -Phil
  • SailerManSailerMan Posts: 337
    edited 2007-12-03 12:25
    Phil,

    Thanks, I'm not sure if I have 74HC32's I'll have to check when I get home tonight, but I'll definitely breadboard it first... I really do hope this works

    Thanks for everyones input.

    Eric
  • SailerManSailerMan Posts: 337
    edited 2007-12-04 19:15
    Darn, I don't have any 74hc32's Does anyone with a paypal account want to sell a couple of these things? [noparse]:)[/noparse]
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-12-04 20:33
    What gates do you have? There's more than one way to skin this cat. For example, you can construct an OR gate from NAND gates just to try out the circuit.

    -Phil
  • kjennejohnkjennejohn Posts: 171
    edited 2007-12-04 20:37
    Hi. It seems to me you can take any logic gate (AND, OR, NOT, NOR, NAND) and use it with the circuit I provided earlier. Insert the gate between the processor's output and the first diode. The AND and OR will work with the circuit above without mods. The other gates invert, so do the backwards hookup mentioned for the positive going pulse. You haven't said if the pulse is negative-going or positive going. The final hookup depends on which way it goes. Let us know this, and which gates you have (by chip number, like 74xx, if you want) and we'll supply the circuit. BTW, Going from 20uS to 50mS is quite a push. If the LED appears dim, the problem may be that the single gate lacks the drive to fully charge the cap. You can double up on the gates, or more, in each circuit to achieve the drive you need.

    Hope this helps.

    Happy holidays!

    kenjj
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-12-04 22:19
    Correct, in fact given an unlimited supply of 74x00, you can create anything. In college we did just that, we used NANDs to create every other chip in our component box in a ladder approach. For example, use NANDs to create a NOR gate, once we did that we could use NOR gates in our designs. Then use NANDs and NORs to create a 74x74 D flip-flop, then we could use 74x74s when creating a 74x163 counter, so on and so forth until all of our logic chips were recreated. All of this is possible because of DeMorgan's Theorem: http://hyperphysics.phy-astr.gsu.edu/hbase/electronic/demorgan.html

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • adriftadrift Posts: 25
    edited 2007-12-05 00:44
    You can use an npn transistor as the gate.· Ground the emitter.· Put 10k in the base lead for the input pulse and·connect the·LED cathode·to the collector·followed by·a 10k resistor from the anode of the·LED to 5v or 12v or whatever.· Put a fair sized cap also from the collector to ground...say 1 uf· with appropriate voltage rating.· You can change the cap size based on what value you have and how long the led on-time looks.· So the 20usec pulse into the base drives the collector to· ground and discharges the cap.· The cap slowly rises toward the supply voltage and the led stays lit for some time.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Regards,
    Jim
  • SailerManSailerMan Posts: 337
    edited 2007-12-05 01:09
    I have some 7400 and 7404, I actually never used these. It is a positive going pulse that I can make a little longer if necessary.

    I appreciated everyones help...

    "in fact given an unlimited supply of 74x00, you can create anything" - That makes my head spin. [noparse]:)[/noparse]

    Eric
    ·
  • adriftadrift Posts: 25
    edited 2007-12-05 01:16
    Try the single transistor first-- though it's not elegant it works.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Regards,
    Jim
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-12-05 01:39
    Eric,

    I doubt my circuit will work with TTL logic, since the input will source current to the cap. It needs to be CMOS. Lacking ICs from the appropriate logic family, I'd give Tracy's circuit with the MOSFET a go.

    -Phil
  • SailerManSailerMan Posts: 337
    edited 2007-12-05 02:29
    I'll try both Tracy's and Jim's. Jim, Can you show me a schematic of what your talking about?
  • adriftadrift Posts: 25
    edited 2007-12-05 02:58
    It'll take me a few minutes unless you have circuitmaker 6 or 2000.

    I think I attached it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Regards,
    Jim

    Post Edited (adrift) : 12/5/2007 4:01:29 AM GMT
    437 x 336 - 3K
    587 x 452 - 18K
  • SailerManSailerMan Posts: 337
    edited 2007-12-05 03:03
    Nope don't have Circuitmaker, I use Diptrace. I don't know why this circuit is eluding me. Ugh!
  • kjennejohnkjennejohn Posts: 171
    edited 2007-12-05 07:12
    Ah! You have a positive going pulse and some 04s. Try the circuit shown here. It's the same as above, but using gates from the 04. You may get away with a single gate. If you need more drive, just keep adding more gates in parallel, as shown.

    Happy holidays!
    kenjj
    540 x 302 - 23K
  • SailerManSailerMan Posts: 337
    edited 2007-12-05 13:04
    Jim,

    Ok I had that breadboarded, but In your original E-mail, I used the suggested 10k Resistor. I will rebuild this circuit with a 1K on the collector, If I would have had my mind working last night I would have done that, but I was too tired. In any case thanks.

    kenjj,

    I will try you setup also... Thanks.

    Eric
  • adriftadrift Posts: 25
    edited 2007-12-05 16:54
    The·bipolar version may be too hard to tweak because of the large hold time you need.· Here's a better one that combines some of the other contributions.· It uses the 2n7000, an enhancement mosfet.· If you don't have that one, tell me which ones you have. it depends on the 20usec signal being more than 3 or 4 volts.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Regards,
    Jim
    339 x 291 - 10K
  • SailerManSailerMan Posts: 337
    edited 2007-12-05 17:28
    Jim,

    You're probably going to shoot me but I never noticed the Voltage you are using. I can't use 10 volts I only have 5 volts on the board. and the pulses are coming from an SX48 so I'm assuming they'll be 5v also..

    I Guess my best bet is to try to route these 8 LED From the SX instead of using discrete components to stretch the pulse. What a pain on a double sided board. [noparse]:)[/noparse]

    I was hoping to use the same signal line as a way to light my indicator LEDs If only the Triggering time was 50 ms I'd be set. [noparse]:)[/noparse]

    OK well Let's assume that my signal pulse was 50 ms... and that was long enough for the LED to be lit and be seen brightly.. I now just want to make sure that the LED does not load down the pulse.. Would I just use a simple NPN , Collector to Ground, Base to the pulse Signal and the Emitter throught a resistor and LED to 5v.

    Eric
  • adriftadrift Posts: 25
    edited 2007-12-05 17:49
    Sailerman, I seem to have replied in the wrong place in the thread regarding a mosfet for the 20usec pulse case. Try the MOS first, it will work at 5 volts as well for the 'vcc' source supply, but not 3.3 Re your question here, you describe an emittert follower, a good choice, but you need a pnp to ground the collector. It would lite on a low. If the 48 puts out 3.3v vice 5v when high, and if you choose to use 5v for the led part, then adding a diode is probably needed in series with the base, cathode to the 48, anode to the base of the pnp to make sure the led is off when the 48 is high.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Regards,
    Jim
Sign In or Register to comment.