Can GPIO measure injector pulse width directly?
Posted: Thu Apr 05, 2012 7:21 am
Question: How to use GPIO to measure injector pulse width directly (in non-CAN, standalone mode, for datalogging)
Background/Discussion:
I would like to use GPIO in standalone mode to monitor vehicle speed along with injector pulse width for an instant MPG calculator in TunerStudio. The vehicle speed should not be a problem with the VR inputs available, but I'm struggling with measuring the injector pulse width directly (non-CAN). I understand that normally this information is easily gathered from the megasquirt controller, but I don't have a megasquirt installed in this car just yet, so I would like to find a way to measure/log the injector pulse width before I convert to full engine control. As I understand it, the GPIO could not directly measure pulse width, so it will need some hardware modifications.
I struggle with electronics design, so until I gain more experiance the best I can do is google for a solution. I found this pulse width to voltage converter starting on page 92 of Electronics, Design, Strategy, News . http://www.edn.com/contents/images/102501di.pdf
Is this a viable solution? Would it be a simple matter of hooking up the injector (-) to the PULSE IN and then reading the output of IC3 at a general purpose input of GPIO? Also it seems the circuit would need to be modified for a wider range of pulse widths, what range would be suitable?....what parts would you modify and what values can you suggest?
Thank you for any and all comments and suggestions!!
-Troy
Background/Discussion:
I would like to use GPIO in standalone mode to monitor vehicle speed along with injector pulse width for an instant MPG calculator in TunerStudio. The vehicle speed should not be a problem with the VR inputs available, but I'm struggling with measuring the injector pulse width directly (non-CAN). I understand that normally this information is easily gathered from the megasquirt controller, but I don't have a megasquirt installed in this car just yet, so I would like to find a way to measure/log the injector pulse width before I convert to full engine control. As I understand it, the GPIO could not directly measure pulse width, so it will need some hardware modifications.
I struggle with electronics design, so until I gain more experiance the best I can do is google for a solution. I found this pulse width to voltage converter starting on page 92 of Electronics, Design, Strategy, News . http://www.edn.com/contents/images/102501di.pdf
Is this a viable solution? Would it be a simple matter of hooking up the injector (-) to the PULSE IN and then reading the output of IC3 at a general purpose input of GPIO? Also it seems the circuit would need to be modified for a wider range of pulse widths, what range would be suitable?....what parts would you modify and what values can you suggest?
Thank you for any and all comments and suggestions!!
-Troy