Pules input question

Mark.R

Member
Hi gang, is it possible for a picaxe chip to be connected to a mag pickup similar to those used on car ABS so that at specific frequencies of the square wave they give out it would change outputs?

hope that makes sense.
 

BeanieBots

Moderator
Of course, but with certain caveats.
The signal must either be a suitable logic level for direct connection (or be conditioned to be such) and the signal timing must either be suitable for use with the count command or pulsin command to give 'sensible' readings.
The datasheet for the device will answer those questions.

Just don't suggest that you are thinking of doing it whilst still attached to a car:eek:
 

Mark.R

Member
thanks for that and no I wasnt going to do anything on a car it was just an example of the type of pick-up and relucter ring I was thinking of using.
 

BeanieBots

Moderator
If it's just the magnetics, then you will almost certainly need signal conditioning to make it suitable for use with a PICAXE (or any other type of logic input).
 

RobertN

Member
The simplest and crudest method to run a magnetic pick-up signal into a micro is with a series current limiting resistor. This will work assuming the sensor signal amplitude is greater than the input logic threshold. Schmitt trigger type micro input highly recommended. The value of the series resistor is determined by dividing the maximum input signal amplitude by the maximum micro input protection diode current, times a safety factor of 2 to 10.

If the sensor signal amplitude is less than the input logic threshold level, a rail to rail op amp can be used to increase the signal amplitude. A simple series resistor will work here also, if the op amp has internal over voltage protection diodes and the output doesn’t go positive when the input is below ground (some do). If not, external diodes will be needed to clip the signal amplitude to less than V+ and no less than ground. Some positive feed back will keep the circuit stable. Read up on op amp magnetic sensor signal conditioning for better and more comprehensive circuits.
 

gengis

New Member
That sounds easy enough. I just replaced a sensor on my Dodge truck. They wanted $60 for it so I decided I'd wind my own (nothing more than a guitar pickup - cylindrical magnet with a lot of very fine wire around it). Eventually found it for $7 and went with that.

But I did play with the ABS sensor and found it has only a 3 millivolt signal when it "sees" a chunk of plain iron move by it. Faster movement = higher output voltage, but nothing over 50 mv. (that was the "new" sensor - the bad one was even lower)

You just need the frequency and don't care about voltage and that makes the signal massage very easy. A standard op amp will have a gain of ~200,000(!) (open loop - without gain limiting resistors). Input 3 millivolts and get out a rail to rail square wave.

The opamp you use isn't critical - you'll most likely want it work from a single supply. Most do this by just returning the minus power supply connection to ground and biasing the reference input to 1/2 Vcc via a couple of ~10 K resistors to make a voltage divider. Run that voltage to one of the opamps inputs, and your sensor to the other (one end of the sensor will go to ground).

That's pretty much the basics. You would still want to use a couple of clamping diodes so that the input to the amp can never exceed the supply voltage or ground (AC signal out of the sensor). The sensor I had was around 5,000 ohms - so a resistor protecting the input isn't necessary, the internal resistance of 5K is plenty.

It would probably never exceed the supply voltage because the sensor output is so low - but you never know, and if the opamp lost its power supply connection it might just be enough to fry it.

The sensors are going to pick up stray magnetic fields indoors, so expect some power line frequency noise on it if you use a scope.
 
Top