user31678: I tried to create a tachometer for my motorcycle using an Arduino Uno.
I am trying to measure the voltage of the ignition coil (stepped down to not destroy the Arduino).
I am trying to determine the time between two explosions (one ignition coil high voltage).
I tried to use the pulseIn command in the following way:
unsigned pin=8;
float t;

unsigned long rpm;

void setup() {
    Serial.begin(9600);
    pinMode(pin,INPUT);
}

void loop() {

    rpm=pulseIn(pin,LOW);

    Serial.println(rpm/60);
}

The problem with it is that it won't display stable values. It will go all crazy.
With an open circuit it still displays random values.

user70918: No one mentioned that there is back EMF from primary coil when switch (or points) becomes open. This means that there is 200-300V applied backwards to your voltage divider while you think there is only 0-12V.

31678: <p>I tried to create a tachometer for my motorcycle using an Arduino Uno.<br>
I am trying to measure the voltage of the ignition coil (stepped down to not destroy the Arduino).</p>

<p>I am trying to determine the time between two explosions (one ignition coil high voltage).</p>

<p>I tried to use the <code>pulseIn</code> command in the following way:</p>

<pre class="lang-cpp prettyprint-override"><code>unsigned pin=8;
float t;

unsigned long rpm;

void setup() {
    Serial.begin(9600);
    pinMode(pin,INPUT);
}

void loop() {

    rpm=pulseIn(pin,LOW);

    Serial.println(rpm/60);
}
</code></pre>

<p>The problem with it is that it won't display stable values. It will go all crazy.
With an open circuit it still displays random values.</p>
 70918: <p>No one mentioned that there is back EMF from primary coil when switch (or points) becomes open. This means that there is 200-300V applied backwards to your voltage divider while you think there is only 0-12V.</p>
