Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Hall-Effect -> PIC

Status
Not open for further replies.

rackley

New Member
Hello,

I'm trying to capture engine RPM in diesels into an 18F series PIC, but it could easily be any uC because my question is about the circuit involved, not really about the PIC.

Background story, if you're interested:
<background story>
I originally/now am using an LM2907 frequency to analog converter to make an easy to read analog voltage for the PIC. This allowed me to "cheat" and not have to set up the CCP/timers/code for what is an already fully loaded/strained chip. However, the LM2907 really isn't working out very well because of its characteristics. At lower frequencies of the range it is configured for, there is more jitter and variance than at higher, which is exactly opposite of what I need. It also doesn't have near the resolution/accuracy that I need (at 600 rpm, it fluctuates from 600rpm readings to 1200rpm readings). There is also another, bigger problem - I need to be able to interface with not just crank angle sensors (1 pulse/rev) but cam angle sensors (2 pulses/rev), which changes the frequency range, which requires a physical capacitor change on the chip. This is a show stopper for a chip, but in software it's a simple matter to correct for.
</background story>

I don't have to worry about ignition coils and the dirty stuff they throw out since these will all be diesel engines and (obviously) they don't have spark plugs. So my RPM source must come from a hall sensor or an output signal from the PCM. Every engine out there will have a hall sensor on either the crank or cam, so that's the lowest common denominator I can use.

So my question is, what kind of circuitry can be used to interface a hall sensor (with a 0v to 15v range most likely, maybe higher) to a 5v max (or 3.3v max) input without altering the original signal on the line (which still must be used by the car's PCM)?

I was looking at optoisolators and they seem to be able to do the trick nicely. However, will sending the signal through the LED with enough amperage to light it up alter a hall sensor's output significantly? Also, it doesn't look like I should need to do any more cleaning up of the signal on the other side, before sampling by the CCP of the PIC correct? Are there any modern/popular optoisolator part numbers I should be looking at besides the 4N35 series?

Thanks,
Ray
 
Hi Rackley,

instead of messing around with a hall sensor in an environment of lots of iron and steel I'd prefer to use an optical sensor. There are reflection type opto-sensors (CNY70? IR-reflection sensor) which mounted close to their focussing point (between 3 and 5mm) near a rotating part will give precise information.

Use one of those, make a white mark or a self-adhesive aluminum strip to the crankshaft or the wheel mounted on it and use the signal directly to be fed to the MCU ready for counting.

The signal will be strong enough even if you drive through mud puddles in the jungle.

Regards

Hans
 
Hello Boncuk,

That sounds like a viable option, but these are installed by people with very minimal electronics or mechanical background or experience. Tapping into an existing sensor line is as far as I'd be willing to stretch my expectations of their technical skills. Mounting an additional sensor on a (frequently covered) crankshaft or camshaft just isn't feasible to expect them to do. Thanks for the suggestion though!

Ray
 
Yes, but the questions about the interface circuit remain.. I've ordered a few 4N35's to play around with and watch on the scope to see how things go.
 
rackley said:
Yes, but the questions about the interface circuit remain.. I've ordered a few 4N35's to play around with and watch on the scope to see how
things go.

I am not an analog guy but it seems to me that you are going in the wrong direction.
Your goal is to sample the signal without effecting it too much. Opto-isolators are used to isolate a signal, protection from over voltage sort of thing.

An op-amp with a high impedance input would pass the signal on without drawing much current from it. If you wanted to use an opto-isolator after the op-amp you could but I do not see where it would be needed. Maybe put a zener on the input of the op-amp to clamp spikes.
 
You could use a CD4000 series IC. They work directly on 12V and have very high impedance inputs so they shouldn't affect the Hall sensor output. You can use a voltage divider on the output of the CD4000 series IC to drive a 5 or 3.3 V system.

You could avoid the sensor completely and take a signal from the alternator. The voltage before the rectifiers swings from about +15V to -1V and you can take any current you want without it affecting the vehicle.

The frequency of the alternator voltage is directly proportional to the engine speed.
 
Diver300 said:
You could use a CD4000 series IC. They work directly on 12V and have very high impedance inputs so they shouldn't affect the Hall sensor output. You can use a voltage divider on the output of the CD4000 series IC to drive a 5 or 3.3 V system.

You could avoid the sensor completely and take a signal from the alternator. The voltage before the rectifiers swings from about +15V to -1V and you can take any current you want without it affecting the vehicle.

The frequency of the alternator voltage is directly proportional to the engine speed.

Good idea but the alternator belt is not a direct drive and may slip. If that is OK then it will work.
 
Also, the alternator might have the rectifier module built-in; if so there'll be no way to get your hands on the unrectified signal.
 
There is alternator belt slip. However it is very small, about 1%, and fairly consistant.

The AC side of the alternator isn't normally available as a terminal, but the wires are big and easy to find. I have done that before for engine speed detection.

Some Ford diesels, when there were no electronics on the engines, had a rev-counter run off an extra terminal on the alternator, that provided an AC signal.

I have also seen a diagnostic rev counter that plugged into the cigar lighter, and detected the ripple on the voltage. The signal conditioning for that is a lot more difficult, as the ripple is very small.
**broken link removed**
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top