Searching \ for '[EE:] Two newbie questions on inverting' 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/index.htm?key=two+newbie+questions
Search entire site for: 'Two newbie questions on inverting'.

Exact match. Not showing close matches.
PICList Thread
'[EE:] Two newbie questions on inverting'
2004\06\15@182719 by Robert Rothe

picon face
I'm still learning, so please forgive my ignorance.  I have an IR detection module (an old radio shack one) that detects IR signaling at about 40 kHz.  It drives its data line LOW when a signal is received.  I have it hooked up to shut OFF an LED when a signal is present using this circuit:



                                     VCC 5Volt
                                      +
                                      |
             o-------------------------
             |                        |
             |                        |
             |                       .-.
             |                       | |300R
             |                       | |
             |                       '-'
             |                        |
             |                        |
             |                        |
             |                        V LED
             |                        -
             |                        |
             |                        |
           2 o                        |
                              ___   |/
      IR   1 o--------------o|___|--| NPN n2222
      Recvr                   1K    |>
                                      |
           3 o                        |
             |                        |
             |                        |
             |                       ===
            ===                      GND
            GND



I wanted to invert the process so that the LED lights when a signal is present so I tried this circuit:

                                     VCC 5Volt
                                      +
                                      |
             o-------------------------
             |                        |
             |                        |
             |                       .-.
             |                       | |300R
             |                       | |
             |                       '-'
             |                        |
             |                        |
             |                        |       LED
             |                        +------->|------+
             |                        |               |
             |                        |              ===
             |                        |              GND
           2 o                        |
                              ___   |/
      IR   1 o--------------o|___|--| NPN n2222
      Recvr                   1K    |>
                                      |
           3 o                        |
             |                        |
             |                        |
             |                       ===
            ===                      GND
            GND



This seemed to work OK except that I get some odd indications on the LED that IR is being detected.   I suspect they were there in circuit #1, but couldn't be seen.  (I grounded the metal can of the detector module.  Putting a sunglass lens over the module helped a bit, too)

Are these (especially the second) the right way to do this?

My second question is, if I decided to just use an inverter (ie, 7404), I'm unclear how to determine in the data sheet how much current it (the 7404) can sink.

Sorry for the simple questions.  Any help would be greatly appreciated.



Rob

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

2004\06\15@184435 by rixy04

flavicon
face
Just tie the collector to + and put your 300R and LED in the emitter to ground.
Rick

Robert Rothe wrote:

{Quote hidden}

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

2004\06\16@001020 by Matthew Brush

flavicon
face
Or switch that NPN to a PNP and re-arrange the circuit
accordingly.  Or you could use two NPN transistors.
Not sure if either of these are the "right" way to do
it, but they'll both work fine for an LED.

If all you're driving is an LED, I'm sure the inverter
IC can handle that.

Cheers.


--- rixy04 <spam_OUTrixy04TakeThisOuTspamVVALLEY.COM> wrote: > Just tie the
collector to + and put your 300R and
{Quote hidden}

=====
MJ Brush
LeftClick.ca Internet Media Services
mbrush@[NOSPAM]leftclick.ca

______________________________________________________________________
Post your free ad now! http://personals.yahoo.ca

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\06\16@005206 by hilip Stortz

