Shop OBEX P1 Docs P2 Docs Learn Events
Wide Voltage DC input circuit - anyone? — Parallax Forums

Wide Voltage DC input circuit - anyone?

pacmanpacman Posts: 327
edited 2010-01-05 20:39 in General Discussion
Rather than re-invent the wheel, I thought I'd ask here...

(originally posted in Sensors forum, but better located here?)


Does anyone have a schematic that they would be willing to share that would accommodate a wide range (between {say} 8V to {say} 40V DC) to allow me to interface these inputs to a Propeller chip (3.3V).

These inputs would be 'monitoring' proximity switches in the field, so they _shouldn't_ (?) have to sink much current..

These inputs don't need to be high speed, and debouncing can be done in the Prop.

Currently I'm thinking of pull down resistors and mmbd4148se chips, but I'm thinking this might be be overkill - so if you have a "tried and true" circuit then I would love to hear from you

Thanks in advance

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
=================
The future is in our hands.
Which way to the future?
=================

Comments

  • PhilldapillPhilldapill Posts: 1,283
    edited 2009-06-10 08:14
    A simple votlage divider should work. This consists of two resistors joined end to end - one end of the string connected to ground, and the other end of the string connected to your voltage. The Propeller would connect to the point where these resistors meet. Be careful in choosing your resistor values, however. You would need to choose them so that the output voltage of the divider is 3.3V maximum(or 3.6V if you want to get techinical).
  • pacmanpacman Posts: 327
    edited 2009-06-10 08:32
    Thanks Phill,

    The problem I'm having with this is that it's a bit input voltage dependant.

    Lets say 12V input, (using some ball-park figures) gives me a 9K, 3K resistor combo (@ 1mA) but if the input voltage was to be a bit high, then I could exceed the magic 3.6V.

    Input voltage @ {say} 15V, then same combo gives 1.25mA , which would give 3.75V across my 3K resistor.

    And it gets worse from there (think 24+V input and I'm in all sorts of pain).


    I was after a more 'tolerant' input circuit as the input voltage today, might not be the input voltage next week....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    =================
    The future is in our hands.
    Which way to the future?
    =================
  • Mike GreenMike Green Posts: 23,101
    edited 2009-06-10 10:57
    Use a Zener diode between the I/O pin and ground with the Zener voltage between the I/O pin threshold and 3.3V (like the 1N5225B at 3.0V). Then use a series resistor (maybe 2.4K) that provides a current of around 8mA at 24V. This'll drop to about 2mA at around 8V (roughly). You could scale the currents up or down if you need to for the sensors.

    Post Edited (Mike Green) : 6/10/2009 11:03:16 AM GMT
  • kwinnkwinn Posts: 8,697
    edited 2009-06-10 14:43
    Mike's suggestion is probably the best one if you have the zeners available. An alternative would be a voltage divider with a diode to the 3.3V supply to limit the voltage. More parts than what Mike suggested though.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-06-10 15:05
    Trouble with low voltage zeners is that they have such a soft "knee" that they draw current below their zener threshold. Since the CMOS inputs have such a huge input resistance I prefer to use high value series resistors without any clamping other than maybe some clamp or shunt resistance on the VDD. The shunt or clamp on the VDD is to prevent that excess current flowing through the substrate and forcing the VDD voltage too high especially when the Prop is drawing very little current as in during reset. My clamps just use two red leds in series with a 22R resistor which exhibits a very sharp "knee" at around 3.3V so that normally the leds just glow.

    Use 100K series input resistors (no divider) and a little trick is to place a small 470pF capacitor on the input pin not so much for switch debouncing but for detecting open/high/low inputs like this:-

    1. Force I/O pin high then back to an input
    2. If input is low then it is being forced low externally so INPUT = LOW
    3. If input is high then force I/O pin low then back to an input
    4. If input is high then it is being forced high so INPUT = HIGH
    5. otherwise INPUT = FLOATING

    *Peter*
  • CounterRotatingPropsCounterRotatingProps Posts: 1,132
    edited 2009-06-11 17:20
    Peter, that's a very cool trick - has that been posted before?

    At the risk of going way OT - You know it would be neat to have some kind of "tricks and traps" thread where we could localize this.

    - Howard

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Got Electrons?
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2009-06-11 17:45
    why not use a npn with about a 10k input to the base. That should get you close to your requirements , but you should check the data sheet of the particular transistor to see what its ma draw requirements are.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-06-11 18:00
    Erik Friesen,

    If the NPN and 10k resistor were configured as an Emitter follower the output would be consistent over a wide voltage range. Just make sure that the transistor that you select has a reverse breakdown voltage HIGHER than the voltage you are applying to the Emitter.


    Note: The signal to the Emitter needs to be driven both HIGH and LOW.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
    819 x 641 - 90K
  • HollyMinkowskiHollyMinkowski Posts: 1,398
    edited 2009-06-15 05:49
    How about using a darlington optocoupler with a resistor to tame the voltage down?
    They are very sensitive, I have used a lot of 4n32 couplers...they are about 30 cents each.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-06-15 06:15
    Beau,

    I especially like your follower circuit. I think it needs a pullup on the collector, though, right? Or are you counting on some base-collector forward conduction to bias the input pin high when the transistor is switched off?

    -Phil
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-06-15 07:35
    Phil Pilgrim,

    The B-E junction of the transistor forms a diode as does the B-C junction regardless if the transistor is turned ON or OFF. In this case the pull-up resistor is the 10K resistor with 1 diode drop.

    Since the PN junction diodes formed between the E-B-C is a back-to-back diode it generally isn't thought of
    very often to be used in this way.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • jagrifenjagrifen Posts: 36
    edited 2009-12-31 18:09
    I am trying to do something very similar. I will have a wide range of input voltages (between 3V and ~48V DC). The emitter follower idea looks very interesting but I am finding it difficult to find a part with EB breakdown voltage of 50V. Most parts I find have a 5V EB breakdown voltage. Am I doing the math wrong? Can anyone recommend a part?
  • ercoerco Posts: 20,260
    edited 2010-01-01 03:43
    This thread is a perfect example of the helpful spirit, knowledge and creativity that is alive & well (and fairly unique) in the Parallax Forums. I love checking in to see what everybody's up to. A safe & happy New Year'e eve and a great 2010 to all!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-01-01 08:28
  • Alan BradfordAlan Bradford Posts: 172
    edited 2010-01-05 20:39
    Here is a circuit I use for Stamp Inputs from 10-240 VAC-DC.
    It provides optical isolation between the Stamp and the HV circuit.

    I have used ths for many years in my industrial Stamp Controllers.

    Good Luck and be careful of the potentialy high voltages.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Alan Bradford ·N1YMQ

    Plasma Technologies
    Canaan NH 03741
    www.plasmatechnologies.com
Sign In or Register to comment.