Doorbell LED puzzle

M

Matt

Guest
Hello,

I am trying to figure out how to do something neat with a BASIC Stamp
and a doorbell button. I have a 2-wire lighted doorbell, where the
button shorts out the light, in the usual configuration. I would
like to discard the bell and transformer, and would like to replace
the lamp with a bicolor LED.

I would like the Stamp to be able to change the color of the LED (or
turn it off), and that's not hard by itself. However, I do not have
a good idea for how to cope with and detect button presses. These
will short out the circuit temporarily. A pair of drivers with an
inverter between is sufficient to handle color changes, and turning
it off is not too hard, but I do not know enough to figure out how
to monitor for the button press, especially in the case where the LED
is not illuminated.

I'm just a beginner, so I'm sure there's a solution, but I am also
likely to not fully understand it, so please go into detail if you
have an idea on how to do this.

Thanks!
 
"Alex Corscadden" <alex@corscadden.net> writes:
You could use the switch as a pull down. Basically you want the switch to
close the circuit between 5v and gnd. The resistor is there to keep things
from melting. When the switch is open the stamp will see logic high, when
the switch closes logic low. For that matter the STAMP becomes kinda
overkill but I'm guessing that at least part of this is learning how to
program the STAMP. I'm not sure what the light bulb in the doorbell would
do to this circuit.

+5v
|
/
\ 4.7k Ohm resistor
/
\
|
+------ STAMP input
|
\ Switch
|
|
gnd

"Matt" <dontspamme@hotmail.com> wrote in message
news:405e6563$0$194$4c5efa9h@news.moreusenet.net...
Hello,

I am trying to figure out how to do something neat with a BASIC Stamp
and a doorbell button. I have a 2-wire lighted doorbell, where the
button shorts out the light, in the usual configuration. I would
like to discard the bell and transformer, and would like to replace
the lamp with a bicolor LED.

I would like the Stamp to be able to change the color of the LED (or
turn it off), and that's not hard by itself. However, I do not have
a good idea for how to cope with and detect button presses. These
will short out the circuit temporarily. A pair of drivers with an
inverter between is sufficient to handle color changes, and turning
it off is not too hard, but I do not know enough to figure out how
to monitor for the button press, especially in the case where the LED
is not illuminated.

I'm just a beginner, so I'm sure there's a solution, but I am also
likely to not fully understand it, so please go into detail if you
have an idea on how to do this.
Well, really, the whole question *was* what do I do to make the light
work. Interfacing the Stamp to various input devices is not too hard
from numerous examples, but this case seems more complex to me.

A normal button circuit will not work, because you need to be able to
deal with the bicolor LED. This means that sometimes, one wire will
be source and the other sink, while at other times, the situation will
be reversed. It may even be a bit worse than that... there isn't
space inside the button for the current limiting resistor, so you end
up with a situation like this:

---------------------
| |X| |
| ----- |
| ----O O---- |
| / \ |
-----|-- --|-----/\/\/--------
| \ |-|<|-| / | appropriate
| \--|-|>|-|--/ | cur. lim. resistor
| bicolor LED |
---------------------
lighted button assembly
with lamp replaced by
bicolor LED

The specs for the BS2 say that each pin can source 20mA or sink 25mA,
though there are limits per group of pins, and I want to be able to
drive more than one button from a single BS2.

I originally considered a very simple circuit where each wire from the
button would be fed to a pin on the BS2. Since you do not need 100%
duty cycle to effectively light a LED, you can choose to drive the LED
by programming both BS2 pins as output. Drive one high and one low,
depending on which color you want.

You can detect button presses by programming one line as output and
one as input. The addition of a pull-up resistor is probably
sufficient to make this work.

Of course, running back and forth between these two situations a few
hundred times a second isn't a problem, and you can work out the duty
cycle sufficient to put some brightness on the LED. When the button
is pressed, you cease trying to light the LED until you detect no more
button press.

However, you don't know when the button press is coming, so if it
happens when you're driving the LED, you put the BS2 pins into
overload, because you suddenly have one pin sourcing and one pin
sinking, separated only by the current limiting resistor for the
LED. True, this is only for a small fraction of a second, but
relying on the resilience of components to live outside their specs
for any length of time is surely bad.

I was also hoping to drive multiple buttons off a single Stamp, and
the current handling capabilities of the Stamp don't look to meet
up with that.

I think I could possibly hack my way through a design with some
external drivers that implement this same sort of strategy, but I
thought maybe there were some smarter people here who saw a simpler
way to do all this, either a better strategy, or better electronics,
or something.
 

Welcome to EDABoard.com

Sponsor

Back
Top