picon face
look up the data sheet, depending on the logic family, most of them can
drive 5-20 ma, some that are also buffers or are open collector can
drive more.  in any case, most chips won't be damaged, though you may
get less current through the led than you expect.  as long as the chip
doesn't dissipate too much power there is rarely a problem, even with
shorted outputs.  a 7404 can very safely handle 10 ma.  most data sheets
will state an output voltage and current, or output voltage vs. current
for "normal" logic levels.  74 series chips should be able to sink 10ma,
that is pull that much current to ground, if the led were connected
between ground and the logic output then you probably would have trouble
getting enough current through it but you still probably wouldn't damage
the gate.  if it's a 74ls i believe it's 5 ma, for other logic families
i'd have to look it up.  national semi parts are usually "standard",
some ti parts have improved specs over industry standard, so be careful
if you look at the ti data sheet but use another brand of chip.  for
instance, i just checked the 74hct04 data sheet from ti (because i have
it handy, i'm using one in a current project) and it can sink 4 ma for
something like driving an led.  you might check my numbers, it may only
be 8 ma for straight 74 series and 4 for 74ls, though like i said you
wouldn't do damage, the output voltage on the chip would just be higher
which is usually only a problem if you are trying to drive an led and
another gate from that output.

Matthew Brush wrote:
{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\06\16@074043 by rixy04

flavicon
face
Matthew Brush wrote:

> Or switch that NPN to a PNP and re-arrange the circuit
> accordingly.

That's adding more parts.

> Or you could use two NPN transistors.
>

That's adding more parts.

> Not sure if either of these are the "right" way to do
> it, but they'll both work fine for an LED.
>
> If all you're driving is an LED, I'm sure the inverter
> IC can handle that.
>

That's adding more parts.
Rick

>
> Cheers.
>

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\06\16@085839 by Robert Rothe

picon face
Thanks to all who responded.    Rick, I'm not sure how your original suggestion (Collector to +, LED/RES to Emitter) answers the inversion question -- unless I'm not understanding.  Seems that would just convert the circuit from a common emitter to a common collector circuit.  I'll try it, of course.

If there is a "right" answer, I think it is to either use an PNP or two NPN's.  Ultimately, the signal needs to find it's way into a PIC but I wanted to also provide an accurate visual representation that could exist without the PIC (ie, for a repeater or an extender).

As for the Hex Inverter; if I use one, I'll use it to drive a transistor instead of the LED directly.

Thanks again for the responses.

Rob




{Original Message removed}

2004\06\16@091017 by rixy04

flavicon
face
Your question is that the original circuit would shut off when the IR det. sensed. Your first circuit used the transistor as an inverter/driver.

If you tied the collector to + and your led/resistor in the emitter, you have what's called a non-inverting follower/driver. When the IR det. sensed, the led would light. Isn't that what you want?

Rick

Robert Rothe wrote:

> Thanks to all who responded.    Rick, I'm not sure how your original suggestion (Collector to +, LED/RES to Emitter) answers the inversion question -- unless I'm not understanding.  Seems that would just convert the circuit from a common emitter to a common collector circuit.  I'll try it, of course.
>
> If there is a "right" answer, I think it is to either use an PNP or two NPN's.  Ultimately, the signal needs to find it's way into a PIC but I wanted to also provide an accurate visual representation that could exist without the PIC (ie, for a repeater or an extender).
>
> As for the Hex Inverter; if I use one, I'll use it to drive a transistor instead of the LED directly.
>
> Thanks again for the responses.
>
> Rob
>
> {Original Message removed}

2004\06\16@092159 by Russell McMahon

face
flavicon
face
> Thanks to all who responded.    Rick, I'm not sure how your original
suggestion (Collector to +, LED/RES to Emitter) answers the inversion
question -- unless I'm not understanding.  Seems that would just convert the
circuit from a common emitter to a common collector circuit.  I'll try it,
of course.
>

You are right. But it may be what you want. The original common collector
circuit inverts, and the common emitter one doesn't.

However, if you are getting some flickering in cct 2 when the LED is mainly
off, this means that the IC is not holding the transistor fully on. At the
cost of one more component, you could add a resistor from V+ to either
transistor base or IC output. You'd want to look at the IC data sheet to
size the resistor and find best location OR you could play. I'd guess that a
10k from +5 to transistor base would make a difference. Whether it's enough
is hard to tell with the data available.

BTW - your 2nd circuit is a cunning one - its a perfectly legitimate but
unusual approach to what you are trying to do. It's main drawback is that
you draw current via the collector resistor at all times whether the LED is
off or on. This may not be a major issue. If it is, then using a PNP and
inverting the circuit, as Matthew suggested, would be an easy fix. This may
still have problems with occasional unwanted on-flicker depending on what is
really happening. Resistor as above should help.

If the IC is in fact producing small output transients when there is no
wanted input then you may have to either eliminate them (why are they
happening?), or filter the inverter input (suitable cap from base to ground
or possibly IC output to ground).

If we knew the IR IC type we could make more accurate comments.
If available, an oscilloscope on the IC output would be useful.

Dangerous assertion: An oscilloscope is THE single most useful tool that an
electrical engineer can have.



       Russell McMahon

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\06\16@093056 by rixy04

flavicon
face
I also assumed he's getting a little noise through the detector. Also keep in
mind that the inverter is also providing gain whereas the follower (putting the
led in the emitter) is less than unity. This may not be much, but it may reduce
the noise on the output.
rick

Russell McMahon wrote:

{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\06\16@120752 by Robert Rothe

picon face
This is excellent advice.  I need to play with the common emitter/collector options to better understand what you're (both) talking about.  I'm having trouble understanding why one would follow and the other invert.

As an fyi, the IR detector module is a GP1U52X.  Pretty old, dusty stock.

Also as an fyi:  The flicker is probably caused by infrared transients from the room lights.  Most commercial applications I've seen use some type of IR filter (plastic/glass) to help with this; although I haven't discounted power supply issues or transistor problems.

Thanks again for the valuable advice.  I really appreciate it.

Rob


{Original Message removed}

2004\06\16@153327 by Matthew Brush

flavicon
face
> > Or switch that NPN to a PNP and re-arrange the
> circuit
> > accordingly.
>
> That's adding more parts.

Well, it's actually replacing a part, not adding
"extra" parts.

> > If all you're driving is an LED, I'm sure the
> inverter
> > IC can handle that.
> >
>
> That's adding more parts.

He asked about an inverter, it's not my idea!

Cheers

=====
MJ Brush
LeftClick.ca Internet Media Services
mbrush@[NOSPAM]leftclick.ca

______________________________________________________________________
Post your free ad now! http://personals.yahoo.ca

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\06\16@154947 by Matthew Brush

flavicon
face
You might want to consider the Panasonic 4602 (Digikey
# PNA4602).  They are relatively cheap (under $2
IIRC), and they have a filter on the detector and all
that integrated junk.

When I used one, I set my PIC interrupt to Falling
Edge and in my Interrupt Service Routine, I turned on
an LED on another PIC pin for visual indication, it
worked perfectly.

Cheers

--- Robert Rothe <rrothespamKILLspamMINDSPRING.COM> wrote: > I'm
still learning, so please forgive my ignorance.
{Quote hidden}

=====
MJ Brush
LeftClick.ca Internet Media Services
mbrush@[NOSPAM]leftclick.ca

______________________________________________________________________
Post your free ad now! http://personals.yahoo.ca

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

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