djsfantasi
- Joined Apr 11, 2010
- 9,156
Like using a switch bebounce function on the signal input?One way would be to get the ESP software ignore pulses narrower than some limit.
Like using a switch bebounce function on the signal input?One way would be to get the ESP software ignore pulses narrower than some limit.
Yep, that'd do it.Like using a switch bebounce function on the signal input?
That's certainly worth a try, as long as that spike in the rising edge doesn't get too "fat" anywhere in the engine's RPM range. I'll check that, and if it doesn't change much, I'll try this interrupt debounce method that I found:Like using a switch bebounce function on the signal input?
@crutschow - I went up to 20K, and it helped a LOT! My output is now close enough for my purposes, but it still fluctuates a little, so I will continue to try bigger ones. I will try 40K next. Please tell me how you calculated that it can handle that much - my calculation was to use 1.68K. (18V - 1.2 fwd voltage of the LED in the optocoupler = 16.8, divided by 10mA = 1.68K ohms - I think?) But that was probably the minimum calculation. How do you calculate the maximum?You could also try a larger input resistor, such as about 40kΩ.
Hi, yes, you have it pulled up. Sorry, I mis-read the schematic the first time. Beyond that, it's a filter issue, and you were able to fix it.Boba - do you mean a pullup like the one shown in the schematic, btween the input pin and the ESP's 3.3V pin? Or add another one somewhere else in the circuit?
I don't care about the logic - in the software, the interrupt is set to to CHANGE. However, since the "noise" seems to be in the rising edge, maybe all I need to do is set the interrupt to FALLING, and multiply my count by 2. The falling edge seems very nice and clean.