Shop OBEX P1 Docs P2 Docs Learn Events
Input Chematics for 24 Volts ! — Parallax Forums

Input Chematics for 24 Volts !

Johan1968Johan1968 Posts: 22
edited 2008-02-11 06:59 in Propeller 1
I need a sample of chematics for 24volt input to P1 for example, vith Optocupler.. os similar eg..

Regards Johan

Comments

  • deSilvadeSilva Posts: 2,967
    edited 2008-02-10 11:12
    Good luck!
  • AleAle Posts: 2,363
    edited 2008-02-10 11:51
    A small piece of advice: Read books and datasheets, loads of them. You will find that what you have to ask... is a limit towards zero.
  • StefanL38StefanL38 Posts: 2,292
    edited 2008-02-10 12:11
    hello Johhan,

    i was googling for basic circiuts but did not find anything within 10 minutes

    tell us something about your knowledge about electronics.
    This will help us to find the "right" writing to you.


    this link gives some basic information about optocouplers

    http://homepages.which.net/~paul.hills/SpeedControl/Optos.html

    i know this link does not show exactly a circuit for interfacing to an IO-Pin of the propeller. But the information is still useful.

    to take a QUICK look at wikipedia is always useful. Very often - but of course not always - you will find something helping

    http://en.wikipedia.org/wiki/Opto-isolator

    the picture

    http://en.wikipedia.org/wiki/Image:Optocouple_circuit.svg

    shows the basic circuit

    You have to calculate resistor R1 for limiting the LED-current.
    Therefore you have to know the voltage and the current of the LED
    For most optocouplers it is around 1,5V and 10-20 mA.


    The calculation is: 24V - 1,5V = 22,5V

    Most of the optocouplers will work properly with 5 mA

    22,5V / 0,005 A = 4500 Ohm

    check the powerdissipation of the resistor: 22,5V x 0,005A = 0,11 W. So a small standard resistor with 0,25W will do.

    if you do NOT need superhighspeed switchingtimes this will do

    resistor R2 is a pullup-resistor. Taking 10 kOhm will be OK in most cases.
    The topend of R2 ("V2") is connected to +3,3V

    the small "output-circle" of the picture is connected to the IO-PIN

    the "bottom-triangle" is connected to ground.

    i recommend that you build up this circuit without connection to the IO-PIN and then test the behaviour.

    if you switch the input between 0V and 24V. The output should change between 0,7V and 3,3V.

    Do you have high frequencies f > 1000 Hz at the input?

    Then you should check fall and rising-times with an oscilloscope.

    Idea at this point: youcould do this with viewport

    download

    http://mydancebot.com/viewport/r_download.php

    with this tool you can watch the state of all IO-PINS

    greetings

    Stefan
  • viskrviskr Posts: 34
    edited 2008-02-10 14:45
    For 24V a resistor divider would work fine, add the the zener to protect the prop input.

    see attached schematic

    Opto-isolators would work, but are normally used where the GND is not shared or for very high voltages.
    400 x 300 - 2K
  • AribaAriba Posts: 2,685
    edited 2008-02-10 17:53
    Or still a little bit simpler:
    
       24V ──────────── Propeller Pin
                100 kΩ
    
    
    
  • JoergJoerg Posts: 91
    edited 2008-02-10 18:47
    And then you have blown up the Propeller Chip in less than a moment!
    All these super simple solutions are only good for a fast try, but this is not a serious work at all!

    I highly recommend optocouplers on inputs especially in industrial environments, whereas the 24V level
    are common.

    A optocoupler can also be configured with a pull down resistor and the transistor between propeller input and VCC.
    This way a logic "1" (24V) will represent also a logic "1" on the Propeller input. If the input is not time critical a current of 1-2mA
    will do. This means a 22kOhm resistor on the input side (where the LED is) and a 2.7kOhm resistor between Propeller input and GND (VSS) as mentioned earlier the transistor fits between Propeller input (Emitter) an VCC (Collector). The optocoupler should have a current transfer ratio of at least 1 (100%).

    Saluti Joerg
  • deSilvadeSilva Posts: 2,967
    edited 2008-02-10 19:03
    These are just my personal remarks.. I have too little experience with optocouplers,,,
    (a) I understand that there are situations ("industrial environment") where optocouplers are required as you have different reference voltages ("ground"). In a "standard environment" this is hardly ever the case. Potential differences of 100mV will neither harm the chips nor threat the function....
    (b) A voltage follower will need an additional base current which might afflict its switching behaviour. I see no advantage over an emitter circuitry (Propeller at collector)
    (c) Propeller (and most other CMOS) inputs are safe for 2kV. So I should consider Ariba's standard (!) current protection sufficient even for awkward situations....
  • JoergJoerg Posts: 91
    edited 2008-02-10 19:26
    Dear deSilva

    You are right the Propeller inputs are save up to 2kV, but even walking around on the floor can generate up to 15kV!!
    A resistor in series can not protect over voltages only over currents. So if as i said: do not save on input protection!

    My suggestion in general put a series resistor in input lines AND a diode (1N4148 does a good job) from the input to VSS
    (K on the input and A on GND (VSS)) then a diode between VCC an your input (K on VSS and A on the input) AND last but not least a Zener diode (3.9V) between VCC and VSS (K on VCC A on VSS)! This for any inputs from the "outside" of your circuit.

    This is a really good protection against over voltages an over currents of any polarity but leaving the Zener you may blow up the chip(s) when there are high voltages!!

    Saluti Joerg
  • deSilvadeSilva Posts: 2,967
    edited 2008-02-10 19:30
    Joerg, you are basically right, but most people - including me - would call that total overkill smile.gif
  • JoergJoerg Posts: 91
    edited 2008-02-10 19:53
    Upon your Prop is KILLED!

    Saluti Joerg
  • AribaAriba Posts: 2,685
    edited 2008-02-10 20:03
    Shurely it depends on the environement. But the Original Poster want a Circuit for 24 V, not for 15kV.
    If you have heavy Spikes on the Signal then a R-C Filter (or L-C) before the serial resistor does also the job.
    An Optocoupler is only necessary if you will a "galvanische Trennung" (don't know that in english).

    Andy
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-02-10 20:03
    Johan, I don't see where you specify whether the signal is analog or digital, the solution is different depending which you need. Also you didn't specify the output ability of your source (how much current you can take from it) since some solutions require too much current for low power sources.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • viskrviskr Posts: 34
    edited 2008-02-10 20:28
    Considering I've got 300 some in the field looking at 12V signals in an automotive environment,
    the resistor divider with zener is quite safe. (the uP is not a PROP, but should be similar)
  • deSilvadeSilva Posts: 2,967
    edited 2008-02-10 21:48
    Good engineering is to design and dimension according to requirements...
  • OzStampOzStamp Posts: 377
    edited 2008-02-11 01:41
    Hi Johan

    Attached a pdf file schematic of how a opto coupler can be connected.

    There are more elaborate way's but this is a good simple way that works.

    Believe the fact that you can blow up inputs by just walking around on carpet..
    if anything automotive .. also be carefull.. high spikes exist in a car..

    Static build up ...( car sickness )

    Just do what Joerg say's and your Prop will stay on planet earth..

    Cheers·· ron mel oz..
  • Johan1968Johan1968 Posts: 22
    edited 2008-02-11 06:59
    Thank you all for the help !

    I solve this problem, with a opto.

    I have worked with industrials machines and they always use opo as input interface for I/O safety, and for not damage the prop or periferi ic.

    So thank you all.

    Regards Johan
Sign In or Register to comment.