Hi Everyone.
I'm new here, Ive done a bit of PIC programming in the past. Just gotten into the Arduino.
I am working on a digital speedometer for a motorcycle. The power supplied by the motorcycle is 12vAC, I will rectify and regulate this down to 5vDC to power the Arduino and LCD display... However, I would like to measure the frequency of the 12vAC, as this will allow me to calculate the RPM of the engine.
One idea is to connect a coil to the 12vAC and use a hall effect sensor pick up the fluctuations in the coil....
How about, connect an IR LED with resistor to the 12vAC this will basically make the IR LED blink on and off relative to the RPM,point the IR LED at a photo diode hooked up to the Arduino and use pulsein()?
I like you idea Rugged, but i would feel a bit more comfortable using the opto isolator between the 12vAC and the input....
Please check my logic: darlington optio isolator input connected to 12v AC via a 1N4004 and a 470ohm resistor, this should make nice +-2V pulses for the input of the opto. Then the output of the Opto connected to a digital in ?
The datasheet linked from Sparkfun (LTV-816) is not a Darlington! Maybe they're selling you the PS2532 used in the example.
There isn't a good reason to use a Darlington here (other than that you have one!) because you have plenty of input current and minuscule output current. Darlingtons are slower, though it probably doesn't make much difference here.
If you want to consider another optocoupler, there are AC optos that will simplify things a bit. Something like the PS2505 might be ideal. I use these for sensing low voltage AC from a model railroad. Connect the emitter to ground and the collector to a pullup and the Arduino input (or the input alone if you're using the internal pullup).