Searching \ for '[PIC]: Driving a dual LED' 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/displays.htm?key=led
Search entire site for: 'Driving a dual LED'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Driving a dual LED'
2002\01\31@181025 by Josh Koffman

flavicon
face
Hi all. I had an idea for driving a bi colour LED using only one pin. My
basic idea is to get one switch and one bi colour LED (basically 2 LEDs
back to back) to work over just 3 wires. Here is a pic of the remote end
of this (drawn by hand as Roman has taken his page down):

        (-|>-)bi colour LED   _=_ Switch
     ,--(    )--,------------o   o--,
     |  (-<|-)  |                   |
     |          |                   |
     |          |                   |
     |          |                   |
     O          O                   O
    1          2                   3


1= PIC Output
2= +2.5 Volt
3= PIC Input


Basically the idea is to float one end of the LED in the middle of the
PIC output range so that when I output a low, one LED is forward biased,
and when I output a high, the other LED is forward biased. If I want the
LEDs off, I'd tristate the pin.

So...will this work? I'd have to make sure the LEDs have a forward
voltage of under 2.5V I guess. What will happen with the input pin? What
will the PIC do with 2.5V on an input? Is that a high (because it is
greater that .8V)? The other question is will this work over a long
wire? Since the currents are so low, will line drop become a factor,
making the voltage too low to forward bias the LEDs? I guess the other
question is how to generate the 2.5V. Could I use a zener, or is there
such a thing as a 2.5V zener?

Thanks,

Josh

--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams

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



'[PIC]: Driving a dual LED'
2002\02\01@110009 by Lawrence Lile
flavicon
face
Wow, i just worked this out a couple of days ago.  Genius minds think alike,
no?  ;-)  Here are your problems:

1.  You need a limiting resistor to control current into the LED.

2. Your red and your green LED have different forward voltages.  The LED I
am getting from Kingbright has a forward voltage of 1.8 volts on red, 2.05
volts on green, at 10mA forward current in each case.  Also, the green is
about 1/5th as efficient as the red.  The result will be, with the same
resistor,  the green will be much dimmer.  I am building a sample board soon
to test this idea.  Kingbright L937SRSGW-RV.

3. You may end up adjusting the 2.5 volt supply to, say, 2.75 or 3 volts to
get your LED's balanced.

4. Back-to-back LED's are not so common. but Kingbright does make them and
are quick with samples.  Most two-color LED's are three pin,  like this:

---aDk--kDa---
           |

(My first piece of ascii art, Roman would be proud of me. )

5. A lot of these dual color LEDs are low-efficiency types.  I didn't find
many suppliers for dual high efficiency LED's.  I like the high efficiency
types because they have more punch.  You may be dissappointed with the color
on some LED's - try them out in your application before deciding.

6. I never came up with a scheme to drive the standard, three-pin dual LED's
with one PIC pin, without a bunch of external transistors.  So I am stuck
with the two-pin back-to-back  dual LEDs, which may be specials but still
cheaper than two transistors and several resistors, plus a square foot of
board space.  <sarcasm>

7. 2.5 volt regulators are not so common, but they do exist.  When all your
PIC outputs are high, you'll be pumping current INTO your 2.5 volt supply,
which it cannot regulate if it is a standard 3 pin regulator.  I've got
power to waste,so I just loaded the regulator with a resistor big enough to
swamp the current sourced out of my PIC.  If you are counting microwatts,
this won't serve for you.  Zeners stink below 3.9 volts, they don't have a
sharp "knee", and don't regulate worth a darn.  I gave up on them a while
ago.

Despite the problems, I am going ahead with a project with an array of 8
dual color LED's, red and green.  The display will be lit up like Hong Kong
at night.

--Lawrence

{Original Message removed}

2002\02\01@175717 by Lawrence Lile

flavicon
face
I have been struggling with a prototype of back-to-back dual LED's today.
It looks like it won't be real easy:

1.  I first hooked them up like this:

                   _aDk_
