optocoupler question
I am trying to read engine RPMs on an ESP32 board with sensESP.
I have a simple optocoupler board (https://www.amazon.ca/dp/B09TF7LKVF schematic included).
Do I understand correctly that in first approximation, if V+ >> V-, then VOUT=0 but if V+ << V- then VOUT=-VCC (i.e. that 3-4 behaves like a 0Ohm resistor if V+>V- and an almost infinite resistor if V+,V-) regardless of the actual voltage?
If this is the case, VCC needs to match the logic voltage of my board (i.e, 3.3V for an ESP32 or 5V for an arduino), right?
13 Replies
When optocoupler input is triggered then Vout=GND, otherwise Vout=Vcc.
Vcc need to be matched to your logical level.
Check also need for input reverse voltage protection.
Basics of the optos.
https://www.nutsvolts.com/magazine/article/optocoupler-circuits
🙏
Doesn't the LED in V+ line already take care of reverse voltage protection?
And if voltage is reversed it just wouldn't work anyway and no harm will be done (on a 12v system).
@Blaise Will you be getting V+ from the "W" on the alternator?
I'm curious because I'm looking into doing something like this myself.
PC817 has Vr=6V and any standard LED has more or less same spec.
Check from your application how much reverse voltage you can have there and do the desing accordingly.
Thanks for the reply but you've totally lost me.
What do you mean with 'reverse voltage'? If the V+ goes to the "W" of the alternator and the V- to ground there is roughly 14 volt and current is limited by the resistor (14mA).
I'm no pro though but would like to understand.
W is generally unrectified AC signal output. Half of time signal is above V- (GND) and half below.
Depending W signal level, you have to take this into account.
Is optocoupler output voltage linear with respect to input? Does it work like a voltage divider? Or is it binary?
Optos can be used for both use cases.
That is the plan. I just need to figure out the number of impulses per crank shaft rotations
Where are you measuring? What provides V+?
The plan is to get V+ fro the alternator (W wire)
Presumably it's a diesel? I used a CT and an amplifier to make a tachometer/engine hour meter for my outboard, but it's a bit harder to get to the spark plugs on a diesel 🙂
If the optocoupler doesn't work out, you might want to consider a Hall Effect sensor. It might be able to detect the magnetism from the alternator directly, or you could take the more typical approach and attach a magnet to the shaft.
Way back I considered too to use alternator W for rpm, but ended to put 6x neodynium magnets on flywheel and sensing those with Hall-sensor. It gives more accurate result and resolution.
For Hall-sensor, there is no need to use opto in between. Way more simply contruction.