Searching \ for ' [pic] Scary Halloween PIC Trick' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Scary Halloween PIC Trick'.

No exact or substring matches. trying for part
PICList Thread
'[PICLIST] [pic] Scary Halloween PIC Trick'
2000\10\27@162058 by Alice Campbell

flavicon
face
Hell Esteemed Listmembers:

I am finishing up the electronics for my kid's halloween
costume, and i have encountered the following problem:

I am flashing an LED in superluminant mode via a 2n2222
transistor switched via a resistor on a 16f877 porta pin.
Power (5 volts nominal) comes into the NPN collector via a 33
ohm resistor. This resistor feeds the LED, whose anode goes
the the collector and anode goes to the resistor.  A 100uF
cap goes between the same node and ground, for extra oomph.
A 8K-10K resistor connects the NPN base to the pic pin, and
the emitter goes to ground.  Simple flasher circuit, nothing
wierd.

Except that the pic wont flash it when i send the command to
the pin.  However, if i hit reset/MCLR, the reset will dump
drop the pin very well and flash the LED.  I can use it this
way, and just use the reset to make it flash, but i really
dont understand why i cant just flash it from the pic pin.

Same thing for trickle-charging the cap off a pic pin, i cant
seem to get that to work either, and id rather not have the
flash connected to the battery directly, as i would rather
not use a regulator.  Is the problem in both instances the
porta pins themselves?

The final will be ported to a 12c509a this weekend.

Thanks,

alice

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use spam_OUTlistservTakeThisOuTspammitvma.mit.edu?body=SET%20PICList%20DIGEST




2000\10\27@162924 by MEDICINTEKNIK KB

picon face
Alice !

Not the classic PortA, pin 4 no-pullup ?

Looked at the OSC Out ? Oscillator running ?

Sven

-----Ursprungligt meddelande-----
Från: Alice Campbell <.....acampbellKILLspamspam@spam@SCSENGINEERS.COM>
Till: PICLISTspamKILLspamMITVMA.MIT.EDU <.....PICLISTKILLspamspam.....MITVMA.MIT.EDU>
Datum: den 27 oktober 2000 22:21
Ämne: [pic] Scary Halloween PIC Trick


Hell Esteemed Listmembers:

I am finishing up the electronics for my kid's halloween
costume, and i have encountered the following problem:

I am flashing an LED in superluminant mode via a 2n2222
transistor switched via a resistor on a 16f877 porta pin.
Power (5 volts nominal) comes into the NPN collector via a 33
ohm resistor. This resistor feeds the LED, whose anode goes
the the collector and anode goes to the resistor.  A 100uF
cap goes between the same node and ground, for extra oomph.
A 8K-10K resistor connects the NPN base to the pic pin, and
the emitter goes to ground.  Simple flasher circuit, nothing
wierd.

Except that the pic wont flash it when i send the command to
the pin.  However, if i hit reset/MCLR, the reset will dump
drop the pin very well and flash the LED.  I can use it this
way, and just use the reset to make it flash, but i really
dont understand why i cant just flash it from the pic pin.

Same thing for trickle-charging the cap off a pic pin, i cant
seem to get that to work either, and id rather not have the
flash connected to the battery directly, as i would rather
not use a regulator.  Is the problem in both instances the
porta pins themselves?

The final will be ported to a 12c509a this weekend.

Thanks,

alice

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use EraseMElistservspam_OUTspamTakeThisOuTmitvma.mit.edu?body=SET%20PICList%20DIGEST

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use listservspamspam_OUTmitvma.mit.edu?bodyT%20PICList%20DIGEST




2000\10\27@165430 by Dan Michaels

flavicon
face
ALice Campbell wrote:
>Hell Esteemed Listmembers:
>

"Hell Esteemed", huh.
==========

{Quote hidden}

Emitter to gnd?
Current thru LED is (5-1v)/33ohm = 120 mA?
Cap is where?

Confused - can you draw this?

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use @spam@listservKILLspamspammitvma.mit.edu?body=SET%20PICList%20DIGEST




2000\10\27@174906 by Jinx

face picon face
Pin set for i/p instead of o/p ?

Or even accidentally driving the wrong pin ?

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use KILLspamlistservKILLspamspammitvma.mit.edu?body=SET%20PICList%20DIGEST




2000\10\27@192546 by Alice Campbell

