View Single Post
Old 04-24-2021, 05:13 AM   #14
apollokid's Avatar
Join Date: Aug 2020
Location: Milan (Italy)

Thank you very much 142 guy for your reply.
As I wrote my knowledge in electronics is limited (I'm not so young, I'm 49 years old and when I get my bachelor degree in informatics I didn't studied anything of electronics, just 3 years at the high school when I was young)
To build this project I had to relearn near everything from scratch (also C and C++ that I've never used in my whole job career, not only about ardunio and electronics) so every new information that can help me to improve is really appreciated.

I agree with you that for analog signals a low-pass filter that cuts high frequencies (for example greather than 10kHz) works very well and I admit that I have already used it to successfully clean the signal of the oxigen sensor that is one of the worst noised signals, full of spikes up to ▒5V also if the signal is between 0V and 1V

I want to show you why I've arrived to the conclusion that optoisolators could fit for my need, but I'm ready to restart from scratch if someone show me a better solution to handle signals.
When I started my project I searched a lot on internet and I subscribed to a forum of electronics trying to do my best to do the things in the right way but it was a so niche materia that I had to find a solution by my-self since I didn't find anyone who could had help me.
I used optoisolators, but I'm pretty sure that LH doesn't use them.

My worst throuble was how to read the pulse width of the injectors without damaging arduino, without affecting the circuit under measure and above all to not damage anything in the car.
The only things that I was able to understand is that zeners has some capacitance that slower the fall of square edge and diodes in general affect the speed of the magnietic field collapsing due to the recirculation of current inside the coil.
Since I was unable to determine how much energy must be released when the injectors close (and since my snubber circuit could have interfered with the electronics of the car) I decided that optoisolators could be the safer way.
I was too much scared to make stupid things and to damage something due to my poor experience.

You told me that you find problems using optoisolators for your tach and cam wheels on my MSII installation. Can you explain me better why?
A 12 tooth crank wheel and at 6000 rpm means a frequency signal of 1200Hz, before writing this reply I retested my 4N35 (that is not classified as a fast optoisolator) to see its performances and what you say is true, optoisolators start to distort the signal when frequency rises but up, but at 5kHz the signal shape, also is not perfect, is yet near accettable in my opionion.

1.2kHz Test
2kHz Test
5kHz Test

The other signals I had to sample are all at a lower frequency, eg. at 6000 rpms the rpm signal is at 200Hz frequency, and also the speedometer reaches 300Hz at 210km/h so it should be not a problem so I decided to use near the same system for al digital inputs.

The only signal that starts to beacame a problem is Tq-signal since I measured it and is in the range of 20Ás to 240Ás (on my car) and so near the limits of the 4N35 that has 10Ás of switching time. Also the way I used arduino is near its limits since I use interrupts with multiple digitalRead() that take near 5Ás for each execution.
For this reason I started to read the ATMega manual beacause I want to learn something about hardware Timers (all new thing for me, and not so easy to learn) to find a better way to take the measure of these short pulses.

About using of Schmitt triggers to clip spikes from rectangular signals seem a good idea, did you tried it?
All the things I've red about this type of comparators with hysteresis were only to square a sine signal but thinking about it they should also remove spikes that go outside the supply voltages (in theory also a standars comparator and may be also a simple BJT transistor used in bjt saturation/interdiction region)
A final question that scares a little to me: how is easy to lead IC to latch-up with spikes, especially after having connected the GND of the car to that GND of arduino? This is for me yet a dark area of knoledge but is another of the reasons for which I thinked that to keep a galvanic isolation between the circuit of the car and the circuit of arduino was a good idea.
apollokid is offline   Reply With Quote