Magnetic pickup (variable reluctance) sensor inputs to photon

Not sure if I should have posted this here or in general, so if it’s not right let me know I’ll repost.

I’ve been playing with my new to me photon getting used to how it works. What I’d like to do eventually is read a speed sensor off a car driveshaft which will be a toothed tone ring on the rear axle yoke and a magnetic pickup sensor. Then depending on the vehicles speed in about 3 ranges (0 to 10mph, 10 to 35 mph, 35 plus) the photon will output a different CAN-bus message using a Carloop CAN-hitch. Electronics isn’t really my strong suit. I have a decent understanding of the basics like resistors, diodes, capacitors, transistors, etc. from automotive tech classes twenty years ago (I’m an auto technician) but I don’t really know what to search for in terms of hooking the sensor to the photon’s digital input and conditioning it so it can be read properly.

If someone could point me in a direction to search or give me some search terms that would be extremely helpful. Ultimately, this will be going on an older 60’s Ford car that has a Toyota Prius electric steering assist motor installed. Currently the Toyota assist motor gives a minimal assist level (out of three assist maps) because it isn’t receiving an engine running or wheel speed signal on the CAN-bus so it therefore goes into failsafe mode. I know I can program this photon to just output a steady speed without the input and I could could set it to the medium or maximum assist map based off speed. However If it would read in the cars speed that would make it operate like the Toyota does, max motor assist at low speed for parking, minimal assist at higher speeds for road feedback and feel.

1 Like

Why not make it even easier, and read the speed from the ODB port?

@seulater, on a 60’s Ford?

@TimC, have you got some data/datasheet about your sensor?
I’d use interrupts to get the timing and calcualte the speed, but for that we’d need to know more about the sensor and about the expected frequency of the incoming pulses.

Its a 1960’s Ford Car. It doesn’t have a computer other than the Toyota electric power steering (EPS) module that runs the electric assist motor on the steering column. The Toyota EPS has a CAN-h and CAN-l wire coming from it where it was wired into the Prius CAN bus network. I currently have it going to a OBD port through a twisted pair with two 120 ohm resistors as a simple CAN bus network. I can attach my scan tool, read and clear codes, and recalibrate the torque sensor on the column, but there is no ABS or ECM as the Ford never had those.

I plan to set up a Photon and the CAN-hitch so the programmed Photon will transmit the appropriate wake up signals to the toyota EPS module through the CAN-hitch. Like I said I can set it up so It just transmits a set can signal such as “Engine rpm 1000, Wheel speed 10mph or 30, or 60, etc” but If I can get the Photon to read in a signal and then program it to change the CAN message based off the output, that would be even better.

Whoopsee, Read it to fast :wink:


I was thinking of using a setup like one of these:
Which has a tone ring and a magnetic pickup


s-37x-j from this site:

Which has a collar with 4 magnets and supposedly a hall effect switch.

The car has a 4 speed with a 1:1 high gear so currently at max rpm in high gear the driveshaft would be around 6000 to 6200 rpm as the driveshaft turns at engine speed in high gear. If i swapped in an overdrive trans in the future it could theoretically go as high as 8000 rpm but thats doubtful the car would ever see such a high road speed as to max out the engine in overdrive.

So with 4 magnets it would be 26,000 pulses per minute at 6500 rpm or 433.33 pps. For the phr kit with the tone ring with 8 teeth it would be double those numbers.

According to this datasheet it you should be able to power the hall sensor off of 5V which allows you to feed the output into any 5V tolerant pin where you can hook up an interrupt to measure time between two trigs and calculate the speed.

If you need to power the sensor with anything higher than 5V you need to limit the output voltage to 5V to prevent frying the GPIO.

1 Like

OK. Thanks, that sounds simple enough. I wasn’t sure if it required some sort of filter circuit.

I plan on powering the photon off a gutted car USB charger. I should be able to power the sensor off of it at 5v also.

I really appreciate the feedback, like I said earlier this is a little outside my comfort zone.

1 Like