12 Volts into the propeller
DavidM
Posts: 630
HI,
I need to get an external 12 volt signal ( a short pulse about 100ms) to "trigger" an input into the propeller.
The 12v signal can be of reverse polarity, so I chose a bridge rectifier (DI104) to handle this, I then send that to an opto isolator ( 4N25) as shown in my schematic.
Q1) Can any one advise is this circuit will work?
Q2) Have I chosen the correct devices ?
Q3) Are the resistor values correct?
Thanks
Dave M
I need to get an external 12 volt signal ( a short pulse about 100ms) to "trigger" an input into the propeller.
The 12v signal can be of reverse polarity, so I chose a bridge rectifier (DI104) to handle this, I then send that to an opto isolator ( 4N25) as shown in my schematic.
Q1) Can any one advise is this circuit will work?
Q2) Have I chosen the correct devices ?
Q3) Are the resistor values correct?
Thanks
Dave M
Comments
Then again, I am kinda new at this stuff. The circuit looks so simple that it would be pretty easy to whip it together on a breadboard and find out for sure.
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
R1 looks too big. I'd try 3k (or have a close look at the datasheet )
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
thanks for the replies,
I have the components so I will make up the circuit!
But..
Would the "SHUNT" resistor R3 , help with avoiding a SHORT CIRCUIT in the 12 volt input?
eg , Imagine that a direct voltage is applied say straight from a 12v battery into the rectifier
regards
Dave M
I am using an opto-coupler because the 12v input can be from "unreliable" sources and I want to protect the rest of my circuit
regards
Dave M
A1) R1, is 10K because I believe its a standard PULL-UP, So when the opto senses an input , the signal should be pulled to ground? I think?
A2) If I leave out R3, then yes, I will need to make R2 smaller to let more current in, I can play with the resistor values on my PCB, Its the "wiring" I want to get right.
Thanks
Dave M
(2) I should consider Nicks concerns
(3) Take 1/2 Watt resistors by all means!
(4) The Propeller - as all CMOS chips - is safe for around 2kV, which is the voltage wie carry "in our little finger"
Opto-couplig is used when you are really unsure about the GND-situation or are a true paranoic
Edit: No, R1 is a collector resistor!
Thanks for your reply,
1) Ok, I will forget about R3!
2) I will try 3K for R1, instead of 10K
3) I will use 1/2 watt resistors,
4) yes I am true paranoic????? So I will keep the opto!
thanks everyone for your help!
I can't see in the spec sheet for the opto how to derive the current required for the input to the internal LED ? What parameter in the spec sheet do I look for?
I am figuring that a 500R to 1K resistor ( for R2) over 12 Volts should give me about 20-10ma? is this correct?
I took off 0.7 volts for each two of the diodes in the rectifier.
12V - 0.7 X 2 = 10.6V
10.6V / 10ma (0.01A) = 1060 ohms ( approx 1K )
OR,
if I need 20ma then..
10.6V / 20ma ( 0.02A) = 530R
I have attached a revised schematic.
regards
Dave M
Always better to be safe than sorry when dealing with unpredictable voltages, so I think an optoisolator is a good idea.
R1 should be as low as you can get away with.
I am thinking the same thing,
But..
I need the "CONNECTIONS" right first, as I am trying to finish some PCB designs, I can always play with the resistor values later!
Thanks
BTW, if a base pin is available you can ignore it completely unless you want to bias the transistor in some fashion.
*Peter*
au.farnell.com/jsp/Optoelectronics/Optocouplers/AVAGO+TECHNOLOGIES/ACPL-824-W00E/displayProduct.jsp?sku=1339027
www.jaycar.com.au/images_uploaded/optocoup.pdf
For people who think a collector resistor is a pull-up is a "pull-up" this will be intersting to read as well:
www.utdallas.edu/~randall.lehmann/Experiment%205.pdf
You *need* one if you need or want to isolate grounds. With a common ground it isn't necessary.
With a common ground, a voltage divider and a limiting resistor (just to be sure) on the Propeller's input does the job perfect.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
PULLUP + SWITCH
If the propeller input is connected to a pushbutton to ground then we would also add a "pullup" resistor to VDD so that the input will either see either +3.3V or 0V right?
PULLUP + TRANSISTOR (or PHOTOTRANSISTOR)
Now connect a phototransistor in place of the switch and you will get either 3.3V (no activated) or close enough to 0V when the transistor is turned on right?
So what's the difference?
IT'S ALL ABOUT CONVERTING CURRENT TO VOLTAGE (PULLUP or COLLECTOR RESISTOR etc)
All the resistor does is to allow current to flow so that Mr Ohm can do his work. We know that R=V/I so zero current means some infinite resistance (no such beast really). If the resistor is 10K connected to 3.3V and the other end of it is connected to a CMOS input whose resistance is way high enough not to consider but let's pick an absolute worst case figure of 330K (10ua leakage @3.3V) although it really is 100's of megaohms.
PULLUP CMOS INPUTS
Ohm's law tells us that V=RI where the voltage across the 10K (to VDD) is 100mv but the voltage across the input to ground is the difference of this = 3.2V(min). Voila!, this is our pullup so far that has taken the input to a logic high.
CLOSING THE SWITCH
Now close the switch to ground and even through a very bad contact of 100ohms what will we get at the input? Let's see... I=V/R where R = 10K+100ohms = 10100ohms and V = 3.3V so that we get I = 327ua (we can ignore the negible effect of the CMOS input). Now the voltage at the input is the same voltage across the bad contact resistance of 100ohms so that V=100*327ua - 0.0327 volts (close enough to zero).
So it is never ever 3.3V or 0V but very very close to it which makes not one iota of difference to a logic input.
EFFECTS OF DIFFERENT PULLUP RESISTORS
Now that we can see how it works we can easily calculate the effect of increasing of decreasing the pullup resistor.
Assuming the worst case 330K CMOS loading and the worst case contact resistance of 100ohms....
RESISTOR HIGH LOW
100K -> 2.5V 0.003V Logic high is getting a little low but still above the 2V logic high threshold
10K -> 3.2V 0.03V Good logic levels
1K -> 3.29V 0.3V Logic low is getting higher but still ok
100R -> 3.299V 1.65V Logic low is unacceptable
Great, we can use any resistor from 1K to 100K as a pullup, the choice is up to you. But the Propeller's leakage current is spec'd at 1ua max instead of 10ua so it means we could even use a 1M pullup and it will still work.
LET'S JUST MAKE THE PULLUP HIGH OK?
Maybe, because there is capacitance on the CMOS input that takes a finite time to charge and 6pf + 1M = 6us. Add in trace capacitance and that climbs but the response is still ok for switches. Actually you want some current to flow through the switch for "contact wetting" reasons.
LET'S JUST MAKE THE PULLUP 1K OK?
Maybe, because a switch would work fine but a phototransistor is conducting current and at 20% efficiency that means you would need 16.5ma through the led plus the transistor would not actually switch to 0V as it's not actually a resistor (lookup Vce saturation).
10K is an all round value for a PULLUP!
We knew that.
Tired now? Me too.
*Peter*
... and 10V supply!
We have 3.3V.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
Lately I've been trying out the 'subscribe to forum' option which sends me an email for every message here. The tedious part is sorting them into heaps of discarded and nuggets of prop wisdom, but the pruning is no more problematic than any other system.