sensing 5 volts from an infrared sensor ( 0 or 5 volts DC )
Archiver
Posts: 46,084
first you need to set the direction of the I/O pin that the sensor is
connected to be an input. Then check with the condition of the pin and
take appropriate action.
Sensor pin 0 ' infrared sensor connected to pin 0
input Sensor ' set pin 0 to input
MAIN:
DO
ON Sensor GOSUB Speaker_on, Speaker_off
LOOP
Speaker_On:
' speaker on code here
return
Speaker_Off:
' speaker off code here
return
At 10:45 PM 5/22/2004, you wrote:
>Hi,,
>
>I need to sense 0 or 5 volts dc from a sensor.
>Somebody knows an Stamp command for this?
>
>I need an alarm,
>If sensor is sending +5 then speaker sounds
>if sensor is sending 0 then speaker off.
>
>Help please: Joe
>
>
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Domains * Claim yours for only $14.70/year
>http://smallbusiness.promotions.yahoo.com/offer
>
>
>
>To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
>from the same email address that you subscribed. Text in the Subject and
>Body of the message will be ignored.
>
>Yahoo! Groups Links
>
>
>
>
connected to be an input. Then check with the condition of the pin and
take appropriate action.
Sensor pin 0 ' infrared sensor connected to pin 0
input Sensor ' set pin 0 to input
MAIN:
DO
ON Sensor GOSUB Speaker_on, Speaker_off
LOOP
Speaker_On:
' speaker on code here
return
Speaker_Off:
' speaker off code here
return
At 10:45 PM 5/22/2004, you wrote:
>Hi,,
>
>I need to sense 0 or 5 volts dc from a sensor.
>Somebody knows an Stamp command for this?
>
>I need an alarm,
>If sensor is sending +5 then speaker sounds
>if sensor is sending 0 then speaker off.
>
>Help please: Joe
>
>
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Domains * Claim yours for only $14.70/year
>http://smallbusiness.promotions.yahoo.com/offer
>
>
>
>To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
>from the same email address that you subscribed. Text in the Subject and
>Body of the message will be ignored.
>
>Yahoo! Groups Links
>
>
>
>
Comments
speaker turn on at +5V then we need to reverse the order of the gosub
statements
ON Sensor GOSUB Speaker_Off, Speaker_On
At 08:12 AM 5/23/2004, you wrote:
>first you need to set the direction of the I/O pin that the sensor is
>connected to be an input. Then check with the condition of the pin and
>take appropriate action.
>
>Sensor pin 0 ' infrared sensor connected to pin 0
>input Sensor ' set pin 0 to input
>
>MAIN:
>DO
> ON Sensor GOSUB Speaker_on, Speaker_off
>LOOP
>
>Speaker_On:
> ' speaker on code here
> return
>
>Speaker_Off:
> ' speaker off code here
> return
>
>
>
>At 10:45 PM 5/22/2004, you wrote:
> >Hi,,
> >
> >I need to sense 0 or 5 volts dc from a sensor.
> >Somebody knows an Stamp command for this?
> >
> >I need an alarm,
> >If sensor is sending +5 then speaker sounds
> >if sensor is sending 0 then speaker off.
> >
> >Help please: Joe
> >
> >
> >
> >
> >__________________________________
> >Do you Yahoo!?
> >Yahoo! Domains * Claim yours for only $14.70/year
> >http://smallbusiness.promotions.yahoo.com/offer
> >
> >
> >
> >To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> >from the same email address that you subscribed. Text in the Subject and
> >Body of the message will be ignored.
> >
> >Yahoo! Groups Links
> >
> >
> >
> >
>
>
>
>To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
>from the same email address that you subscribed. Text in the Subject and
>Body of the message will be ignored.
>
>Yahoo! Groups Links
>
>
>
>
Without seeing a schematic this solution is not 100% guaranteed to work, but
you should be able to make it work by simply connecting the grounds together
of the separate power supplies.
===========================
Thanks,
The problem I have is that the sensor has a separate
power supply.
I have used an infrared sensor from parallax powered
by the basic stamp VDD and now the sensor is powered
by an external power supply.
Is it necesary a kind of optocouple or I need the
basic stamp only ?
Thanks, Daryl
[noparse][[/noparse]Non-text portions of this message have been removed]
The problem I have is that the sensor has a separate
power supply.
I have used an infrared sensor from parallax powered
by the basic stamp VDD and now the sensor is powered
by an external power supply.
Is it necesary a kind of optocouple or I need the
basic stamp only ?
Thanks, Daryl
--- Daryl Berryhill <djberry@h...> wrote:
> I didn't see your requirements at the bottom of your
> email. to have the
> speaker turn on at +5V then we need to reverse the
> order of the gosub
> statements
>
> ON Sensor GOSUB Speaker_Off, Speaker_On
>
> At 08:12 AM 5/23/2004, you wrote:
>
> >first you need to set the direction of the I/O pin
> that the sensor is
> >connected to be an input. Then check with the
> condition of the pin and
> >take appropriate action.
> >
> >Sensor pin 0 ' infrared sensor
> connected to pin 0
> >input Sensor ' set pin 0 to input
> >
> >MAIN:
> >DO
> > ON Sensor GOSUB Speaker_on, Speaker_off
> >LOOP
> >
> >Speaker_On:
> > ' speaker on code here
> > return
> >
> >Speaker_Off:
> > ' speaker off code here
> > return
> >
> >
> >
> >At 10:45 PM 5/22/2004, you wrote:
> > >Hi,,
> > >
> > >I need to sense 0 or 5 volts dc from a sensor.
> > >Somebody knows an Stamp command for this?
> > >
> > >I need an alarm,
> > >If sensor is sending +5 then speaker sounds
> > >if sensor is sending 0 then speaker off.
> > >
> > >Help please: Joe
> > >
> > >
> > >
> > >
> > >__________________________________
> > >Do you Yahoo!?
> > >Yahoo! Domains * Claim yours for only $14.70/year
> > >http://smallbusiness.promotions.yahoo.com/offer
> > >
> > >
> > >
> > >To UNSUBSCRIBE, just send mail to:
> > > basicstamps-unsubscribe@yahoogroups.com
> > >from the same email address that you subscribed.
> Text in the Subject and
> > >Body of the message will be ignored.
> > >
> > >Yahoo! Groups Links
> > >
> > >
> > >
> > >
> >
> >
> >
> >To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> >from the same email address that you subscribed.
> Text in the Subject and
> >Body of the message will be ignored.
> >
> >Yahoo! Groups Links
> >
> >
> >
> >
>
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed.
> Text in the Subject and Body of the message will be
> ignored.
>
> Yahoo! Groups Links
>
>
> basicstamps-unsubscribe@yahoogroups.com
>
>
>
__________________________________
Do you Yahoo!?
Yahoo! Domains – Claim yours for only $14.70/year
http://smallbusiness.promotions.yahoo.com/offer
common grounds connected together. no an opto-coupler probably won't be
necessary. However, since its two separate supplies, you may need around a
1K ohm or so currently limiting resistor in series with the I/O line and
sensor. It also depends on how far the sensor is from the stamp. For the
most part, The stamp I/O lines are pretty fault tolerate up to 5V but I
tend to use a series resistor anyway just to be on the safe side.
At 01:28 PM 5/23/2004, you wrote:
>Daryl,
>
>Without seeing a schematic this solution is not 100% guaranteed to work, but
>you should be able to make it work by simply connecting the grounds together
>of the separate power supplies.
>
>===========================
>Thanks,
>
>The problem I have is that the sensor has a separate
>power supply.
>I have used an infrared sensor from parallax powered
>by the basic stamp VDD and now the sensor is powered
>by an external power supply.
>
>Is it necesary a kind of optocouple or I need the
>basic stamp only ?
>
>Thanks, Daryl