Sign in

username:

password:



Not a member?

Search basicx



Search tips

Subscribe to basicx



basicx by Keywords

Accelerometer | ADC | ADXL | Adxl20 | AVR | BasicStamp | BX-35 | BX28 | BX35 | COM3 | Compiler | Downloader | EEPROM | Electromagnet | GetADC | GP2D1 | GPS | I2C | IDE | Keypad | LCD | LCD+ | MIDI | Motors | Multitasking | Netmedia | Networking | PCB | PID | PlaySound | PWM | Relays | RTC | Servo | ShiftOut | SitePlayer | SPI | Stack | Timer | USB

Ads

Discussion Groups

Discussion forum for the BasicX family of microcontroller chips.

relays - Author Unknown - Nov 30 3:14:00 2001

I need help, quite unknowledgeable about this sort of stuff. I need to
turn on/off 24VDC. I tried to drive 3V relays with the BX24 using the
PutPin method (high output) to fire the relays. Surprisingly enough it
worked, until I blew an output I/O by drawing too much current (I
assume). Any ideas on how I can trigger 24VDC momentarily from the BX24
on several output pins (not simutaneously)?





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )


Re: relays - Low Cost Equipment Project - Nov 30 9:04:00 2001

The following "low side switch" is often used::

|-----diode-K|
collector-+-relay coil--+- 24V
BXpin--resistor----base
BX ground----------emitter--------------------GND
npn transistor

Use a transistor with IC large enough to handle the
relay "on" current and VCBO and VCEO above 24 volts.

A simple rule for the resistor is 2HFE/Irelay.

For example if the relay has I of 100 mA (0.1A) and
the transistor has HFE 0f 50 then use a 2 x 50 / 0.2 =
1000 ohm resistor.

For currents up to several hundred mA a 2N2222/pn2222
switching transistor will do. For very high currents
use a power transistor with darlington configuration.

-Ramon

--- wrote:
> I need help, quite unknowledgeable about this sort
> of stuff. I need to
> turn on/off 24VDC. I tried to drive 3V relays with
> the BX24 using the
> PutPin method (high output) to fire the relays.
> Surprisingly enough it
> worked, until I blew an output I/O by drawing too
> much current (I
> assume). Any ideas on how I can trigger 24VDC
> momentarily from the BX24
> on several output pins (not simutaneously)?
__________________________________________________