RA3 ---------|           |------50R--------2.5V supply
                   |_kDa-|                        |
                                                       27R
                                                       |
                                                       GND


As predicted the red was way brighter than the green, until I tweaked up the
power supply.  The extra 27 ohms to ground was needed because the red lamp
feeds current into the power supply, which it can't regulate, and the 50 ohm
is for current limiting.


I then tried an arrangement like this:

                                                       5VDC
                                                       |
                                                       47R
                   _aDk_                        |
RA3 ---------|           |-------------------|
                   |_kDa-|                        |
                                                       47R
                                                       |
                                                       GND

This is essentially the thevenin equivalent of a 23.5 ohm resistor in series
with a 2.5 volt power supply.  For some reason, the current and the
brightness seemed more similar in this case.  Current was about 11mA red and
10mA green

I then hooked up two LED's to the same resistor divider,from different port
pins. Predictably each had less current, 9mA.

This whole arrangement is a real power hog.  I am thinking about running the
resistor divider from an unregulated power supply.  I have to drive 8 LED's
from this arrangement, and my calcs say that I'd need a resistor divider
like this to run them all:

   5VDC
   |
   |
   3R
   |
   |-------- 2.5 volt supply
   |
   3R
   |
   GND

Sheesh!  There's gotta be a better way to skin a cat.

--Lawrence

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


2002\02\01@191247 by Ashley Roll

flavicon
face
Hi Lawrence,

Not sure exactly what your requirements are but if you can multiplex and
have 9 pins you can easily drive the 8 bi-colour LEDs. This is a trick I've
done before and it only requires a few normal current limiting resistors.
I've done this trick with two single colour LEDs per leg (wired like a
bi-colour), so I'm sure this will work.

PIN1 >------------,
                 |
                LED
                 |
PIN2 >---/\/\/\---+
                 |
                LED
                 |
PIN3 >------------+
                 |
                LED
                 |
PIN4 >---/\/\/\---+
                 |
                LED
                 |
PIN5 >------------+
                 |
                LED
                 |
PIN6 >---/\/\/\---+
                 |
                LED
                 |
PIN7 >------------+
                 |
                LED
                 |
PIN8 >---/\/\/\---+
                 |
                LED
                 |
PIN9 >------------+

Basically you have to multiplex the two pins connected to the LED you want
to be high and low one way around gives you red, the other gives you green.
The trick is that all the other pins need to be tri-stated at the same time
otherwise several of the other LEDs will light as well. Do a lookup table
for the 16 individual LEDs for the values of the pins and another for the
tri-state values and then just scan them.

Another alternative could be a 74hc138 3 to 8 decoder. You can multiplex 8
single LEDs or 4 bi-colour LEDs with just 4 pins (3 + Chip select so you can
turn them all off).. You simply use the '138 pin as a pull down for a single
LED (with one limiting resistor for all to the 5V line as only one is on at
once. For bi-colour LEDs you put then across two pins with a resistor so
that you can make either leg of the LED low, the other one will always be
high

I was struggling to fit enough LEDs (5 single and one bi-colour) in a
project myself and rather then take the step up the a bigger PIC I threw in
a '138 and managed to fit them all in. Actually I only used 7 of the pins so
I can turn them all off by sending address "0" so I eliminate the extra pin
for the chip select:

         ,---------,
PIC1 >---|A   7  Y0|-NC
PIC2 >---|B   4  Y1|---K LED A---+-----------/\/\/\---> 5V
PIC3 >---|C   H  Y2|---K LED A---|
         |    C  Y3|---K LED A---|
         |    1  Y4|---K LED A---|
         |    3  Y5|---K LED A---'
         |    8  Y6|---/\/\/\---BiColLED--,
         |       Y7|----------------------'
         '---------'

note I haven't tested this circuit yet, but it should work..

Hope that helps
Cheers,
Ash.

---
Ashley Roll
Digital Nemesis Pty Ltd
http://www.digitalnemesis.com
Mobile: +61 (0)417 705 718




> {Original Message removed}

2002\02\02@190122 by Roman Black

flavicon
face
Josh Koffman wrote:
{Quote hidden}

Is there a specific challenge? Like how to
drive the bicolour led in all 3 colours using
nothing more than one PIC pin? With variable
brightness on both the red and green it would
give a vary-colour display, cool effect for
a "limiting" light on an amp or a one-led
audio level meter.

Or is it to get 2 colours and a switch all
on one PIC pin?
-Roman

--
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


2002\02\02@232012 by Spehro Pefhany

picon face
]At 06:27 PM 1/31/02 -0500, you wrote:
>
>wire? Since the currents are so low, will line drop become a factor,
>making the voltage too low to forward bias the LEDs? I guess the other
>question is how to generate the 2.5V. Could I use a zener, or is there
>such a thing as a 2.5V zener?

This may be a bit marginal, depending on the LED forward voltages.
You can generate the voltage with two resistors. Unfortunately, when
you work this out you'll find a fair bit of wasted power even with
both LEDs off. If you have a spare op-amp package in your design,
you can use the same voltage but buffer it with the op-amp (no
additional components) and use higher valued resistors. The op-amp
will sink or source current and draws little quiescent current.

This might work for Lawrence- a quad op-amp should have enough
current to handle 8 LEDs (2 each) at 10mA+ and is only one SOP-14
costing a dime or so in quantity. So, 5 parts for 8 dual LEDs, using
4-R networks. Not too bad.

(BUT for 8, I'd try to use a matrix. 6 port pins and 3 resistors
total, (1 part using a network) and not so fussy, and no wasted power-
but rather limited average current of about 1.2mA for each LED-
2.5 is possible if you disallow red and green on at once)

Back to the two LEDs-
it doesn't work for the bipolar LEDs, but for two individual LED,
I have a better way that uses just passive parts, and have done
a spreadsheet to calculate the values based on LED Vf, desired
current in each. It's supposed to be published by one of the EE
trade magazines in the next few months.

Best regards,

--
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


2002\02\04@095805 by Lawrence Lile

flavicon
face
I understand how you would do this with an op amp - what is a "virutal
ground" device?  Part numbers?

--Lawrence

{Original Message removed}

2002\02\04@101223 by Lawrence Lile

flavicon
face
Roman,

Josh and I are in the same boat, so to speak.  We are trying to drive the
dual LED with just one pin, on the cheap.

Most dual LED's come in a common cathode arrangement, and the only way I
could figure out to drive both with one pin was to add a bunch of extra
compnents, specifically an NPN and PNP.

I had another arrangement for driving 8 common cathode LEDs with 9 pins, the
one extra pin driving a PNP/NPN that turns on the green or the red
respectively.

THis is another one of those impossible projects where every dime counts,
board space is limited, and if I were sane I'd just throw more pins and
money at it.

With the kind of volumes my company does, if I spend a month's pay figuring
out how to save $0.10US in product cost, it is still worth it.

--Lawrence



{Original Message removed}

2002\02\04@103117 by Roman Black

flavicon
face
I'm sure we can drive a bi-colour led from one
pic pin without having to resort to transistors.
:o)

Did you want to use the 3-pin led or the 2-pin
(dual reversed) type?

If you're talking volume production I can see
advantages to using the 2-pin type, ie soldering,
board cost, footprint etc.

If you can spare some timeslice (2% ??) i'm sure
it can be done with an RC system of some type.
Is there a desired current limit for when the leds
are off?
-Roman


Lawrence Lile wrote:
{Quote hidden}

> {Original Message removed}

2002\02\04@103959 by Lawrence Lile

flavicon
face
Thanks, Ashley, this is a really cool trick!

I suppose you could light more than one LED with various combinations of 1
and 0.  I am supposed to be implementing a light bar, sort of like a
progress baar on a download, so I will have to count up.  This may not work
so well in this case, because I think adjacent LEDs cannot be lit in the
same color!

You suggested a little port expander, another cheap chip that I have used is
an 8-bit serial load parallel out shift register, 74HC164.  These can be
bought for $US0.15 in quantity, I think.  I need to check the datasheet and
see how many LED's thay can handle.

