Main Site Documentation

Panda II to run fuel injectors



i need to operate additional fuel injectors on an engine and want to use the panda II to do this.
what would be the best way to get this to work?
i already have a mosfet switching board (100V, 10A), so that should work for the injector side.
it needs to be for 8 injectors, so i guess PWM will not work, as the panda II only has 6 of these.
frequency of high and low will need to be adjusted all the time, depending on rpm,
as well as the duration that the injectors are “on” for.

i have already read about the outputcompare method, but it seems it is very difficult to sync.
if i would “manually” set a pin to high and low, how much of a lag would there be between issuing the command and the pins being raised/lowered?
any ideas, or would the panda II be the wrong choice to start off with?


This would be a very bad idea, it will be a long lag and with a lot of jitter.

What you need is very simple but require very tight timing to fire the injectors I think? Will you be sending a pulse to enable the injector? Then why need PWM? Explain more please and we will try to help better.


thanks for the quick reply.

that is what i thought.

true, especially at 8000 rpm :wink:

an injector is a solenoid, so the pulse length determines the amount of fuel.


Ok on output you use a pulse to inject fuel but what is the input? How do you know the RPM?


you really give good support!!

on modern engines, there is a pickup on either the crank or camshaft.

in my case, it is a hall sensor on the crank, which has multiple signals per revolution.
i would need to count the gaps, but i would think there are 30-40 signals per revolution.
can a hall sensor be hooking up directly? since it is like a switch, would it go on an analog or digital pin?


So you are measuring pulse and from there controlling the injectors? This is time critical but extremely basic. What is the benefit from using panda? I mean do you need file system or any of the high level libraries on Panda? If not then it is better to just use any little micro to do this.


You should only need 4 channels for an 8 cylinder engine.

2 cylinders are always in the same stroke. So say 1 & 8 are on the intake stroke, you could open 1 & 8 injectors together.


You need to first figure out what kind of fuel injectors you are planning to use. (Peak and hold, Saturation)
Then you have to figure out how to drive them. None of them are as simple as apply voltage and they work.
There are IC’s built specifically to drive injectors. The LM1949 is one example.

Fuel injectors are a fancy type of solenoid. Opening the solenoid against fuel pressure requires significant current flow. Opening it for the correct amount of time, understanding the opening characteristics that affect time and flow rates requires some work as well. Best bet is to check out the megasquirt open source engine management system. There should be code available that describes a basic fuel injector driver.


i already have one to play with and would like logging to SD, multiple IOs and so on.
are the micros actually faster, are they? instead of logging to SD, i could log via BT or WIFI.

are you sure about this?
in a V8 two cylinders are at TDC, true, but as far as i know, one is in an intake and the other in the exhaust cycle.
that should also mean, that two plugs fire at the same time, which i find hard to believe.
i am only just starting out in engine management though.

very interesting. i have to get more into the actual workings of fuel injection systems.

ready made fuel injection systems are no good to me.
i need something i can program, as i need total control on what happens when and be able to tweak values at run-time, as well as using AI.
the application will be for more then just running some fuel injectors.
it will also be used in other experiments where one mosfet will be set to a certain frequency and other mosfets will be set at a frequency within the first one and at a certain offset to the first one.

i just hope that the panda II is fast enough (with all that weight of .net with its GC and so on) to be able to handle this.
the other alternative would be to implement some stuff in RLP, but i would prefer C#


One premise of NETMF is simplicity in programming and debugging. Things that require very tight timing control, like it would sound your use-case will be, are not always suited for this kind of activity. “Speed” is always relative, and while hte Fez has a high mhz rating, there’s not always a defined speed at which you can perform some of the actions you need and how quickly you can react. Have you figured out how quickly you need to do some of these tasks at your rev range? What calculations are you going to need to do?

Perhaps you may need to actually consider a so-operative processing - something to handle the predictive and supervisor/control aspects, and something to do the electrical interaction with your “devices” ie the injectors. That may allow you to offload the tight timing stuff somewhere that can handle it, and the intelligence (and therefore speed to develop/debug) can be done in your Fez.


@ 366Cobra: Note that there are a lot of other things that you will have to measure like Mass Airflow and Oxygen in the outlet gases.

Possibly also some kind of knock detection…


yep, just my thinking.
after reading up on RLP a bit more, it shows that RLP has precedence to .net, what processing is concerned.
am thinking of doing the switching in RLP and logic in C#.
if this does not work, i will implement everything in RLP
rev range … should go to at least 8000 rpm

@ Errol
there are also more sensors like water and air temp.
in my case there will be even more to take into consideration, as i am mixing fuels


I cannot speak for every engine made, as there are a thousands of cams and cranks out there.
On a 4 cylinder, each piston will be on a different stroke from the rest. When you move to 8 they typically double up on the stroke pattern as it helps get more power per revolution. I.E. instead of having one piston fire , you now have 2. There are many v8 engines out there that only have 4 coil packs. Each coil pack having 2 plug wires both of which fire at the same time. It’s worth some investigating on your particular engine. if this is the case for yours then you may be able to get away with only 4 channels.


Sorry I’m late to the conversion:

For simulations pin setting use the parallel port function.
In my opinion you should start with having 1 Fez IC per time critical function. So the system that controls the injectors should start on it’s on IC. Since Fez’s can be connected together via USB you can have 1 Supervisor fez and 255 subordinate fez’s across a usb hub.

For measuring you should also have a dedicated fez with some kind of emergency shutdown feature (like a reflex action) by which it can send a command to the injector fez without having to go to the command and control fez (that’s 3 so far).

I’m quite interested in topic and would love to see a vid of the end result.


Maybe also look at MC33810. It contains drivers for the injectors.

Question: What is going to fire the spark plugs?



I thought this was about fuel injectors?


Dont forget, your going to need to read the throttle, map, O2 & temp.


@ kurtnelle: Generally spark plugs and injectors are managed by the same Engine Control Unit, hence my question about spark plugs…