Hi, I'm using Arduino pro mini 5V. My digital input pin always dead after reading a fast rate of engine rpm pulse signal. I'm using optocoupler pc817 to isolate the input with an internal pull-up resistor. What the cause of this problem?
I'd expect your PC817 to be dead as you don't have a resistor in series with the LED.
What is D1 for? I can't see any reason to have it. Try replacing D1 with a 220 Ohm resistor and maybe try a new PC817.
Your schematic is nice and clear but does not match the words, as it says 'ignition coil pulse' but with nothing in the schematic that suggests a connection to an ignition coil.
sorry my bad, I didn't add a resistor series with the led in the image. but in the actual circuit, I already implement it. the D1 is used to prevent any backward current from the ignition coil signal. in other words, the ignition coil runs on 12V to 14V and the D1 is just to prevent it spikes into the Arduino or damage the pc817. I pick up the signal from the -ve side of the ignition coil. The ground symbol is just like a -ve pin of the ignition coil. after removing PC817, I noticed my used pin is already dead.
Is the PC817 located close to the Pro Mini or is it some distance away on long wires? I'm wondering if the wires are picking up electrical noise and that's what is causing the damage. A photo might help.
Your diagram suggests that both side of the opto isolator are connected to the same ground. If this is not the case then you should have different ground signals to differentiate between the two.
the red circle is PC817 which pickup the ignition pulse and the blue circle is the pro mini. is the distance enough?
Grumpy_Mike
at the input of PC817 I'm sharing the ignition coil -ve signal as the ground(High volt). which is outside of my board. in other words, when the ignition coil is activated or generates a spark there is ground that will exist at the side of -ve pin of the ignition coil. On the output side of PC817 I'm connected to the Arduino ground. the Arduino power up with a 5V buck converter which is power up from the vehicle. I hope you can understand what I'm trying to explain.
the red circle is PC817 which pickup the ignition pulse and the blue circle is the pro mini. is the distance enough?
No way to tell from what you have told me and shown me. The PC817 should be close to the Pro Mini so the wires are short. By short I mean a few centimetres at most.
Really need photos and an accurate schematic, I think it's clear that the schematic you have posted is not accurate.
EDIT
I didn't see the photo when I typed the above. Yes, close enough.
There's no doubt that ignition systems produce a lot of high voltage electrical noise. You seem to have isolated the ignition from the electronics. I can only think that some of the noise is getting through by some unexpected path. Do you have an oscilloscope? If it were me I'd be checking to see what is really happening on both sides of the PC817, you might be surprised.
PerryBebbington:
No way to tell from what you have told me and shown me. The PC817 should be close to the Pro Mini so the wires are short. By short I mean a few centimetres at most.
Really need photos and an accurate schematic, I think it's clear that the schematic you have posted is not accurate.
EDIT
I didn't see the photo when I typed the above. Yes, close enough.
so do I need to make it far from the board or any suggestion? before this, I had try the voltage divider method and I got the same result (pin dead);
There's no doubt that ignition systems produce a lot of high voltage electrical noise. You seem to have isolated the ignition from the electronics. I can only think that some of the noise is getting through by some unexpected path. Do you have an oscilloscope? If it were me I'd be checking to see what is really happening on both sides of the PC817, you might be surprised.
I don't have it. can't afford it right now. I hope can buy it someday. so the noise from the ignition coil is the factor why my Arduino pin dead even though I'm using an optocoupler.
harizsaid:
so do I need to make it far from the board or any suggestion? before this, I had try the voltage divider method and I got the same result (pin dead);
Before you posted the photo of the board I was concerned that maybe there was a long cable from the PC817 to the Pro Mini, like maybe 1m or more. Now I know they are right next to each other I know that's not the problem. I'm hoping someone else will start helping because I don't really know else what to suggest.
You could make R1 a lot higher, maybe 10k or something. I'd make it as high resistance as possible, that is find out how high a resistance stops it working then use a resistor something like three quarters of the value at which it doesn't work. Try 20k, or even 30k. That will significantly reduce any noise being fed into the pin.
Are you saying that the pro mini and code works at low RPM, then after high RPM the input dies and never works again, even after resetting the pro mini? Or does the code just fail to function at high RPM then works afterwards at low RPM?
PerryBebbington:
You could make R1 a lot higher, maybe 10k or something. I'd make it as high resistance as possible, that is find out how high a resistance stops it working then use a resistor something like three quarters of the value at which it doesn't work. Try 20k, or even 30k. That will significantly reduce any noise being fed into the pin.
Ok, I'll try it first. I noticed that this thing didn't happen on my UNO board. I'm using USB to power up my UNO.
david_2018:
Are you saying that the pro mini and code works at low RPM, then after high RPM the input dies and never works again, even after resetting the pro mini? Or does the code just fail to function at high RPM then works afterwards at low RPM?
yeah. it dies when high RPM sometimes it good and never works again when it broke once until I change to the new pin.
PerryBebbington:
I'm not familiar with the Pro Mini but generally you connect 5V to the 5V pin. Not that I think it's the cause of your problems.
I'm afraid to connect a 5V pin because sometimes the buck converter will give me high reading above 5V like +-0.15V or maybe higher than that when the engine gets started.
harizsaid:
I'm afraid to connect a 5V pin because sometimes the buck converter will give me high reading above 5V like +-0.15V or maybe higher than that when the engine gets started.
+- 0.15V isn't a problem, higher voltages are. That bothers me, it shouldn't happen.
Can we have some more photos please of the actual installation? Not the bare board.