Input Chematics for 24 Volts !
Johan1968
Posts: 22
I need a sample of chematics for 24volt input to P1 for example, vith Optocupler.. os similar eg..
Regards Johan
Regards Johan
Comments
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
see attached schematic
Opto-isolators would work, but are normally used where the GND is not shared or for very high voltages.
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
(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....
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
Saluti Joerg
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 Baker
Propeller Applications Engineer
Parallax, Inc.
the resistor divider with zener is quite safe. (the uP is not a PROP, but should be similar)
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..
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