# Question about LM1815 implementation

After asking here a question about my motor sensor (a VR sensor or Reluctor), I've found the LM1815 chip (and also the MAX9924 but too much complex for my use). I want to use it to get the RPM engine value with an Arduino. DATASHEET

For the moment I didn't have the maximum AC voltage from the sensor, only sensor resistance (900 ohms) and max Frequency (5kHz from my calculation).

I have some questions:

• I didn't understand the purpose of the One-Shot function of this module. I need to understand the function to know if I need to connect the pin to ground or to RC components like shown in LM1815 diagram.
• I didn't understand the calculation of the RC. What's the purpose of this timing? How to choose the best values? (In datasheet, they said 150kOhms for the resistor and the capacitor can be set at any value)
• As I understand, the maximum output voltage can't be more than VCC voltage. If I supply with +5V, the maximum output voltage can't be more than +5V, right? Insecurity is it a good option to add a Zener diode on the output with a drop voltage of 5.1V?
• I think I will need to use the MODE 1 and not the MODE 2 (Mode 3 is for Zero-crossing as I understand). For the moment I don't know if I need a threshold of +-200mV or less. But I think I will leave it in MODE 1 for more flexibility. Is it a good choice you think?

Thank you for help !

I have no experience with that IC, but my understanding of the datasheet with respect to your questions is as follows.

### Timing

You must provide a resistor and capacitor to control the length of the pulse produced by the LM1815. A 5kHz input signal has a period of $$\T=\frac{1}{5000}=200\mu s\$$, so you need the LM1815 to emit a pulse which is significantly shorter than that, so that it can return to its "inactive" level before the next pulse is triggered.

This is the meaning of "one-shot". A single pulse, whose duration must be shorter than the period of the sensor input signal. A new pulse of duration $$\0.67RC\$$ is triggered once for each cycle of the input signal.

I expect an output pulse duration of half (or less) of the minimum expected input period will do, which is 100μs. By that logic:

\begin{aligned} t &= 0.67RC \\ \\ RC &= \frac{t}{0.67} \\ \\ &= \frac{100\mu s}{0.67} \\ \\ &= 1.5 \times 10^{-4} \\ \\ \end{aligned} Or, use their equation (2) on page 9: \begin{aligned} f_{max} &= \frac{1}{1.35RC} \\ \\ RC &= \frac{1}{1.35f_{max}} \\ \\ &= \frac{1}{1.35 \times 5000} \\ \\ &= 1.5 \times 10^{-4} \\ \\ \end{aligned}

They say that R is at most 150kΩ, but they don't specify a minimum. You could use 100kΩ, for example, so C in that case would be:

\begin{aligned} RC &= 1.5 \times 10^{-4} \\ \\ C &= \frac{1.5 \times 10^{-4}}{R} \\ \\ &= \frac{1.5 \times 10^{-4}}{100 \times 10^3} \\ \\ &= 1.5nF \\ \\ \end{aligned}

### Output

If the supply voltage (Vcc) to the LM1815 is +5V, and your Arduino and the LM1815 share the same ground, then the "gated" output pulse (pin 10) will be either 0V or 5V (or more likely slightly inside those bounds). I don't see any reason why you'd need to protect your Arduino with a zener diode, unless there's something you're not telling us.

Be aware that pin 12 is an open collector output, which makes no such guarantee. You could connect a resistor between pin 12 and +12V, for example, to derive 0V/12V digital pulses, and obviously that would fry your Arduino.

When not in use (which seems to be your case), "Input select" (pin 11) and "Timing pulse" (pin 9) should be tied to ground.

### Mode

Mode 3 is not recommended, since (to my understanding) it inhibits any input hysteresis, and makes the LM1815 vulnerable to input noise.

Modes 1 and 2 differ only in the amount of hysteresis the IC will implement. If your input signal is significantly larger than 0.4V (peak-peak), and will contain a lot of noise, then use mode 2. If you don't anticipate significant noise in your sensor's output, then stick to mode 1.

• Thank you for your clear and understandable explanations!!! I've some serious stuff to start working now. I just need to know my Voltage to choose the correct mode (I didn't have oscilloscope so I can't check the noise level). I just have some questions. In truth table, they say the Pin 9 must not be connected to anything and not to ground (first line). Is it good or not? What about the peak detector on pin 7, should I connect these components too? As i understand, only in mode 1. Commented Aug 17, 2022 at 6:41
• You might be right about not connecting pin 9, though the datasheet isn't very clear on that. I'd still connect it low. The peak detector capacitor/resistor is needed for the "adaptive" part to work. Yes, you should connect a capacitor and resistor to pin 7, as shown on page 6, and with those same values. Otherwise, 90% of this IC is pointless, and you can't use modes 1 or 2. Commented Aug 17, 2022 at 6:55
• Many thanks for your explanations ! Okay for the pin 9. One last question, I've just checked another time the data sheet and I've seen an 1kOhms resistor on the output, it's a pulldown resistor right? Commented Aug 17, 2022 at 8:06
• @MauriceChocoswiss I think that's a test load, used to provide data for the specification table. You don't need it. Commented Aug 17, 2022 at 11:54
• Ok, my first idea was it's a pulldown resistor to prevent false result with electromagnetic perturbations. But yes, in spec, it's written RL = 1kOmhs. So, I didn't need a pulldown resistor ? Commented Aug 17, 2022 at 12:21