I guess the problem is to figure out which of these alternatives is the
cheapest.

--Lawrence

{Original Message removed}

2002\02\04@112402 by Roman Black

flavicon
face
> I'm sure we can drive a bi-colour led from one
> pic pin without having to resort to transistors.
> :o)

I have a feeling something like this could be made
to work, with some fiddling, to drive a bi-colour
led from one PIC pin. I don't know if it has any
real merits compared to the usual solutions.
At least it uses zero power in the "off" state
if it could be made to work.
-Roman


      +5v  ------------------------------------*------
                                               |
                  ?          1N4148            |
-----,     ,-------C---------*--|<----,         R 470 ohm
    |     |                 |        |         |
PIC |     |                 '---R----*         |
    |     |                          |         |
    |     |     ,----|<---,          |         |
    |     |     |   Green |          |         |
    |-----*-----*         *----------*---------*
    |           |         |                    |
    |           '---->|---'                    |
    |                 Red                      |
    |           Bi-colour LED                  C 0.1uF
    |                                          |
-----'                                          |
                                               |
      Gnd  ------------------------------------*-----

           ,--------,  ,--------,  ,--------,
Red on =   |        |  |        |  |        |
          -'        '--'        '--'        '--

Green on =                                       (low)
          -------------------------------------

Both off = ....................................  (high imp)

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body


2002\02\04@114436 by Ashley Roll

flavicon
face
Doh,

Send it to the list, not just to Lawrence :)

Definitely time to go to bed..


