Close

Switching from the ADC port to I2C

A project log for Measuring Engine RPM with the Pixhawk

Using a Hall effect sensor and the Pixhawk to measure engine RPM

peter-mccloudPeter McCloud 03/18/2017 at 16:290 Comments

My initial concept was to use a Hall Effect sensor connected to the ADC port on the Pixhawk. However it turns out that using the ADC port isn't an option. It turns out that the ADC ports don't support interrupts. The ports are good for reading sensors, but without interrupts, there's no way to count the pulses to get a frequency measurement.

There are ways to measure frequency with the Pixhawk directly. There are 8 main pins and 6 aux pins that are capable of measuring frequency. However the 8 main pins are being used for controls and the 2 of the aux pins are being used for servo to control the engine (throttle and choke). This would leave 4 open aux pins, but it turns out the for my particular hardware (px4fmu-v2), the aux pins can either be all PWM or all GPIO, but not a mix. Since the 2 servos are required, that means the rest are unusable as GPIOs.

This means that most likely I'll have to an off-board option. A separate device to determine the frequency and pass the data to the Pixhawk via on of the many other data ports. The simplest option for now appears to be using an Arduino to measure the frequency and use I2C to pass the frequency measuring to the Pixhawk. I've got some Trinket Pros on-hand, so I'll start prototyping with that.

Discussions