Shop OBEX P1 Docs P2 Docs Learn Events
Detecting 12VDC on input pins (safely) — Parallax Forums

Detecting 12VDC on input pins (safely)

Guy TanzerGuy Tanzer Posts: 1
edited 2010-05-14 17:10 in BASIC Stamp
I'm brand new in here, and have been a computer programmer/technician, not an electronics person, so if I repeat a question already answered, please be patient with me.· Thanks in advance!

(I didn't see a search function for the forums - either I missed it (likely) or it could use one.)

I need to be able to detect whether or not a 12VDC curcuit is 'hot' or not using one of the Basic Stamp 2's input pins.· However, I have no wish to fry the Basic Stamp by applying said voltage directly.

Two questions:

1.· What are the safe high limits for voltage and amperage for an I/O pin set to input n a Basic Stamp?

2.· What would be simplest and/or cheapest way to drop 12VDC, such as comes out of a car cigarette lighter plug, to said limits?· I have a sneaking suspicion this involves resistors, but I would appreciate making sure from someone who knows more on the subject.

I don't need to power the Basic Stamp from the 12VDC - I just want to know whether the line is hot or not.· I even considered using a 12V LED and a photocell, since I know from the training book how to wire in a photocell, but I am sure there is a more elegant way of doing this!

Again, thanks for patience with a newbie, and for your assistance, period.
·

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-05-14 04:02
    If you're just looking for an on-off indication, a resistor in series with a reverse-biased 4.7V zener diode to ground should provide more than adequate protection. You could also use a simple resistive voltage divider, but it would not provide nearly the protection for over-voltage situations that the zener solution would.

    Also, Beau Schwabe posted a common-base transistor solution awhile back that was quite elegant. You might do a search on Google (not the forum search) to see if you can locate it.

    -Phil
  • allanlane5allanlane5 Posts: 3,815
    edited 2010-05-14 16:58
    I thought, with a 20 Kohm resistor, you can drop the current from the 12-volt signal to the point where the clipping resistors in the I/O pin can deal with it without damage.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2010-05-14 17:10
    Another option is that used in our Digital I/O Board. You could use an optocoupler to safely interface and the main benefit here is isolation.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Engineering
    ·
Sign In or Register to comment.