(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: relays - Author Unknown - Nov 30 9:07:00 2001

Or unless you had a diode across the relay coil, counter
emf zapped the I/O pin.

In general, it's a really good idea to buffer I/O pins,
and apply a diode across the relay coil.

For years, I've used an NPN transistor (like a 2N2222)
connecting the BASE of the transistor through a 1K
resistor to the ACTIVE HIGH signal source. The EMITTER
is connected to the relay common. The COLLECTOR is
connected to one side of the Relay. A diode with the
Cathode connected to the positive voltage side of the
relay, and the anode side connected to the other side of
the relay coil.

You can also buy relay drivers in integrated circuit
packages, complete with the diode protection built in.

When playing with BASICX or Parallax STAMP devices, I
seldom use the outputs unbuffered. I also haven't blown
up any STAMPS or BASICX modules either.

Best Regards

Jim
> I need help, quite unknowledgeable about this sort of stuff. I need to
> turn on/off 24VDC. I tried to drive 3V relays with the BX24 using the
> PutPin method (high output) to fire the relays. Surprisingly enough it
> worked, until I blew an output I/O by drawing too much current (I
> assume). Any ideas on how I can trigger 24VDC momentarily from the BX24
> on several output pins (not simutaneously)? >
>




(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: relays - Chuck Davis - Nov 30 9:26:00 2001

--- In basicx@y..., relaydriver@y... wrote:
> I need help, quite unknowledgeable about this sort of stuff. I need
to
> turn on/off 24VDC. I tried to drive 3V relays with the BX24 using
the
> PutPin method (high output) to fire the relays. Surprisingly enough
it
> worked, until I blew an output I/O by drawing too much current (I
> assume). Any ideas on how I can trigger 24VDC momentarily from the
BX24
> on several output pins (not simutaneously)?

First rule is usually: read the spec sheets! For example, how much
current will your relay draw at 5 volts? - should be on the relay's
spec sheet. How much current can a BX-24 output provide - look at the
BX-24 specs. If A is greater than B (which it probably is), you need
a simple transistor to switch the load, rather than driving it
directly from the BX-24. There are also integrated circuits available
that have multiple transistor switches in a package so you don't need
a bunch of individual transistors for multiple relays.

Also, a relay is an inductive device, which means when you try to
shut it off, the current wants to keep flowing; the general result of
this is a very high voltage spike that may damage the transistor that
is trying to shut off. This is usually handled by putting a diode
across the relay coil with the cathode toward the + voltage. The
diode conducts the current during shutoff so the transistor doesn't
see the voltage spike.

Unless you can afford to experiment with (and blow up) BX-24s at $40
a pop, always read as much as possible and/or ask questions about
anything you are going to hook to it. Even LED lamps can blow up your
BX-24 if you hook them up wrong or hook up too many at once. A good
rule of thumb if you're not sure is to put a 1K or 2K resistor
between the BX-24 and any device or circuit you're not sure about. If
it works, great; if not, it was probably going to draw too much
current to be safe anyway. The resistor can usually save the BX-24's
output from damage (p.s. - resistor or not, don't hook up anything
that isn't powered by 5 volts or less). Also, you must calculate the
total current in and out of the BX-24, not just the individual pins.
There is a limit on the total also, which is not much higher than the
limit on a single pin.




(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Barebones BX24 and Multitasking - Frank Manning - Nov 30 15:09:00 2001

From: <> writes:

> According to the project's .MMP file I am using only 37 bytes of
> module level (static) RAM and the deepest call stack is 21 bytes,
> or about 32-bytes including its largest nested call. The program
> uses 4700 bytes of code memory.
> [...]
> I understand that without seeing the code there's a lot of useful
> details absent, so my question at a gross level is simply, should
> I bother? Is the barebones BX24 capable of mutitasking in a non-
> trivial application?

If the call stack really only uses 32 bytes, then multitasking should be no
problem.

But it's very difficult to say without seeing the code. Any chance you could
post it? Or at least the general requirements?

-- Frank Manning
-- NetMedia, Inc.





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: relays - Author Unknown - Dec 1 9:18:00 2001

You're right!

Don't use 24v to run the relay, but the same principles
will apply to a 3 to 5 volt power source.

Jim
> Thanks for your reply, its an immense help. I have a
> question about the 24V connected to the relay. Isn't
> 24V a bit much for a 3V relay? I tested and the relay
> draws approx 30mA current, so really all I need is
> 30mA at 3-5 VDC to trigger the relay...
> thanks again.... > --- Low Cost Equipment Project <>
> wrote:
> > The following "low side switch" is often used::
> >
> > |-----diode-K|
> > collector-+-relay coil--+- 24V
> > BXpin--resistor----base
> > BX ground----------emitter--------------------GND
> > npn transistor
> >
> > Use a transistor with IC large enough to handle the
> > relay "on" current and VCBO and VCEO above 24
> > volts.
> >
> > A simple rule for the resistor is 2HFE/Irelay.
> >
> > For example if the relay has I of 100 mA (0.1A) and
> > the transistor has HFE 0f 50 then use a 2 x 50 / 0.2
> > =
> > 1000 ohm resistor.
> >
> > For currents up to several hundred mA a
> > 2N2222/pn2222
> > switching transistor will do. For very high currents
> > use a power transistor with darlington
> > configuration.
> >
> > -Ramon
> >
> > --- wrote:
> > > I need help, quite unknowledgeable about this sort
> > > of stuff. I need to
> > > turn on/off 24VDC. I tried to drive 3V relays with
> > > the BX24 using the
> > > PutPin method (high output) to fire the relays.
> > > Surprisingly enough it
> > > worked, until I blew an output I/O by drawing too
> > > much current (I
> > > assume). Any ideas on how I can trigger 24VDC
> > > momentarily from the BX24
> > > on several output pins (not simutaneously)?
> > >
> > >
> >
> >
> >
> >
> > __________________________________________________
> >
> > __________________________________________________ >
>
>




(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: relays - Low Cost Equipment Project - Dec 1 10:25:00 2001

Oops,

I misunderstood your post and thought the relay coils
were 24 V also, replace the 24V with the coil voltage
(3V).

-Ramon

--- zip zop <> wrote:
> Thanks for your reply, its an immense help. I have a
> question about the 24V connected to the relay. Isn't
> 24V a bit much for a 3V relay? I tested and the
> relay
> draws approx 30mA current, so really all I need is
> 30mA at 3-5 VDC to trigger the relay...
> thanks again.... > --- Low Cost Equipment Project <>
> wrote:
> > The following "low side switch" is often used::
> >
> > |-----diode-K|
> > collector-+-relay coil--+- 24V
> > BXpin--resistor----base
> > BX ground----------emitter--------------------GND
> > npn transistor
> >
> > Use a transistor with IC large enough to handle
> the
> > relay "on" current and VCBO and VCEO above 24
> > volts.
> >
> > A simple rule for the resistor is 2HFE/Irelay.
> >
> > For example if the relay has I of 100 mA (0.1A)
> and
> > the transistor has HFE 0f 50 then use a 2 x 50 /
> 0.2
> > =
> > 1000 ohm resistor.
> >
> > For currents up to several hundred mA a
> > 2N2222/pn2222
> > switching transistor will do. For very high
> currents
> > use a power transistor with darlington
> > configuration.
> >
> > -Ramon
> >
> > --- wrote:
> > > I need help, quite unknowledgeable about this
> sort
> > > of stuff. I need to
> > > turn on/off 24VDC. I tried to drive 3V relays
> with
> > > the BX24 using the
> > > PutPin method (high output) to fire the relays.
> > > Surprisingly enough it
> > > worked, until I blew an output I/O by drawing
> too
> > > much current (I
> > > assume). Any ideas on how I can trigger 24VDC
> > > momentarily from the BX24
> > > on several output pins (not simutaneously)?
> > >
> > >
> >
> >
> >
> >
> > __________________________________________________
> >
> > http://geocities.yahoo.com/ps/info1
> > __________________________________________________
>
> ------------------------ Yahoo! Groups Sponsor >
>

__________________________________________________





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

relays - Matthew Mangione - Dec 29 17:04:00 2001

i have a 20V motor that i want turned on using a signal from the BasicX. I
figured i could do this by using a simple relay, with the BasicX signal
turning on the relay. However, I have run across problems with this. Is
there a better way of doing this? If not, how can I turn on the relay by
using the BasicX signal? thanx in advance. matt





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: relays - Tony Brenke - Dec 29 18:08:00 2001

you best bet is to use a LM18200.
OR a driverboard from lynxmotion OR from acroname. --- Matthew Mangione <> wrote:
> i have a 20V motor that i want turned on using a signal from the BasicX. I
> figured i could do this by using a simple relay, with the BasicX signal
> turning on the relay. However, I have run across problems with this. Is
> there a better way of doing this? If not, how can I turn on the relay by
> using the BasicX signal? thanx in advance. matt >

__________________________________________________





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: relays - James Cullins - Dec 29 20:50:00 2001

How much current are you talking about?
If it is a dc motor that you want to just turn on and off I would do this.
use a PVI1080-ND photovoltaic isolator and drive a IRLZ44 mosfet to drive the motor.
This way your motor and processor are electrically isolated.
The PVI1080 will generate a voltage to turn on the mosfet.
Digikey has both of them. Just go to International Rectifier's web page to get the specs and
application notes.
hope this helps
Jim

----- Original Message -----
From: Matthew Mangione
To: Basic X Discussion Group
Sent: Saturday, December 29, 2001 2:04 PM
Subject: [BasicX] relays i have a 20V motor that i want turned on using a signal from the BasicX. I
figured i could do this by using a simple relay, with the BasicX signal
turning on the relay. However, I have run across problems with this. Is
there a better way of doing this? If not, how can I turn on the relay by
using the BasicX signal? thanx in advance. matt Yahoo! Groups Sponsor
ADVERTISEMENT

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

RE: relays - Matthew Mangione - Jan 1 21:37:00 2002

so there is no possible way for me to turn on and off a motor without buying
other equipment? How is a servo programmed? It has a power and 1 input, and
it runs - how does it do it? Thanx matt





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: relays - mckamx - Jan 1 22:21:00 2002

The BX-1/BX-24 can drive a servo's control line because this is a
high-impedence signal line, instead of motor power. Inside the
servo, there is control circuitry that does direction and speed
control based on the control signal pulse length. The servo motor
power is drawn from the power wire. If you tried to drive the power
wire of a servo from a BX-24 output, it would not work (and would
probably damage the BX-24). In effect, a hobbyist servo is a small
gearmotor with a particular type of interface circuit packaged with
the motor, which is why servo's generally cost more than equivalent
speed and torque gearmotors.

To turn a motor on and off with a BX-1/BX-24, you will need and
interface circuit of some kind. The cost of this circuit is a
funtion of the current that the motor draws, and whether you need to
do speed and direction control. This can range from less than a
dollar for a transister and a couple resisters to switch 100 mA or
so, up to several hundred dollars for an assembled and tested 100+
amp speed controller. In my latest project I bought a $60.00 dual H-
bridge kit that does speed and direction control for 10-40 V at 10A
for my robot drive motors. However, I am also turning a vacuum
cleaner on and off using a transister switching a 12V circuit that
controls a relay that turns the vacuum cleaner on. The parts cost
for this was about $10 because I bought them at Radio Shack - from
Jameco I could get the same parts for about $2.00. You can get
relays that have 5V coils, but their maximum contact currents tend to
be low, and the relay coil usually draws more current than a BasicX
output can directly supply, so you still need the transister to boost
the current.

...Murray

--- In basicx@y..., "Matthew Mangione" <mlmangione_elect@s...> wrote:
> so there is no possible way for me to turn on and off a motor
without buying
> other equipment? How is a servo programmed? It has a power and 1
input, and
> it runs - how does it do it? Thanx matt





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: relays - peteisaacs - Jan 2 9:01:00 2002

Ok here's a specific question -

What would the minimum, solid state (it is going on a submarine)
ciruity look like to turn on and off a 12v 4A DC pump?

thanks

--pete --- In basicx@y..., "mckamx" <mmckay@m...> wrote:
> The BX-1/BX-24 can drive a servo's control line because this is a
> high-impedence signal line, instead of motor power. Inside the
> servo, there is control circuitry that does direction and speed
> control based on the control signal pulse length. The servo motor
> power is drawn from the power wire. If you tried to drive the
power
> wire of a servo from a BX-24 output, it would not work (and would
> probably damage the BX-24). In effect, a hobbyist servo is a
small
> gearmotor with a particular type of interface circuit packaged with
> the motor, which is why servo's generally cost more than equivalent
> speed and torque gearmotors.
>
> To turn a motor on and off with a BX-1/BX-24, you will need and
> interface circuit of some kind. The cost of this circuit is a
> funtion of the current that the motor draws, and whether you need
to
> do speed and direction control. This can range from less than a
> dollar for a transister and a couple resisters to switch 100 mA or
> so, up to several hundred dollars for an assembled and tested 100+
> amp speed controller. In my latest project I bought a $60.00 dual
H-
> bridge kit that does speed and direction control for 10-40 V at 10A
> for my robot drive motors. However, I am also turning a vacuum
> cleaner on and off using a transister switching a 12V circuit that
> controls a relay that turns the vacuum cleaner on. The parts cost
> for this was about $10 because I bought them at Radio Shack - from
> Jameco I could get the same parts for about $2.00. You can get
> relays that have 5V coils, but their maximum contact currents tend
to
> be low, and the relay coil usually draws more current than a BasicX
> output can directly supply, so you still need the transister to
boost
> the current.
>
> ...Murray
>
> --- In basicx@y..., "Matthew Mangione" <mlmangione_elect@s...>
wrote:
> > so there is no possible way for me to turn on and off a motor
> without buying
> > other equipment? How is a servo programmed? It has a power and 1
> input, and
> > it runs - how does it do it? Thanx matt




(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )