Close
0%
0%

Measuring Engine RPM with the Pixhawk

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

Similar projects worth following

The Briggs and Stratton engine used on #Goliath - A Gas Powered Quadcopter utilizes a magnet on the flywheel to trigger the ignition coils. This magnet will be utilized for measuring the engine RPM with a hall effect sensor under the engine cover.

Hardware

The Pixhawk board has six auxiliary pins that can be configured as PWM out or GPIO. In GPIO they can be used for measuring frequency. Unfortunately they they all have to be one or another and can't be a mix. Since some of the aux pins are being used for servos, this means they can't be used for frequency detection.

The ADC ports don't have interrupts capability, meaning that they can't be used for frequency measurement.

This means that for the current application, an off-board measurement option is needed. An Arduino will be connected to the hall effect sensor to measure the frequency. The frequency data will then be based to the Pixhawk via I2C.

Software

The RPM will be measured and reported using a PX4 Application. The software is part of the PX4 Firmware fork

https://github.com/mccloudaero/Firmware

  • 1 × Pixhawk Flight Controller
  • 1 × SS443R Sensors / Hall Effect, Magnetic
  • 1 × 10k ohm resistor

  • Switching from the ADC port to I2C

    Peter McCloud03/18/2017 at 16:29 0 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.

  • Sensor connected

    Peter McCloud03/13/2017 at 03:07 0 comments

    This project started almost two years ago when the hall effect sensor was first installed underneath the engine cover. The sensor is in a TO-92 package and wire leads were soldered on. The wire was run through a hole underneath the flywheel. The sensor is held in place with a little bit of RTV. Below the installed sensor is shown along with the magnet that is present on the flywheel.

    Today the sensor was connected to the Pixhawk ADC port. The wire leads were spliced onto 3 pin Hirose connector and a 10k resistor was added between the power and signal lines.



    The next step is writing the software application that will read the sensor and determine the RPM.

View all 2 project logs

Enjoy this project?

Share      

Discussions

Does this project spark your interest?

Become a member to follow this project and never miss any updates