{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body


2002\02\04@183648 by Josh Koffman

flavicon
face
Hi Roman. Actually, it's to get two colours and one switch on only three
wires. My goal is to remote mount these, and three wires is all I'd like
to use. As well, I'd like to keep the remote unit as low parts as
possible as I'd like to try and squeeze it in the shell of a connector.
Looking over some of the other posts, I could use three pins to
accomplish this, but I wonder if I could do it with two (two pins, three
wires). The addition of a third colour would be cool, but not really
needed. I'd like to keep it to two pins if possible, but it'll be
cheaper and easier to go to a larger PIC than to add more wires. Of
course, if there is no way to get this to work over a bunch of wire
other than to start to add gates to the remote ends, then I have a
problem.

Josh

--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams

Roman Black wrote:
{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email @spam@listservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body


2002\02\04@193918 by Ashley Roll

flavicon
face
Hi Josh,

I think you can do it with out any mid level voltages..

                    120
 PIN1 >-----------/\/\/\--,
                          |
           10K       Bi Colour LED
  Vcc >--/\/\/\-,         |
                |   120   |
 PIN2 >---------+-/\/\/\--+
                          |
                          0 |
                          0 | Switch
          4.7K            |
  GND >--/\/\/\-----------'

Driving:

Colour 1 (Green):
       PIN1: H
       PIN2: L

Colour 2 (Red):
       PIN1: L
       PIN2: H

Read Switch:
       PIN1: Tri-stated (make input)
       PIN2: Tri-states (make input)
       Allow a settling time and Read state of PIN2. Low = Switch Pressed.

You would simply scan this at the high rate (Multiplexing). If you want to
leave the LEDs turned off, you could drive PIN1 & PIN2 High. (probably
better then tri-stating them as you stop them floating off to strange
voltages, and this is a good thing with a cable.) Do it fast enough and you
won't see it, AND you should be able to get a Yellow colour as well.

The two 120ohm resistors are the LED current limit split between both PIC
pins so they provide some ESD protection. The 10K pullup is used when
reading the switch, floating the PIC pins allows it to pull the line to Vcc
unless the switch is closed in which it will read about 1/3 Vcc (You may
have to ensure this is a LOW buy changing values or using a Schmitt trigger
input PIN). The Resistor in the ground return for the switch stops the
current drain being excessive if the switch is closed when driving the LEDs.

Obviously all the resistors stay on the PCB, the LED and switch go to the
end of the cable.

You may have problems with driving the cable capacitance, especially on
reading the switch state so you may have to have some time delays in there
to let the signal stabilise.. Depends on how long your cable is.. You might
need to play with the values of the switch resistor and the pull up to make
it work fast and reliably.

Also is the cable shielded? if not doing this will probably make a wonderful
antenna to radiate signals.. :)

Cheers,
Ash.

---
Ashley Roll
Digital Nemesis Pty Ltd
http://www.digitalnemesis.com
Mobile: +61 (0)417 705 718




> {Original Message removed}

2002\02\05@011715 by Josh Koffman

flavicon
face
Hi Ashley. Thanks for the reply. I haven't had a chance to do much more
than skim it (it's late), but the cable will be shielded. The shield
will be one of my conductors though. Does this sound ok? Is there
anything I can use at the PIC end to help with the cable capacitance?
I'll read your response again tomorrow and come up with more questions
I'm sure :)

Thanks,

Josh
--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams

Ashley Roll wrote:
{Quote hidden}

> > {Original Message removed}

2002\02\05@072053 by Bob Ammerman

picon face
In your case cable capacitance is a good thing. You want to slow down the
edges of your signals to minimize emissions from the cable. You may even
want to add small capacitors between the wires of the cable at the main box
to further slow the edges.

Bob Ammerman
RAm Systems

----- Original Message -----
From: "Josh Koffman" <KILLspamlistsjoshKILLspamspam3MTMP.COM>
To: <RemoveMEPICLISTTakeThisOuTspamMITVMA.MIT.EDU>
Sent: Monday, February 04, 2002 10:23 PM
Subject: Re: [PIC]: Driving a dual LED


{Quote hidden}

Pressed.
> >
> > You would simply scan this at the high rate (Multiplexing). If you want
to
> > leave the LEDs turned off, you could drive PIN1 & PIN2 High. (probably
> > better then tri-stating them as you stop them floating off to strange
> > voltages, and this is a good thing with a cable.) Do it fast enough and
you
> > won't see it, AND you should be able to get a Yellow colour as well.
> >
> > The two 120ohm resistors are the LED current limit split between both
PIC
> > pins so they provide some ESD protection. The 10K pullup is used when
> > reading the switch, floating the PIC pins allows it to pull the line to
Vcc
> > unless the switch is closed in which it will read about 1/3 Vcc (You may
> > have to ensure this is a LOW buy changing values or using a Schmitt
trigger
> > input PIN). The Resistor in the ground return for the switch stops the
> > current drain being excessive if the switch is closed when driving the
LEDs.
> >
> > Obviously all the resistors stay on the PCB, the LED and switch go to
the
> > end of the cable.
> >
> > You may have problems with driving the cable capacitance, especially on
> > reading the switch state so you may have to have some time delays in
there
> > to let the signal stabilise.. Depends on how long your cable is.. You
might
> > need to play with the values of the switch resistor and the pull up to
make
> > it work fast and reliably.
> >
> > Also is the cable shielded? if not doing this will probably make a
wonderful
{Quote hidden}

> > > {Original Message removed}

2002\02\05@100942 by Lawrence Lile

flavicon
face
I looked up "virutal ground" on ti.com, and found this:
http://focus.ti.com/docs/prod/productfolder.jhtml?genericPartNumber=TLE2425

It is budget priced at US$0.75, and only handles 20 mA max, which would be
two LEDs.  I'm driving 8 so this would cost about $3.00 for enough virtual
grounds.  Probably out of my price range, but a really cool idea.

I think I will order some samples for my next analog project, this looks
like a really cool device!

--Lawrence

{Original Message removed}

2002\02\05@110517 by M. Adam Davis

flavicon
face
I recently dove back into my old stacks of magazines and found a similar
circuit which, IIRC, used two transisters and an opamp to create a split
power supply from a single source (such as a 9 volt battery).

This virtual ground chip looks cool though, especially in the little
to-92 package!

-Adam

Lawrence Lile wrote:

{Quote hidden}

>{Original Message removed}

2002\02\05@140238 by Dwayne Reid

flavicon
face
At 09:10 AM 2/4/02 -0600, Lawrence Lile wrote:
>Roman,
>
>Josh and I are in the same boat, so to speak.  We are trying to drive the
>dual LED with just one pin, on the cheap.

Does it have to be a dual LED?  How about 2 separate LEDs?  If you can get
away with separate LEDs, how about

     pic pin------------+
                  A K   |   A K
   5V---res1--+---LED---+---LED---+---res2--GND
              |                   |
              +-------res3--------+

The LEDs are in series.  Res1 determines LED brightness of left hand LED
when PIC pin is LO.  Res2 etermines brightness of right hand LED when PIC
pin is HI.  Res3 keeps the voltage across the LEDs low enough so that they
don't light when PIC pin is tri-stated.

This is similar to the mid-point drive solution posted earlier but consumes
MUCH less quiescent current.

dwayne


Dwayne Reid   <spamBeGonedwaynerspamBeGonespamplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 18 years of Engineering Innovation (1984 - 2002)
 .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-
    `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

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


2002\02\05@143010 by Roman Black

flavicon
face
I think you could do it over 2 wires, with nothing
needed in the remote but the led and switch.
With 2 PIC pins? Is that what you're after? Or must
it be 3 wires?
-Roman

Josh Koffman wrote:
{Quote hidden}

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


2002\02\05@160426 by Roman Black

flavicon
face
Ashley Roll wrote:
{Quote hidden}

I really don't think it can work. You can only
charge or discharge the caps through the leds,
meaning that you will only be able to get an
amber light when oscillating, never a red or
green.

My circuit below tries to circumvent this problem
but was a 2 minute throw together and probably
won't work in the configuration shown. BUT the idea
is valid, ie, PIC pin tied low is green led on,
then when oscillating;
* short burst of LO pulls a chunk of charge
from 0.1uF C1, via CX and the diode. With a larger
CX value (1uF??) it should enable a decent percentage
of charge pulled from C1 without lighting the
green led. Then when PIC pin goes HI, current will
flow through the red led (and some via R1 and CX).

The only requirement to light the red led with ac
is too make sure that we draw more charge from
C1 with each short LO pulse than the charge we put
back in with each HI pulse that lights the red led.
Or any way we can discharge C1 without lighting the
green led.
Any thoughts?

---------------------------------
circuit below
---------------------------------
I have a feeling something like this could be made
to work, with some fiddling, to drive a bi-colour
led from one PIC pin. I don't know if it has any
real merits compared to the usual solutions.
At least it uses zero power in the "off" state
if it could be made to work.
-Roman


      +5v  ------------------------------------*------
                                               |
                  ?          1N4148            |
-----,     ,-------CX--------*--|<----,         R1  470 ohm
    |     |                 |        |         |
PIC |     |                 '---RX---*         |
    |     |                          |         |
    |     |     ,----|<---,          |         |
    |     |     |   Green |          |         |
    |-----*-----*         *----------*---------*
    |           |         |                    |
    |           '---->|---'                    |
    |                 Red                      |
    |           Bi-colour LED                  C1   0.1uF
    |                                          |
-----'                                          |
                                               |
      Gnd  ------------------------------------*-----

           ,--------,  ,--------,  ,--------,
Red on =   |        |  |        |  |        |
          -'        '--'        '--'        '--

Green on =                                       (low)
          -------------------------------------

Both off = ....................................  (high imp)

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


2002\02\05@171441 by Roman Black

flavicon
face
I had a think about it and this only took me about
30 seconds (1st doodle). :o)

Solution: (3 resistors, no parts in remote)

      +5v -------*----------------
                 |
------,          |                        Bi-colour LED
      |    220   |
    A *------R---|-----------------------------,
      |          |              1              |
      |          |                          ,--*--,
PIC   |          |                          |     |
      |          R 33k                green -     v  red
      |          |              2           ^     -
    B *----------*-----------------------,  |     |
      |                                  |  '--*--'
      |           ,--R----------------,  |     |
------'           |   3k3       3     |  '-----*
                  |                   |        |
                  |                   |        |
                  |                   |       Switch
                 gnd                  |        |
                                      '--------'
A high, B low = RED
A low, B high = GREEN
(both inputs) B reads switch



Josh Koffman wrote:
{Quote hidden}

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


2002\02\05@172915 by Josh Koffman

flavicon
face
I like your solution Dwayne, but it doesn't meet my requirements (it
might meet Lawrence's though. I would like to drive the bi colour LED
and a switch using only three wires. Your solution would take all three
for the LED. I do like it though...I might want to put monitoring LEDs
on the main board, and this might work out well. The question now
becomes one of finding 3 pin LEDs I like :)

Josh
--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams
{Quote hidden}

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


2002\02\05@173850 by Josh Koffman

flavicon
face
That's just like Ashley's solution from yesterday hehe. Albeit with some
different resistor values. You also only have a current limiting
resistor on one of the PIC pins...does this seem sufficient or do you
think there should be one on both pins?

Josh
--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams

Roman Black wrote:
{Quote hidden}

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


2002\02\05@174509 by Roman Black

flavicon
face
Josh Koffman wrote:
>
> That's just like Ashley's solution from yesterday hehe. Albeit with some
> different resistor values. You also only have a current limiting
> resistor on one of the PIC pins...does this seem sufficient or do you
> think there should be one on both pins?

Whoops! Didn't see it. Given the chance of the
remote cable being pinched and shorted it would
be a good idea. :o)
-Roman

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


2002\02\05@174714 by Josh Koffman

flavicon
face
As an afterthought, would it help to put the resistors in the remote?
Other than the pullup resistor of course.

Josh
--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams

Roman Black wrote:
{Quote hidden}

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


2002\02\05@192714 by Ashley Roll

flavicon
face
Hi Josh,

Good to see my idea validated by Roman :)

The reason I split the current limiting resistors for the LED was to provide
some protection to the PIC for Electro-Static discharge and short circuits
in the cable. To fulfil these requirement, they MUST be located at the PIC.
And for ease of assembly, the other resistors should be there as well I'd
assume. I don't think you'll get any benefit moving them to the end of the
cable.

Roman, this is the circuit I posted:
                    120
{Quote hidden}

---
Ashley Roll
Digital Nemesis Pty Ltd
http://www.digitalnemesis.com
Mobile: +61 (0)417 705 718




> {Original Message removed}

2002\02\05@192726 by Dwayne Reid

flavicon
face
At 05:44 PM 2/5/02 -0500, Josh Koffman wrote:
>I like your solution Dwayne, but it doesn't meet my requirements (it
>might meet Lawrence's though. I would like to drive the bi colour LED
>and a switch using only three wires. Your solution would take all three
>for the LED. I do like it though...I might want to put monitoring LEDs
>on the main board, and this might work out well. The question now
>becomes one of finding 3 pin LEDs I like :)

Actually, I WAS thinking of Lawrence's requirements - trying to reduce Iq
when driving a pair of LEDs.  But I think the it can also monitor a single
switch fairly easily:

     pic pin----+--------+---res5---button----+
                |        |                    |
              res4       |                    |
                |  A K   |   A K              |
   5V---res1--+-+--LED---+---LED---+---res2---+---GND
              |                    |
              +--------res3--------+

The LEDs are in series.  Res1 determines LED brightness of left hand LED
when PIC pin is LO.  Res2 determines brightness of right hand LED when PIC
pin is HI.  Res3 keeps the voltage across the LEDs low enough so that they
don't light when PIC pin is tri-stated.

Res4 helps keep pic pin above 2.5V while the button is not pressed.  Res5
limits port current while the button is pressed.

This won't work on a schmitt trigger input but should work just fine on the
TTL inputs (threshold about 1.4 Vdc).

Lets pick some starting resistor values.  Set Res1,2,3 to 470R, res4 to
10K, res5 to 470R.  Pressing the button may cause LED1 to light dimly,
depending upon its threshold voltage.  Use a high threshold LED (green or
yellow) for LED1 if possible.

Voltage at pic pin should be about 3V when the button is open, less than 1V
when the button is pressed.

dwayne



Dwayne Reid   <dwaynerSTOPspamspamspam_OUTplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 18 years of Engineering Innovation (1984 - 2002)
 .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-
    `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

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


2002\02\05@204601 by David P. Harris

picon face
Hi-
How 'bout this, same as Roman's, but use a Normally-Closed Switch in series
with the LEDs.  Only uses 2 lines.  Disadvantage is that the LEDs will
extinquish when toy push the switch.  Actually its a feature, it gives you
feedback ;-)  I don't think you even need the 33k, do you?
David H

    +5v -------*----------------
                 |
------,          |                        Bi-colour LED
      |    220   |
    A *------R---|------------------NC switch--,
      |          |              1              |
      |          |                          ,--*--,
PIC   |          |                          |     |
      |          R 33k                green -     v  red
      |          |              2           ^     -
    B *----------*-----------------------,  |     |  Bi-colour LED
      |                                  |  '--*--'
      |                                  |     |
------'                                  '-----*

A high, B low = RED
A low, B high = GREEN
(both inputs) B reads switch

Roman Black wrote:

{Quote hidden}

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


2002\02\05@205439 by Josh Koffman

flavicon
face
But with pin A as an input, can you predict what state pin B will be in
when you go to read them? Maybe a pulldown resistor?

Josh
--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams

"David P. Harris" wrote:
{Quote hidden}

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


2002\02\06@005531 by Roman Black

flavicon
face
Ashley Roll wrote:
{Quote hidden}

Actually I think you should change that
4.7k resistor to about 1k or 1.5k to ensure
PIN2 is pulled sufficiently low to register
a low input condition. :o)
-Roman

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


