Shop OBEX P1 Docs P2 Docs Learn Events
Serouting via a Darlington — Parallax Forums

Serouting via a Darlington

NewzedNewzed Posts: 2,503
edited 2006-06-12 14:25 in BASIC Stamp
I'm working on a new circuit which I would like to make very flexible.

Suppose Stamp Pin 0 was connected to Pin 1 of a ULN 2003 which hade a supply of 5VDC.· If I take Stamp Pin 0 high, Pin 16 of the 2003 will go low and turn on a 5 volt relay.· That's SOP for the 2003.

Now suppose I wrote:

serout 0, baud, [noparse][[/noparse]byte]· instead of just taking Pin 0 high.· Would byte appear on Pin 16 of the 2003 in an inverted form?· I know I could just try it and find out but I would hate to burn out a Stamp pin in case I have overlooked something.

Thanks

Sid

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Do you have a Stamp Tester yet?
http://hometown.aol.com/newzed/index.html

·

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2006-06-12 14:05
    As I recall, the bounce time of a relay is in the milli-second (mSec) range. And each bit of a 9600 baud SEROUT data stream is also on the order of 1 mSec. So trying to send a real SEROUT byte through a relay wouldn't work too well.

    Having said that, if you're concerned, you can put a 220 ohm resistor between the BS2 pin and the Darlington -- that will protect the BS2 from most things.

    Note also when the Darlington 'de-energizes' the relay, the collapsing magnetic field in the coil will generate a reverse current. This reverse current can burn out the Darlington pin, unless shunted with a diode (which I believe some Darlington devices have internally, so this may not be an issue for you).
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-06-12 14:10
    Sid,

    ·· In theory I would say it might work...But you would need a pull-up resistor on the output since it should be equivalent to an open-collector output.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-06-12 14:14
    Sid -

    Not only will the data from "byte" appear there, but so will the start and stop bits which may well cause all sorts of chatter, which it the last thing you want to see when driving a relay. The parity bit will also appear there, if it is specified.

    Last - if you just want the data to be inverted, you would need to specifiy inverted in "baud". If the whole point of this is just to provide an "opposite" (inverted) signal, just throw a not (~) in front of your output command parameter.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • NewzedNewzed Posts: 2,503
    edited 2006-06-12 14:17
    I wasn't too clear in my post.· The relay would be replaced by a 4.7K resistor so that Pin 16 would be pulled high.· A high on Stamp Pin 0 would produce a low on Pin 16, and vice versa.· Now do you think it would work?

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester yet?
    http://hometown.aol.com/newzed/index.html

    ·
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-06-12 14:20
    Where is the output of the relay going? Who or what will be recieving this signal?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-06-12 14:21
    Sid,

    ·· I am going on the assumption you are not using this with a relay, since you asked about coming directly out of the pin on the ULN.· I guess the only thing to do would be to try it.· Electrically the ULN is a Darlington transistor and as such should act like one, inverting the output.· If you don't connect the V+ terminal on the ULN to anything you shouldn't have any issues with the internal diodes as they will be disconnected.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • NewzedNewzed Posts: 2,503
    edited 2006-06-12 14:25
    Would the ULN function as a transistor if nothing was connected to Pin 9 (V+) ?

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester yet?
    http://hometown.aol.com/newzed/index.html

    ·
Sign In or Register to comment.