I am building a gear indicator for my bike that will use speed and engine RPM to determine the selected gear. Bike has hall efect speed sensor and magnetic pickup coil to measure engine rpm.
Speed sensor uses 3 wires - GND, 12V power supply and signal, pickup uses 2 wires - GND and signal.
Speed sensor should provide square signal, while pickup produces AC current. When I was measuring the voltage with multimeter, speed sensor was producing round 5V at steady wheel and when motion occur voltage dropped to round 2.5V and then continued to drop for 0.1V every extra 10 kph.
Pickup was feeding 0V at engine shut off, round 2 VAC at idle and climbed as high as 10VAC at higher RPM.
In my project I'll be using PIC MCU (probably 16F or 18F family) and I was thinking to introduce MOSFET between sensor output and PIC input. Signal voltage will open/close the transistor gate and thus allow/deny the PIC system voltage to be feed to the PIC input pin. To measure time between two signal squares I was thinking to use PIC's CCP module in a capture mode.
I have no idea how to read AC signal from a pickup. One way would be to use a voltage divider and rectifier diode but that probably won't work, since some current will be lost in resistors (disturbing the bike's CDI unit). Also I doubt that voltage and RPM are in linear coleration. So what approach do you suggest to use. Is it posible to drive AC signal through a rectifier diode and then use the signal to open/close BJT transistor on which PIC's system voltage will be applied. Then leeding the output on a schmitt trigger device to get a square signal useful to read on PIC's input pins.
PS
PICs also have the option of Schmitt Trigger input with CMOS levels. Maybe that can be used instead of separate IC.