Driveline sensor for a tractor?

I am wanting to design a tractor driveline sensor (one that will pick up it's rotation in RPMs and convert it to MPH). I was wondering what are my possibilities in approaching this project? I have the math down for how to convert the RPMs to MPH but i'm not sure how to code for it. Someone was telling me that it's feasible to use a magnetic sensor in some way to do that, but I'm not sure that is my best option nor do i have any clue on how to set up a circuit for it/code for it.

You get a hall sensor or a reed switch activated by a magnet or maybe even a simple microswitch being mechanically activated. The circuit for the latter two is like a button. Whatever Hall sensor you buy will tell you how to hook it up.

In your program you will end up getting an input pin to signa HIGH/LOW (which you probably need to debounce - plenty of examples here), and your program will need to either count pulses in a period or measure the interval between two pulses and that gives you a number you then scale to get the mph. (You dont need to do the maths - you just measure how many pulses / period you get when going at a know speed (measured distance over measured time. That gives you the one conversion constant you need)

Just search for rpm on this forum and you find others have done something very very similar.

The problem/challenge IMHO is mounting the switch/sensor at the axel and the magnet/knob to actiavte it so it is reliable and robust.

http://bildr.org/2011/04/various-hall-effect-sensors/

You might consider using two magnets and spacing them apart on your rim or driveshaft. You can then use the PulseIn() function to measure the time it takes between detecting each magnet. If you're placing your magnets on a large, relatively slow rotating wheel you might want to put several pairs of magnets around the rim for greater accuracy.

I suppose you could also just use one magnet and wait for a full revolution if your driveline location is spinning quickly enough. Or even just detect how long it takes the magnet to pass in/out from under the hall sensor, but that would take a bit of calibration to match that timing with actual speed.

This sounds like an interesting project and something that can definitely be done with an Arduino.

But, can I suggest that you don't use this as your first introduction to Arduino's :roll_eyes:

Spend a month or two looking over some of the sample sketches; blink some LED's; control some motors; alter some sketches so that you start to get a feel for both the hardware and software. Then, when you move onto your real project at least you will able to ask intelligent questions and be able to understand any answers provided.

Good luck