2002\02\06@022718 by Ashley Roll

flavicon
face
Hi Roman,

Yep good idea, I suggested in the original message that the values of that
resistor and the pullup to Vcc may need to be altered.

May be better to increase the value of the pullup so you don't sacrifice as
much current when the PIN2 is high driving the LED and the switch is
closed.. Just got to watch the settling time when reading the switch state.
Then again, the current isn't very much :)

Cheers,
Ash.

---
Ashley Roll
Digital Nemesis Pty Ltd
http://www.digitalnemesis.com
Mobile: +61 (0)417 705 718




> {Original Message removed}

2002\02\06@042233 by Alan B. Pearce

face picon face
>The reason I split the current limiting resistors for the LED was to
provide
>some protection to the PIC for Electro-Static discharge and short circuits
>in the cable. To fulfil these requirement, they MUST be located at the PIC.
>And for ease of assembly, the other resistors should be there as well I'd
>assume. I don't think you'll get any benefit moving them to the end of the
>cable.

>Roman, this is the circuit I posted:
                    120
{Quote hidden}

As the original poster was talking in terms of using twin screened cable for
the connection to the front panel, I would be tempted to have the 4k7
resistor on the panel so the shield of the cable was connected to ground,
rather than having a significant impedance to ground through the resistor.

My only other comment would be that the 10k could go to the other side of
the 120 ohm resistor if this gave more freedom in the PCB layout.

Otherwise the suggestions about lowering the value of the 4k7 are quite
valid, a 10:1 ratio between the Vcc and Gnd resistors would be about right.
For a system wanting lower power consumption it may be practical to go for
100k/10k.

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


2002\02\07@014448 by Peter L. Peres

picon face
> virtual ground:

Here is a $0.3 one:

       Vcc    Vcc
       |      |
       C      R1
   NPN B------+
       E      |
VG -----+      |
       E      |
   PNP B------+
       C      R2
       |      |
       GND    GND

It can be modified to suit the different current requirements of the two
LEDs for equal brightness (change the ratio between R1 and R2). The
current in the divider should be about 2 mA for garden variety low cost
transistors and loads under 50mA.

Peter

--
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 2002 , 2003 only
- Today
- New search...