flavicon
face
OK:
the basic idea is from Fr. Tom, 17/6/1999

           +5v
           |
           Z  33 ohm
           +---||-----Gnd
           V led  100uF or so
PIC         C
RA0-WWW----B     generic NPN
    10K    E
           |
          Gnd

yes, i know the current is high but im just flashing it for a
few microseconds with plenty of recovery and cool phaser
sounds.

There is no feedback resistor between C and B of transistor.

ADCON is set to analog and output.

The RA4 no pullup bit me a couple of weeks ago, so now i know
better.

alice


{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use spamBeGonelistservspamBeGonespammitvma.mit.edu?body=SET%20PICList%20DIGEST




2000\10\27@201039 by Arthur Brown

flavicon
face
Alice
can you drive a led via a 1k resistor from the port?.
The pulse from the pic may be very narrow?. so it looks like it's not
pulsing the led.
I would have used 220R to 470R resistor to the base as the gain of the
2N2222 may be low,
does it work without the cap as it may be leaking or working against driving
the led.
I have Pulsed IrLeds at 2Amp without them failing,
you are pulling about 90ma static you could up that a bit if you get it
pulsing.

Regards Art.

{Original Message removed}

2000\10\27@201443 by Dan Michaels

flavicon
face
ALice wrote:
{Quote hidden}

1. Sure you didn't fry the bjt the first time you fired this
  thing? Usually nice to current limit a little more - larger Rc.

2. Be sure bjt insn't in backwards.

3. A "few usec" probably too short to see the flash.

4. Current gain of bjt probably pretty small at the collector
  currents you're trying to drive. Might try decreasing Rb to 1K.
  Course, doing this "and" increasing the pulse width will probably
  fry the bjt, unless you increase Rc.

5. You may be dragging down Vcc when firing.

6. Try ADCON = digital, rather than analog, or try the ckt on RA2
  and set that pin to digital [note - this selection also sets
  RA5 = digital].

7. I try to never stick anything but analog on RA - since I
  always have some analog, it's generally too much trouble to
  run digital off that port, too.

cya,
- danM

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use TakeThisOuTlistservEraseMEspamspam_OUTmitvma.mit.edu?body=SET%20PICList%20DIGEST




2000\10\27@203615 by Brian Aase
flavicon
face
Dumping a 100 uF cap right through into the LED
is going to create a pretty high current pulse.  My
experience is that a PN2222 won't be too happy
about this.  You might try something a bit more
robust.  For hobby work, a 2N4401 might be okay.
If it were a mass-production circuit, Zetex makes
some parts that are perfect for this kind of application.
Changing the base drive resistor down to 1K will help
too.

Also, I don't think you're going to see a "few microsecond"
pulse.  Try something more like 10 - 25 milliseconds.

Brian Aase

{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use RemoveMElistservspamTakeThisOuTmitvma.mit.edu?body=SET%20PICList%20DIGEST




2000\10\27@203806 by David VanHorn

flavicon
face
Are you sure that the PIC output goes low enough that the transistor turns off?

Also, the C value seems awfully small. 1000uF might be a better idea.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use listservEraseMEspam.....mitvma.mit.edu?body=SET%20PICList%20DIGEST




2000\10\28@121459 by Donald L Burdette

picon face
Alice -

Are you sure the LED doesn't fire?  I mean have you looked at it on a
scope?

With 10K on the base, you are going to have about 0.5mA base current (a
little less, actually).  A 2N2222 will give about 50-150 mA collector
current with this base drive.  That is the limit of how much current you
will get, no matter how much supply you have available.

Even 200 mA for 10 uS gives you about 4 uJ of energy in the LED, assuming
2.0V across the LED.  This is the same as 2 mA for 1 mS.  You won't see
that unless you look really, really close.

I'd guess that when you reset the PIC, the LED gets turned on for some
milliseconds, giving you 1000 times more light energy, and allowing you
to see the pulse.

To fix your project, I'd do several things.  First, increase the base
drive by reducing the resistor to 470 ohms, or even 220 (the minimum you
should use on a PIC output driving a low-impedance load).  Second, use a
much longer pulse.  A few milliseconds to a few tens of milliseconds is
about right.  At 10 mS, you can probably use currents like 0.5 to 1A, so
long as you don't repeat too often (once per second or less).  Third, I'd
re-wire the circuit a bit.  I don't like unrestricted currents.  When you
turn on the transistor, the cap dumps through the LED and transistor.
The only things that limit the current are the gain of the transistor and
the series impedances of the cap, the LED, and your wires.  I'd put a
resistor in series with the cap, like a few ohms, to set the max current
that can flow.  Remember that the current will be more like 2V/r than
5V/r because you loose a bunch of volts on the LED and transistor.

If you still want to use really short, high-current pulses, use a better
transistor.  The 2N2222 will not give you more than about 0.5A no matter
how hard you drive it, and I would never ask for more than 200 mA from
it.  For 200 mA, I'd give it 10-20 mA of base drive, which is about all
you're going to get from the PIC.  Don't forget to check the '509 drive
specs.  I think they're not as good as most PIC's.

If I were to choose a better transistor for this job, I'd get a big
darlington BJT, probably in a TO-220 package (not for power, but because
high-current ones are in those packages), or use one of the Zetex
high-current TO-92 jobs from Digi-Key.  Or I might choose a FET.  There
are many good ones in TO-220, and some in SO-8 or even DIP-4 packages.  I
might look at the IRL510/520/530.  You want a current rating of 5+ amps
and Rds(on) of well under an ohm.

If you're ordering from DK, look at the ZTX603 darlington or the IRL530
(TO-220) or IRLD024 (DIP-4) FET's.  The FET's will take 5-10 microseconds
or even more to turn on and off because of gate capacitance.  Darlingtons
also take a while to turn on/off, but I know less about that.  Bigger is
not always better!

Good luck!

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspammitvma.mit.edu




2000\10\28@183854 by Andy Howard

picon face
----- Original Message -----
From: "Dan Michaels" <RemoveMEoricomEraseMEspamEraseMEUSWEST.NET>
To: <RemoveMEPICLISTspam_OUTspamKILLspamMITVMA.MIT.EDU>
Sent: Friday, October 27, 2000 9:54 PM
Subject: Re: [pic] Scary Halloween PIC Trick


> ALice Campbell wrote:
> >Hell Esteemed Listmembers:
> >
>
> "Hell Esteemed", huh.
> ==========



Well it is a Halloween costume...

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestTakeThisOuTspamspammitvma.mit.edu




2000\10\29@135514 by Peter L. Peres

picon face
Hi Alice,

unless you have a superbeta TRZ it won't work. You supply a base current
of 5V/10K = 500 uA and you require Ic = 120 mA. That's a beta of about 250
(at Ic = 120 mA). In a 2N2222's dreams.

You need to reduce the 10K as much as possible (to 220R or so). This will
put some 25 mA into the base and require a beta of 10 or so, which is more
like a real life 2N2222 at 120 mA. You can parallel several PIC pins to
drive more power.

Next time you do this obtain some logic level VFETS (Siliconix BSSxxx
f.ex., TO92 case), which will switch 1A,150V with NO base current easy.

Peter

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
"[PIC]:","[SX]:","[AVR]:" =uP ONLY! "[EE]:","[OT]:" =Other "[BUY]:","[AD]:" =Ads




2000\10\30@125011 by Thomas McGahee

flavicon
face
Alice,

Change the 33 ohm resistor to something between 270 ohm and 1k.
  This will reduce the current drawn from the power supply.
Change the 10k base resistor to 270 ohms.
  This will increase base current and results in greater collector
  current.
Change the 2N2222 to something more heavy duty.
  The 2N2222 was not designed for such large current pulses
  and might be damaged if excessive current flows.

The 100 ufd capacitor value should be OK. Once you have the
circuit working you can tweak it by trying larger size caps.

Pulse the PIC output positive for 25 milliseconds.
  You have to produce light for a certain minimum time or else
  it will seem quite dim.

Keep the time between pulses long enough for the capacitor
to recharge. This also ensures that the LED does not overheat.

Make sure the PIC power pins have decent bypass caps installed.
A 10 uf paralleled with a .1 uf should be sufficient. Mount these
as close to the power pins as possible.

Ensure that the PIC output itself is working properly.
If possible, observe it on a scope with the base resistor
temporarily disconnected.

Make sure the i/o pin is set for digital operation, NOT analog.
If you have to, move the function to some other i/o pin.
Avoid use of any "open drain" i/o pin for this application.

Fr. Tom McGahee

{Original Message removed}

More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...